Page 1 of 1
How to choose the Joints and Constraints
Posted: Fri Dec 21, 2012 1:27 pm
by mazelin
Hi,
I have two entities, when one move or rotation, the other one will move or rotation the same position or degree.How can I choose the Joints and Constraints?
Thanks!
Re: How to choose the Joints and Constraints
Posted: Fri Dec 21, 2012 7:29 pm
by Norbo
If you want them to maintain a rigid connection, a WeldJoint (which is a wrapper for a BallSocketJoint and NoRotationJoint) would do the trick. If you want absolutely perfect rigidity, you could also put the shapes into a compound body.
Re: How to choose the Joints and Constraints
Posted: Sat Dec 22, 2012 5:20 am
by mazelin
Thank you for replay.
I use the WeldJoint, when I move one entity, the other entity also move.But the other entity moved slowly than first one.
Can I set it for the other entity move Synchronously.
Thanks again.
Re: How to choose the Joints and Constraints
Posted: Sat Dec 22, 2012 5:30 am
by mazelin
About compound body, I have two entity first, when they are touch, they will be putted to compound body. Now how get the two entity postion? And do I need change the compound body position for move them?
Thank you again and agian.
Re: How to choose the Joints and Constraints
Posted: Sat Dec 22, 2012 7:28 am
by Norbo
I use the WeldJoint, when I move one entity, the other entity also move.But the other entity moved slowly than first one.
If you're setting the position/orientation directly, that is a form of teleportation. Constraints operate on velocities. Teleportation does not involve velocity. So, the constraint has to rely on the 'squishy' error correction. This also applies to collision constraints. If you want to move entities, the recommended way is to use velocities/impulses.
Can I set it for the other entity move Synchronously.
When using velocities/impulses, the other object will move quite rigidly when using a WeldJoint. However, if you wanted to, you could still directly control the velocities of all the involved objects rather than just one of them.
About compound body, I have two entity first, when they are touch, they will be putted to compound body. Now how get the two entity postion? And do I need change the compound body position for move them?
I'm not quite sure what you mean here; if it's about how to create and position compound bodies from subshapes and how the position is computed, I'd recommend playing around with the CompoundBodiesDemo and the other compound-using demos in the BEPUphysicsDemos. EntityConstructionDemo also goes into depth about different ways to construct entities, including compounds.