If I throw an object on the book or on the plate, they get pushed through the table.
This is the function for throwing:
Code:
void DebugThrow(char* FileName)
{
NewtonBody *body;
ENTITY* Temp_ent = 0;
while(1)
{
while(!mouse_left){wait(1);}
if(Temp_ent)
{
NewtonDestroyBody(nworld, body);
ent_remove(Temp_ent);
Temp_ent = NULL;
}
Temp_ent = ent_create(FileName,camera.x,NULL);
vec_scale(Temp_ent.scale_x,0.3);
body = newton_addentity(Temp_ent, 3, NEWTON_BOX, onforceandtorque);
VECTOR v;
vec_set(v, vector(20, 0, 0));
vec_rotate(v,camera.pan);
NewtonBodySetVelocity(body, vectorf(v.x,v.y,v.z));
while(mouse_left){wait(1);}
wait(1);
}
}
onforceandtorque is the same function you used in your example.
This is he scene where I use newton: