irr::newton::Joint Class Reference

Class to management joints. More...

#include <joint.hpp>

Inheritance diagram for irr::newton::Joint:

irr::newton::IrrNewt_Base irr::newton::JointUpVector irr::newton::VehicleSimple List of all members.

Public Member Functions

bool getCollisionState ()
const NewtonJoint * getNewtonJoint () const
irr::f32 getStiffness ()
 Joint ()
void setCollisionState (bool value)
void setStiffness (irr::f32 value)
 ~Joint ()

Protected Attributes

NewtonJoint * n_joint
NewtonWorld * n_world

Detailed Description

Class to management joints.


Constructor & Destructor Documentation

irr::newton::Joint::Joint (  )  [inline]

constructor. don't call this directly

irr::newton::Joint::~Joint (  )  [inline]

destructor


Member Function Documentation

bool irr::newton::Joint::getCollisionState (  ) 

Get the collision state of the two bodies linked by the joint

usually when two bodies are linked by a joint, the application wants collision between this two bodies to be disabled. This is the default behavior of joints when they are created, however when this behavior is not desired the application can change it by setting collision on. If the application decides to enable collision between jointed bodies, the application should make sure the collision geometry do not collide in the work space of the joint.

Returns:
the collision state

const NewtonJoint* irr::newton::Joint::getNewtonJoint (  )  const [inline]

get newton joint

Returns:
the newton joint

irr::f32 irr::newton::Joint::getStiffness (  ) 

Get the strength coefficient bing applied to the joint reaction forces See Joint::setStiffness()

Returns:
stiffness coeficient
See also:
Joint::setStiffness()

void irr::newton::Joint::setCollisionState ( bool  value  ) 

Enable or disable collision between the two bodies linked by this joint. The default state is collision disable when the joint is created.

Parameters:
value true to enable collision between linked bodies, false to not
Returns:
none

void irr::newton::Joint::setStiffness ( irr::f32  value  ) 

Set the strength coeficient to be applied to the joint reaction forces

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.

The stiffness is set to a all around value 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.

Parameters:
value stiffness coeficient, a value between 0, and 1.0, the default value for most joint is 0.9


Member Data Documentation

NewtonJoint* irr::newton::Joint::n_joint [protected]

the newton joint

NewtonWorld* irr::newton::Joint::n_world [protected]

the newton world


The documentation for this class was generated from the following file:
Generated on Fri Dec 15 16:58:33 2006 for IrrNewt by  doxygen 1.5.1-p1