By Walaber
All Coding between 1.31-1.32B by Kjelle
Updated to 1.53 by Tiresius
NDB_SetHingeLimits |
|||||||||
| syntax: NDB_SetHingeLimits hinge, min, max | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: Sets the rotational limits for the specified hinge joint. To remove limits, set them to zero. |
NDB_SetHingeMotorAccel |
||||||
| syntax: NDB_SetHingeMotorAccel hinge, motor_accel | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Sets the motor acceleration value for the specified hinge joint. |
NDB_GetHingeMin |
|||
| syntax: float = NDB_GetHingeMin( hinge ) | |||
|
|||
| returns: float minimum angle for the hinge | |||
| Comments: returns the min value set to the hinge with the NDB_HingeSetLimits function. |
NDB_GetHingeMax |
|||
| syntax: float = NDB_GetHingeMax( hinge ) | |||
|
|||
| returns: float maximum angle for the hinge | |||
| Comments: returns the max value set to the hinge with the NDB_HingeSetLimits function. |
NDB_GetHingeMotorAccel |
|||
| syntax: float = NDB_GetHingeMotorAccel( hinge ) | |||
|
|||
| returns: float motor acceleration for the hinge | |||
| Comments: returns the motor acceleration value set to the hinge with the NDB_HingeSetMotorAccel function. |
NDB_SetSliderLimits |
|||||||||
| syntax: NDB_SetSliderLimits slider, min, max | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: Sets the limits for the specified slider joint. |
NDB_SetSliderMotorAccel |
||||||
| syntax: NDB_SetSliderMotorAccel slider, motor_accel | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Sets the motor acceleration value for the specified slider joint. |
NDB_GetSliderMin |
|||
| syntax: float = NDB_GetSliderMin( slider ) | |||
|
|||
| returns: float minimum distance for the slider | |||
| Comments: returns the min value set to the slider with the NDB_SliderSetLimits function. |
NDB_GetSliderMax |
|||
| syntax: float = NDB_GetSliderMax( slider ) | |||
|
|||
| returns: float maximum distance for the slider | |||
| Comments: returns the max value set to the slider with the NDB_SliderSetLimits function. |
NDB_GetSliderMotorAccel |
|||
| syntax: float = NDB_GetSliderMotorAccel( slider ) | |||
|
|||
| returns: float motor acceleration for the slider | |||
| Comments: returns the motor acceleration value set to the slider with the NDB_SliderSetMotorAccel function. |
NDB_SetCorkscrewLimits |
|||||||||||||||
| syntax: NDB_SetCorkscrewLimits corkscrew, min_angle, max_angle, min_dist, max_dist | |||||||||||||||
|
|||||||||||||||
| returns: nothing | |||||||||||||||
| Comments: Sets the limits for a corkscrew joint. To disable limits for one of the parts, set the limits for that part to zero. | |||||||||||||||
| EXAMPLE 1: set a corkscrew with rotational limits of
(-45,45) and linear limits of (0, 10) NDB_SetCorkscrewLimits MyCorkscrew, -45.0, 45.0, 0.0, 10.0 EXAMPLE 2: set a corkscrew with no rotational limits, and linear limits of (-5,5) NDB_SetCorkscrewLimits MyCorkscrew, 0.0, 0.0, -5.0, 5.0 |
NDB_SetCorkscrewMotors |
|||||||||
| syntax: NDB_SetCorkscrewMotors corkscrew, angle_motor, dist_motor | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: Sets the rotational and linear motor accelerations for a corkscrew joint. Set any of these to zero (0.0) to disable motorization for that part. |
NDB_GetCorkscrewMinAngle |
|||
| syntax: float = NDB_GetCorkscrewMinAngle(corkscrew) | |||
|
|||
| returns: float min rotational angle for the corkscrew. | |||
| Comments: returns the min rotational angle value set to the corkscrew with the NDB_SetCorkscrewLimits function. |
NDB_GetCorkscrewMaxAngle |
|||
| syntax: float = NDB_GetCorkscrewMaxAngle(corkscrew) | |||
|
|||
| returns: float max rotational angle for the corkscrew. | |||
| Comments: returns the max rotational angle value set to the corkscrew with the NDB_SetCorkscrewLimits function. |
NDB_GetCorkscrewMinDist |
|||
| syntax: float = NDB_GetCorkscrewMinDist(corkscrew) | |||
|
|||
| returns: float min linear dist for the corkscrew. | |||
| Comments: returns the min linear distance value set to the corkscrew with the NDB_SetCorkscrewLimits function. |
NDB_GetCorkscrewMaxDist |
|||
| syntax: float = NDB_GetCorkscrewMaxDist(corkscrew) | |||
|
|||
| returns: float max linear dist for the corkscrew. | |||
| Comments: returns the max linear distance value set to the corkscrew with the NDB_SetCorkscrewLimits function. |
NDB_GetCorkscrewAngleMotor |
|||
| syntax: float = NDB_GetCorkscrewAngleMotor(corkscrew) | |||
|
|||
| returns: float rotational motor accel for the corkscrew. | |||
| Comments: returns the rotational motor acceleration set to the corkscrew with the NDB_SetCorkscrewMotors function. |
NDB_GetCorkscrewDistMotor |
|||
| syntax: float = NDB_GetCorkscrewDistMotor(corkscrew) | |||
|
|||
| returns: float linear motor accel for the corkscrew. | |||
| Comments: returns the linear distance acceleration set to the corkscrew with the NDB_SetCorkscrewMotors function. |
NDB_SetUniversalLimits |
|||||||||||||||
| syntax: NDB_SetUniversalLimits universal, min1, max1, min2, max2 | |||||||||||||||
|
|||||||||||||||
| returns: nothing | |||||||||||||||
| Comments: Sets the limits for a universal joint. To disable limits for one of the parts, set the limits for that part to zero. |
NDB_SetUniversalMotorAccel |
|||||||||
| syntax: NDB_SetUniversalMotorAccel universal, motor1, motor2 | |||||||||
|
|||||||||
| returns: nothing | |||||||||
| Comments: Sets the rotational motor accelerations for an universal joint. Set any of these to zero (0.0) to disable motorization for that part. |
NDB_GetUniversalMin1 |
|||
| syntax: float = NDB_GetUniversalMin1(universal) | |||
|
|||
| returns: float min rotational angle for pin1 of the universal. | |||
| Comments: returns the min rotational angle value set to the univeral with the NDB_SetUniversalLimits function. |
NDB_GetUniversalMax1 |
|||
| syntax: float = NDB_GetUniversalMax1(universal) | |||
|
|||
| returns: float max rotational angle for pin1 of the universal. | |||
| Comments: returns the max rotational angle value set to the universal with the NDB_SetUniversalLimits function. |
NDB_GetUniversalMin2 |
|||
| syntax: float = NDB_GetUniversalMin2(universal) | |||
|
|||
| returns: float min rotational angle for pin2 of the universal. | |||
| Comments: returns the min rotational angle value set to the univeral with the NDB_SetUniversalLimits function. |
NDB_GetUniversalMax2 |
|||
| syntax: float = NDB_GetUniversalMax2(universal) | |||
|
|||
| returns: float max rotational angle for pin2 of the universal. | |||
| Comments: returns the max rotational angle value set to the universal with the NDB_SetUniversalLimits function. |
NDB_GetUniversalMotor1 |
|||
| syntax: float = NDB_GetUniversalMotor1(universal) | |||
|
|||
| returns: float rotational motor accel for pin1 of the universal. | |||
| Comments: returns the rotational motor acceleration set to the universal with the NDB_SetUniversalMotorAccel function. |
NDB_GetUniversalMotor2 |
|||
| syntax: float = NDB_GetUniversalMotor2(universal) | |||
|
|||
| returns: float rotational motor accel for pin2 of the universal. | |||
| Comments: returns the rotational motor acceleration set to the universal with the NDB_SetUniversalMotorAccel function. |
NDB_JointExist |
|||
| syntax: int = NDB_JointExist( joint ) | |||
|
|||
| returns: int (0-1) | |||
| Comments: returns a one "1" if the joint exists, zero "0" if it doesn't. |
NDB_NewtonJointSetCollisionState |
||||||
| syntax: NDB_NewtonJointSetCollisionState joint, flag | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: You can choose whether or not you want the bodies that are connected by a joint to collide with each other. Setting the flag to 1 will allow collision between the parent and child, while a flag of zero (default) disregards collision between the parent and child bodies. |
NDB_NewtonJointGetCollisionState |
|||
| syntax: int = NDB_NewtonJointGetCollisionState( joint ) | |||
|
|||
| returns: integer collision flag of the specified joint. | |||
| Comments: Returns the collision flag for the joint. This valuse can be set with the above command, NDB_NewtonJointSetCollisionState |
NDB_NewtonJointSetStiffness |
||||||
| syntax: NDB_NewtonJointSetStiffness joint, stiff# | ||||||
|
||||||
| returns: nothing | ||||||
| Comments:Constraint keep bodies together by calculating the exact force necessary to
cancel the relative acceleration between one or more common points fixed in the
two bodies. The problem is that when the bodies drift apart due to numerical
integration inaccuracies, the reaction force work to pull eliminated the error
but at the expense of adding extra energy to the system, does violating the rule
that constraint forces must be work less. This is a inevitable situation and the
only think we can do is to minimize the effect of the extra energy by dampening
the force by some amount. In essence the stiffness coefficient tell Newton
calculate the precise reaction force by only apply a fraction of it to the joint
point. And value of 1.0 will apply the exact force, and a value of zero will
apply only 10 percent. Remarks: The stiffness is set to a all around value (default is 0.9) that work well for most situation, however the application can play with these parameter to make finals adjustment. A high value will make the joint stronger but more prompt to vibration of instability; a low value will make the joint more stable but weaker. |
NDB_NewtonJointGetStiffness |
|||
| syntax: float = NDB_NewtonJointGetStiffness( joint ) | |||
|
|||
| returns: float value of stiffness coeficient | |||
| See NDB_NewtonJointSetStiffness for details. |
NDB_NewtonConstraintCreateBall |
|||||||||
| syntax: int = NDB_NewtonConstraintCreateBall( db_child, db_parent ) | |||||||||
|
|||||||||
| returns: integer ID of the ball joint created. | |||||||||
| Comments: This creates a ball/socket joint in the world. Before calling this command you must fill temp vector 1 with the position of the joint in global space. Joints have heirarchy, so if the parent object moves, the child is dragged with it. To make an joint with no parent (the joint is "glued" in space, use zero "0" for parent. | |||||||||
| See the demo programs for examples of joints in action. |
NDB_NewtonBallSetConeLimits |
||||||||||||
| syntax: NDB_NewtonBallSetConeLimits joint, cone_lim, twist_lim | ||||||||||||
|
||||||||||||
| returns: nothing | ||||||||||||
| Comments: Sets the limits for the ball/socket joint. Before calling this function you must set temp vector 1 with a normalized vector of the direction of the joint. | ||||||||||||
|
EXAMPLE: - set joint "BallJoint" pointing straight down, cone_lim =
75deg, twist_lim = 5deg NDB_SetVector 0.0, -1.0, 0.0 NDB_NewtonBallSetConeLimits BallJoint, 75.0, 5.0 |
NDB_NewtonBallGetJointAngle |
||||||
| syntax: NDB_NewtonBallGetJointAngle joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the current angle of the joint, based on the pin angle. This can be used for special effects, like a bell sound when the angle is greater than a certain value. |
NDB_NewtonBallGetJointOmega |
||||||
| syntax: NDB_NewtonBallGetJointOmega joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the angular (rotational) velocity of the joint. |
NDB_NewtonBallGetJointForce |
||||||
| syntax: NDB_NewtonBallGetJointForce joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the total force asserted over the joint. This can be used to create special effects like breakable joints, etc. |
NDB_NewtonConstraintCreateHinge |
||||||||||||
| syntax: int = NDB_NewtonConstraintCreateHinge( child, parent ) | ||||||||||||
|
||||||||||||
| returns: integer ID of the hinge joint created. | ||||||||||||
| Comments: This creates a hinge joint in the world. Before calling this command you must fill temp vector 1 with the position of the joint in global space. You must also fill temp vector 2 with the direction of the pin. Joints have heirarchy, so if the parent object moves, the child is dragged with it. To make an joint with no parent (the joint is "glued" in space, use zero "0" for parent. | ||||||||||||
| See the demo programs for examples of joints in action. Demo05 is an example of hinge joints. |
NDB_NewtonHingeGetJointAngle |
|||
| syntax: float = NDB_NewtonHingeGetJointAngle( joint ) | |||
|
|||
| returns: float angle around the hinge pin |
NDB_NewtonHingeGetJointOmega |
|||
| syntax: float = NDB_NewtonHingeGetJointOmega( joint ) | |||
|
|||
| returns: angular velocity around the pin axis. |
NDB_NewtonHingeGetJointForce |
||||||
| syntax: NDB_NewtonHingeGetJointForce joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the total force asserted over the joint. This can be used to create special effects like breakable joints, etc. |
NDB_NewtonConstraintCreateSlider |
||||||||||||
| syntax: int = NDB_NewtonConstraintCreateSlider( _child, parent ) | ||||||||||||
|
||||||||||||
| returns: integer ID of the slider joint created. | ||||||||||||
| Comments: This creates a slider joint in the world. Before calling this command you must fill temp vector 1 with the position of the joint in global space. You must also fill temp vector 2 with the direction of the pin. Joints have heirarchy, so if the parent object moves, the child is dragged with it. To make an joint with no parent (the joint is "glued" in space, use zero "0" for parent. | ||||||||||||
| See the demo programs for examples of joints in action. |
NDB_NewtonSliderGetJointPosit |
|||
| syntax: float = NDB_NewtonSliderGetJointPosit( joint ) | |||
|
|||
| returns: float distance along the slider pin |
NDB_NewtonSliderGetJointVeloc |
|||
| syntax: float = NDB_NewtonSliderGetJointVeloc( joint ) | |||
|
|||
| returns: velocity along the pin axis. |
NDB_NewtonSliderGetJointForce |
||||||
| syntax: NDB_NewtonSliderGetJointForce joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the total force asserted over the joint. This can be used to create special effects like breakable joints, etc. |
NDB_NewtonConstraintCreateCorkscrew |
||||||||||||
| syntax: int = NDB_NewtonConstraintCreateCorkscrew( child, parent ) | ||||||||||||
|
||||||||||||
| returns: integer ID of the corkscrew joint created. | ||||||||||||
| Comments: This creates a corkscrew joint in the world. A Corkscrew joint is a combination of a slider and a hinge into one joint. basically the child object can slide along the pin axis (Slider), and rotate around the pin axis (Hinge). Before calling this command you must fill temp vector 1 with the position of the joint in global space. You must also fill temp vector 2 with the direction of the pin. Joints have heirarchy, so if the parent object moves, the child is dragged with it. To make an joint with no parent (the joint is "glued" in space, use zero "0" for parent. | ||||||||||||
| See the demo programs for examples of joints in action. |
NDB_NewtonCorkscrewGetJointPosit |
|||
| syntax: float = NDB_NewtonCorkscrewGetJointPosit( joint ) | |||
|
|||
| returns: float distance along the corkscrew pin |
NDB_NewtonCorkscrewGetJointVeloc |
|||
| syntax: float = NDB_NewtonCorkscrewGetJointVeloc( joint ) | |||
|
|||
| returns: velocity along the corkscrew pin. |
NDB_NewtonCorkscrewGetJointAngle |
|||
| syntax: float = NDB_NewtonCorkscrewGetJointAngle( joint ) | |||
|
|||
| returns: float angle around the corkscrew pin |
NDB_NewtonCorkscrewGetJointOmega |
|||
| syntax: float = NDB_NewtonCorkscrewGetJointOmega( joint ) | |||
|
|||
| returns: angular velocity around the pin axis. |
NDB_NewtonCorkscrewGetJointForce |
||||||
| syntax: NDB_NewtonCorkscrewGetJointForce joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the total force asserted over the joint. This can be used to create special effects like breakable joints, etc. |
NDB_NewtonConstraintCreateUniversal |
|||||||||||||||
| syntax: int = NDB_NewtonConstraintCreateUniversal( child, parent ) | |||||||||||||||
|
|||||||||||||||
| returns: integer ID of the universal joint created. | |||||||||||||||
| Comments: This creates a universal joint in the world.
A universal joint is 2 hinges put together into one. A simple example of a
universal joint is a car tire. It can rotate around the axle, and also steer. Before calling this command you must fill temp vector 1 with the position of the joint in global space. You must also fill temp vector 2 and temp vector 3 with the direction of the 2 pins. Joints have heirarchy, so if the parent object moves, the child is dragged with it. To make an joint with no parent (the joint is "glued" in space, use zero "0" for parent. |
|||||||||||||||
| See the demo programs for examples of joints in action. |
NDB_NewtonUnivsersalGetJointAngle0 |
|||
| syntax: float = NDB_NewtonUnivsersalGetJointAngle0( joint ) | |||
|
|||
| returns: float angle around pin1 of the universal |
NDB_NewtonUnivsersalGetJointAngle1 |
|||
| syntax: float = NDB_NewtonUnivsersalGetJointAngle1( joint ) | |||
|
|||
| returns: float angle around pin2 of the universal |
NDB_NewtonUniversalGetJointOmega0 |
|||
| syntax: float = NDB_NewtonUniversalGetJointOmega0( joint ) | |||
|
|||
| returns: rotational velocity around pin1 of the universal |
NDB_NewtonUniversalGetJointOmega1 |
|||
| syntax: float = NDB_NewtonUniversalGetJointOmega1( joint ) | |||
|
|||
| returns: rotational velocity around pin2 of the universal |
NDB_NewtonUniversalGetJointForce |
||||||
| syntax: NDB_NewtonUniversalGetJointForce joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: Fills temp vector 1 with the total force asserted over the joint. This can be used to create special effects like breakable joints, etc. |
NDB_NewtonConstraintCreateUpVector |
||||||
| syntax: int = NDB_NewtonConstraintCreateUpVector( body ) | ||||||
|
||||||
| returns: integer ID of the upvector joint created. | ||||||
| Comments: This creates a upvector joint in the world. An upvector joint is a special joint that will always keep a body aligned along its pin. This joint is useful for bodies representing characters, etc. Before calling this function you must fill temp vector 1 with the pin direction for the upvector. | ||||||
| See the demo programs for examples of joints in action. |
NDB_NewtonUpVectorGetPin |
||||||
| syntax: NDB_NewtonUpVectorGetPin joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: This command fills temp vector 1 with the pin direction of the specified upvector joint. |
NDB_NewtonUpVectorSetPin |
||||||
| syntax: NDB_NewtonUpVectorSetPin joint | ||||||
|
||||||
| returns: nothing | ||||||
| Comments: This command sets the pin direction of the specified upvector joint to the contents of temp vector 1. This command can be used to animate an upvector body by slightly changing the pin direction each loop. |