I have the freshest (official) Irrlicht and Newton
I have created a cube and it is simulated by Newton but it kinda falls UP and I think it should go down...
any idea how this might happen and how to fix it?
Newton cube falling up
my ApplyForceAndTorqueEvent callback:
take a closer look at force[1] = NEWTON_GRAVITY * mass;
set NEWTON_GRAVITY so something negative. -800 for me works just fine
Code: Select all
void _cdecl Physics::ApplyForceAndTorqueEvent (const NewtonBody* body)
{
float mass;
float Ixx;
float Iyy;
float Izz;
float force[3];
float torque[3];
NewtonBodyGetMassMatrix (body, &mass, &Ixx, &Iyy, &Izz);
force[0] = 0.0f;
force[1] = NEWTON_GRAVITY * mass;
force[2] = 0.0f;
torque[0] = 0.0f;
torque[1] = 0.0f;
torque[2] = 0.0f;
NewtonBodyAddForce (body, force);
NewtonBodyAddTorque (body, torque);
}
set NEWTON_GRAVITY so something negative. -800 for me works just fine