TOKRB_UpdateBoundingInfo(RigidBody%) |
Parameters: RigidBody% = Rigid Body handle |
Return value: None |
Description: Updates the bounding info of a rigid body. You should do this after adding multiple geometries to a rigidbody. |
this creates a table and updates its bounding info so it collides correctly i=1 obj(i) = CreateCube() ScaleEntity obj(i),10,.5,10 rb(i) = TOKRB_Create() TOKRB_AddBox rb(i),20.0,1.0,20.0 TOKRB_SetPosition rb(i),0,20,0 TOKRB_SetLinearDamping rb(i),0.001 TOKRB_SetAngularDamping rb(i),0.002 TOKRB_SetMass rb(i),2.0 TOKRB_SetBoxInertiaTensor rb(i),20.0,10.0,20.0,2.0 TOKRB_SetSleepingParameter rb(i),0 Addbox obj(i),rb(i),9,-5,9,2,10,2 Addbox obj(i),rb(i),-9,-5,9,2,10,2 Addbox obj(i),rb(i),9,-5,-9,2,10,2 Addbox obj(i),rb(i),-9,-5,-9,2,10,2 TOKRB_UpdateBoundingInfo(RB(i)) toks=toks+1 Function addbox(mesh,RigidBody,x#,y#,z#,Width#,Height#,Depth#,Pitch#=0,Yaw#=0,Roll#=0,alpha=1) TOKGEOM_SetPositionAndRotation TOKRB_AddBox(RigidBody,Width#,Height#,Depth#),x#,y#,z#,Pitch#,Yaw#,Roll# c=CreateCube(mesh) ScaleEntity c,Width#/2,Height#/2,Depth#/2,1 PositionEntity c,x#,y#,z#,1 RotateEntity c,Pitch#,Yaw#,Roll#,1 End Function |