TOKRB_SetBoxInertiaTensor(RigidBody%,Width#,Height#,Depth#,Mass#)
Parameters:
RigidBody% = Rigid Body handle
Width#
Height#
Depth#
Mass#
Return value:
None
Description:
Sets a box Rigid Body inertia tensor. For Rigid Bodies with only a box geometry, use this command along with the diminsions of the box and the mass of the rigid body.
This creates a table and sets its box inertia tensor
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



Documentation generated by Cod2Doc on 20 Jun 2004.