TOKRB_ApplyImpulse2(RigidBody%,X#,Y#,Z#,XPos#,YPos#,ZPos#) |
Parameters: RigidBody% = Rigid Body handle X# = X force of impulse Y# = Y force of impulse Z# = Z force of impulse XPos# = Global X Position upon which the impulse is delivered YPos# = Global Y Position upon which the impulse is delivered ZPos# = Global Z Position upon which the impulse is delivered |
Return value: None |
Description: Similar to TOKRB_ApplyImpulse(), this applys an impulse to the object, however off-center so that rotation force is also induced. This is useful when an object is hit by a bullet, or is wacked by somthing else. Note that the x,y,z positions are global. |
Applies a random positional impulse to all the rigid bodies when the space bar is pressed If KeyHit(57) Then For i=1 To ENTS TOKRB_ApplyImpulse2 rb(i),Rnd(-15.0,15.0),30.0,Rnd(-15.0,15.0),TOKRB_GetX#(rb(i))+0.5,TOKRB_GetY#(rb(i))-0.5,TOKRB_GetZ#(rb(i))+0.5 Next EndIf |