TOKRB_Create() |
Return value: Rigid Body handle |
Description: Creates a rigid body. Rigid bodies are the objects that bounce, turn, move, and fall in your physics simulation. They can be many different shapes and are based off one or more collision geometries. |
Just creates a cube rigid body, along with a graphical representation obj(i) = CreateCube() rb(i) = TOKRB_Create() geom = TOKRB_AddBox(rb(i),2.0,2.0,2.0) TOKGEOM_SetMaterialIndex geom,Rnd(1,3) TOKRB_SetPosition rb(i),x#,35+i*0.2,50+z# TOKRB_SetLinearDamping rb(i),0.001 TOKRB_SetAngularDamping rb(i),0.002 TOKRB_SetMass rb(i),2.0 TOKRB_SetBoxInertiaTensor rb(i),2.0,2.0,2.0,2.0 |