Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to extract/create a JointDef based off a b2Joint instantiation
    primarykey
    data
    text
    <p>I'm trying to serialize a b2World, and due to Box2D's many private objects that are used, made, and deleted internally, the issue becomes much more complicated. I decided that i should use these internal objects get() functions to get the data i need, and create a "b2Definition" object based off it at save time, and use the definition with the global factories "create" methods to recreate the objects.</p> <p>I have encountered a few problems i need help on however: <strong>In the following code is all the JointDef data i need, but can't figure out how to get from the pointer to the correct type of object.</strong></p> <p>I also am wondering if i should even attempt to save contact data.... Is it automatically made in the factory create metods?</p> <pre><code> b2WeldJointDef JointDef; //QUESTION: how do i get this //JointDef.referenceAngle= Joint-&gt; ????? b2GearJointDef JointDef; //QUESTION: how do i get these //JointDef.joint1= Joint-&gt; ?????? //JointDef.joint2= Joint-&gt; ?????? b2LineJointDef JointDef; //QUESTION: how do i get these?? //JointDef.localAxisA= Joint-&gt; ???? //JointDef.lowerTranslation= Joint-&gt; ???? //JointDef.upperTranslation= Joint-&gt; ???? b2MouseJointDef JointDef; //No problems b2PrismaticJointDef JointDef; //QUESTION: how do i get these?? //JointDef.referenceAngle= Joint-&gt; ???? //JointDef.localAxis1= Joint-&gt; ???? //JointDef.lowerTranslation= Joint-&gt; ???? //JointDef.upperTranslation= Joint-&gt; ???? //JointDef.maxMotorForce= Joint-&gt; ???? b2PulleyJointDef JointDef; //QUESTION: how do i get these? //JointDef.maxLengthA= Joint-&gt; ???? //JointDef.maxLengthB= Joint-&gt; ???? b2RevoluteJointDef JointDef; //QUESTION: how do i get these? //JointDef.maxMotorTorque= Joint-&gt; ???? //JointDef.referenceAngle Joint-&gt; ???? //JointDef.lowerAngle= Joint-&gt; ???? //JointDef.upperAngle= Joint-&gt; ???? b2JointDef JointDef; //JointDef.collideConnected= ???? </code></pre> <p>Do i need the data above? Is there a way to get it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload