Tokamak Physics Thread 5

Blitz3D Forums/Blitz3D Userlibs/Tokamak Physics Thread 5

Here's how I would do a sphere projecting away from the camera:

TFormNormal TOKRB_GetX#(rb(i)-EntityX(camerapivot),TOKRB_GetY#(rb(i)-EntityY(camerapivot),TOKRB_GetZ#(rb(i)-EntityZ(camerapivot),0,0
TOKRB_ApplyImpulse rb(i),TformedX()*amount#,TformedY()*amount#,TformedZ()*amount#


Dunno if it works, I typed it right in firefox. Anyway, basically this just makes the length of the vector between the camera and the sphere equal to one (normalizes), and then multiplys this by an amount that equals the force of the impulse.