With the former version I used callbacks to apply torsors on bodies :
- Code: Select all
NewtonBodySetForceAndTorqueCallback
then in the callback I used :
- Code: Select all
force := AffineVectorMake(0,0, -GRAVITY * mass) ;
NewtonBodySetForce(body, @force) ;
and accumulators
- Code: Select all
AddForceAtPos (from newtonutil.pas) and Newtonbodyaddtorque(from NewtonImport.pas)
Now I'm using Unity3D
I believe I need to override the event OnApplyForceAndTorque.
My question is Do I just need to apply extra forces with
- Code: Select all
body.GetBody().AddForce
Or I must set the acceleration force before in the event ? I guess I just need to add the extra forces as the gravity force is already taken into account but I'm not sure how to do.