Hello everyone.
I am using Newton 1.53 and my problem is the following, I have a sphere that is moving with some speed, and want that when I press a key the sphere stop moving and stop exactly where you are.
Try to cancel the forces as follows.
Option 1:
dFloat Torque[3];
dFloat Force[3];
Force[0]=0;
Force[1]=0;
Force[2]=0;
Torque[0]=0;
Torque[1]=0;
Torque[2]=0;
NewtonBodySetForce(sphere.body,Force);
NewtonBodySetTorque(sphere.body,Torque);
Option 2:
dFloat Torque[3];
dFloat Force[3];
NewtonBodyGetForce(sphere.body,Force);
NewtonBodyGetTorque(sphere.body,Torque);
Force[0]=(-1)*Force[0];
Force[1]=(-1)*Force[1];
Force[2]=(-1)*Force[2];
Torque[0]=(-1)*Torque[0];
Torque[1]=(-1)*Torque[1];
Torque[2]=(-1)*Torque[2];
NewtonBodyAddForce(sphere.body,Force);
NewtonBodyAddTorque(sphere.body,Torque);
Option3:
NewtonBodyGetMatrix(sphere.body,mat);
mat[0]=(-1)*mat[0];
mat[1]=(-1)*mat[1];
mat[2]=(-1)*mat[2];
mat[3]=(-1)*mat[3];
mat[4]=(-1)*mat[4];
mat[5]=(-1)*mat[5];
mat[6]=(-1)*mat[6];
mat[7]=(-1)*mat[7];
mat[8]=(-1)*mat[8];
mat[9]=(-1)*mat[9];
mat[10]=(-1)*mat[10];
mat[11]=(-1)*mat[11];
NewtonBodySetMatrix(sphere.body,mat);
But in three cases the sphere still moving
Someone can give me an idea of how I cancel the forces?