away3d / awayphysics-core-fp11

Away Physics - 3D physics library for the Away3D Engine in Flash Player 11
http://www.awayphysics.com
112 stars 47 forks source link

Hinge and compound shape #4

Closed JohnBrookes closed 13 years ago

JohnBrookes commented 13 years ago

If you create a compound shape and add a box shape to that compound shape. If the box shape doesn't touch the center of the compound shape it stops a hinge from rotating. Easier to show than expain. http://www.shrewballooba.co.uk/ConstraintTest2.as

try either modelCompound.addChildShape(modelPart1Shape, new Vector3D(0, 0, -900), new Matrix3D()); //rotates //modelCompound.addChildShape(modelPart1Shape, new Vector3D(0, 0, -1000), new Matrix3D()); //sticks

JohnBrookes commented 13 years ago

OK, so whats happening is the rigidbody is falling asleep. modelRigidBody.activationState = AWPCollisionObject.DISABLE_DEACTIVATION; stops the above happening. Weird that you only need it for certain case.

muzerly commented 13 years ago

Yes, you can also increase the third parameter in setAngularMotor. Like: Hinge.setAngularMotor(true,500,200);