I have a rigid body that starts in the air.
I apply a constant force to it so it moves as expected.
But when I add an up vector constraint to it it no longer moves.
I can make it move by calling NewtonBodySetSleepState(body, 0) on it every frame,
or by changing the force on it.
Calling NewtonBodySetSleepState on it once after the constraint is added does nothing.
Is this the expected behaviour?
Changing the force on the body after it is created or unsleeping it every frame don't seem like good solutions.
I am using the Newton 3.14 release as the CMakeLists in the master branch doesn't work on linux.
this is my code:
- Code: Select all
dFloat mat[16] = {0};
mat[0] = mat[5] = mat[10] = mat[15] = 1;
mat[13] = 6;
NewtonCollision *shape = NewtonCreateSphere(world, 1, 0, NULL);
NewtonBody *body = NewtonCreateDynamicBody(world, shape, mat);
NewtonBodySetMassProperties(body, 1, shape);
NewtonBodySetForceAndTorqueCallback(body, force_callback);
dFloat pin[3] = {0, 1, 0};
NewtonConstraintCreateUpVector(world, pin, body);
NewtonDestroyCollision(shape);
Thanks!