By Walaber
All Coding between 1.31-1.32B by Kjelle
Updated to 1.53 by Tiresius
NDB_NewtonCreateRagDoll |
|||
| syntax: int = NDB_NewtonCreateRagDoll() | |||
|
|||
| returns: integer index to the ragdoll. | |||
| Comments: This command creates an empty ragdoll container, and returns an integer index to the ragdoll. |
NDB_NewtonDestroyRagDoll |
|||
| syntax: NDB_NewtonDestroyRagDoll ragdoll | |||
|
|||
| returns: nothing | |||
| Comments: This command destroys the ragdoll from the Newton world. Note there is no "DestroyCallback" for ragdolls yet, so you must manually delete the visual objects used to represent the ragdoll onscreen yourself. |
NDB_NewtonRagDollBegin |
|||
| syntax: NDB_NewtonRagDollBegin ragdoll | |||
|
|||
| returns: nothing | |||
| Comments: This command tells Newton you want to begin adding / defining the bones that will make up the ragdoll. You must call this command before you can add bones to a ragdoll. |
NDB_NewtonRagDollEnd |
|||
| syntax: NDB_NewtonRagDollEnd ragdoll | |||
|
|||
| returns: nothing | |||
| Comments: This command tells Newton you are finished adding / defining the bones that make up a ragdoll. This should be called after all settings for the ragdoll are complete. |
NDB_NewtonRagDollAddBone |
||||||||||||||||||
| syntax: int = NDB_NewtonRagDolladdBone( ragdoll, p_bone, col, mass ) | ||||||||||||||||||
|
||||||||||||||||||
| returns: integer index of the newly created bone. | ||||||||||||||||||
|
Comments: This command adds a bone to the specified ragdoll. Note that the internal temp matrix is used for the position and rotation of the bone (in local space based on the parent bone), and temp vector 1 is used to describe the size of the bone. See the ragdoll tutorial for examples of this command in use. This command must be called in-between a NDB_NewtonRagDollBegin / NDB_NewtonRagDollEnd pair. |
NDB_NewtonRagDollBoneSetLimits |
|||||||||||||||
| syntax: NDB_NewtonRagDollBoneSetLimits ragbone, min_cone, max_cone, max_twist | |||||||||||||||
|
|||||||||||||||
| returns: nothing | |||||||||||||||
|
Comments: This command sets the rotational limits for a particular bone. Before calling this command you must set temp vector 1 to a unit-vector describing the direction of the pin in global space. This command must be called in-between a NDB_NewtonRagDollBegin / NDB_NewtonRagDollEnd pair. |
NDB_RagDollSetGravity |
|||||||||
| syntax: NDB_RagDollSetGravity ragdoll,flag | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: sets the custom gravitational force for the specified ragdoll to the contents of temp vector 1. |
NDB_RagDollGetGravity |
||||||
| syntax: NDB_RagDollGetGravity ragdoll | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: fills temp vector 1 with the custom gravity set for the specified ragdoll. |
NDB_RagDollBoneSetDBProData |
|||||||||
| syntax: NDB_RagDollBoneSetDBProData bone, db_num, limb_num | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: This command assigns a dbpro object (or limb thereof) to a ragdoll bone. If the limb is set to "0" (zero), the object's position will also be updated based on the position of the bone. Use this for the root bone, or ragdolls made up of seperate objects. A limb number greater than zero will rotate the limb of the object to the local rotation matrix of the bone. Don't forget to set an offset (NDB_RagDollBoneSetOffset) for the bone, or your ragdoll might not rotate correctly! |
NDB_RagDollBoneSetOffset |
||||||
| syntax: NDB_RagDollBoneSetOffset bone | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: sets the "zero position" for the ragdoll bone rotation. DBPro considers a model's default pose (frame 0 in the object's animation) to be the "zero" point for limb rotation. The newton wrapper needs to know the rotation that defines the "zero" point, so that it can rotate the limbs properly. Usually, you can use the same matrix used when creating the bones. However if you are trying to create a ragdoll in a different pose than the default pose, the matrix used to create the bones will be different from this matrix. Generally this matrix should stay the same for a single model, regardless of what pose you create the ragdoll in. For more information please check the ragdoll tutorial, and the ragdoll examples. | ||||||
|
EXAMPLE: biuld a matrix, and set the bone offset
NDB_BuildMatrix 78.0, -50.0, 35.0, 2.0, 0.0, 0.0 NDB_RagDollBoneSetOffset LArmbone |
NDB_RagDollBoneGetBody |
|||
| syntax: int = NDB_RagDollBoneGetBody( bone ) | |||
|
|||
| returns: integer index to the rigid body for the bone | |||
| Comments: This command returns the index of the rigid body for the supplied bone. All ragdoll bones are actually rigid bodies, and using this command you can do things you might do to other rigid bodies, such as attach external joints to them, add impulses to them, assign materials, etc. | |||
NDB_RagDollExist |
|||
| syntax: int = NDB_RagDollExist( ragdoll ) | |||
|
|||
| returns: 1 if ragdoll exists, 0 if it doesn't |
NDB_RagDollBoneExist |
|||
| syntax: int = NDB_RagDollBoneExist( bone ) | |||
|
|||
| returns: 1 if ragdoll bone exists, 0 if it doesn't |