one stop for all game coders..
| Constraint Descriptor |
|
|
| Written by CR Team | |||||||||||
| Monday, 18 May 2009 00:00 | |||||||||||
|
Before jumping into joints Director/Ageia requires the user to create a constraint Descriptor. A constraint descriptor is a structure that stores the required parameters that are later on used to create Linear or angular Joints. A constraint descriptor is of the following format (syntax and parameter list) :
Cname - name for the constraint , has to be unique rbA - Rigid body A ( created via createrigidbody() ) rbB - Rigid body B ( created via createrigidbody() ) vector pocA - point at which the joint is created within rigid body A’s coordinate, vector pocB - point at which the joint is created within rigid body B’s coordinate Stiffness - Value of the stiffness of the constrain. How flexible is the spring... damping - Value of the damping of the constraint. What is the damping applied on the movement of the rigid body.
The code snippet shows the Point of contact values for b1 and b2 to be vector(0,0,0) which means that the spring will be created at the center of mass of the 2 rigid bodies. It can be changed based on the requirement. [ make sure that the point does not lie outside the rigid bodies local axis ) The constraint descriptor created can be used to create linear, angular and spring joints. Note: Based on the mass/size of the rigid body one has to tweak the damping and stiffness parameters of the constraint descriptor.
|
|||||||||||