Physics::Joint Class Reference

Wrapper for joints between bodies. More...

#include <Joint.h>

List of all members.

Public Types

enum  EJointType {
  BALL = dJointTypeBall, HINGE = dJointTypeHinge, HINGE2 = dJointTypeHinge2, UNIVERSAL = dJointTypeUniversal,
  SLIDER = dJointTypeSlider, PRISMATIC_ROTOIDE = dJointTypePR, FIXED = dJointTypeFixed, CONTACT = dJointTypeContact,
  ANGULAR_MOTOR = dJointTypeAMotor, LINEAR_MOTOR = dJointTypeLMotor, PLANE2D = dJointTypePlane2D
}
 Different types the joint can be. More...
enum  EAnchoredTo { GLOBAL = 0, BODY1 = 1, BODY2 = 2 }
 Anchor type for motor joints. More...
enum  EAMotorMode { ANGULAR_MOTOR_USER = dAMotorUser, ANGULAR_MOTOR_EULER = dAMotorEuler }
 Mode for angular motors. More...

Public Member Functions

 Joint (World *pWorld, EJointType type)
 Creates a joint of the given type, except contact joints.
 Joint (World *pWorld, Contact *pContact=NULL)
 Creates contact a joint, using the provided contact data.
 Joint (const Joint &v)
 Copies a joint but do not attach bodies and do not allocate a feedback structure.
 ~Joint ()
EJointType getType () const
 Returns the type of the joint.
void attach (Body *pBody1, Body *pBody2)
 Attaches two bodies with the joint. A NULL body is equivalent to the global frame (= "the environment"). Joining two NULL bodies is possible but has no effet on the simulation.
BodygetBody1 ()
 Gets first body in joint, or NULL (= global frame).
BodygetBody2 ()
 Gets second body in joint, or NULL (= global frame).
const BodygetBody1 () const
 const version of getBody1().
const BodygetBody2 () const
 const version of getBody2().
UINT getNumBodies () const
 Return the number of bodies attached to the joint.
void setFeedback (JointFeedback *pJointFeedback)
 Sets a feedback structure that will be filled with data on world step.
JointFeedbackgetFeedback ()
 Gets the current feetback structure.
const JointFeedbackgetFeedback () const
 const version of getFeedback().
virtual void accept (Visitor &v)
Intrinsic parameters
All parameters are in world coordinates.

Some parameters cannot be set on certain types of joints (ex: A position on a slider joint). Setting parameters when it should not results in an undefined behaviour ! Actually, in debug configuration, it throws an exception because joint type is checked on each call. In release, it sometimes does nothing, and sometimes tries to call a non-corresponding ODE function (this generally results in an ODE error). When joint has 2 or 3 axis, then the 1st is attached to body 1 and the last one is attached to body 2 (attached does not mean relative). Axis are internally normalized.

void setPos (const osg::Vec3 &pos)
 Sets position (=anchor) of the joint.
osg::Vec3 getPosBody1 () const
 Gets position of the joint on body 1 (should be the same result for body 2 if joint is perfectly matched).
osg::Vec3 getPosBody2 () const
 Gets position of the joint on body 2 (should be the same result for body 1 if joint is perfectly matched).
void setAxis1 (const osg::Vec3 &axis)
 Sets primary axis for the joint (attached to body 1 for 2-axis joints).
osg::Vec3 getAxis1 () const
 Used for hinge, slider, universal, hinge2, prismatic rotoide.
void setAxis2 (const osg::Vec3 &axis)
 Sets secondary axis for the joint (attached to body 2 for universal and hinge2).
osg::Vec3 getAxis2 () const
 Used for universal, hinge2, prismatic rotoide.
void setAMotorMode (EAMotorMode mode)
 Sets the mode for an AMotor.
EAMotorMode getAMotorMode () const
 Gets the mode for an AMotor.
void setNumAxes (UCHAR num)
 Sets the number of axes for the joint.
UCHAR getNumAxes () const
 Gets the number of axes for the joint.
void setMotorAxis (UCHAR num, EAnchoredTo frame, const osg::Vec3 &axis)
 Sets one of the axis for the joint.
osg::Vec3 getMotorAxis (UCHAR num) const
 Gets one of the axis for the joint.
EAnchoredTo getAxisFrameAMotor (UCHAR num) const
 Gets one of the axis frame for the joint.
void setAxisAngleAMotor (UCHAR num, dReal angle)
 Sets one of the axis angle for the joint.
dReal getAxisAngleAMotor (UCHAR num) const
 Gets one of the axis angle for the joint.
dReal getAxisAngleRateAMotor (UCHAR num) const
 Gets one of the axis angle rate for the joint.
dReal getRelAngleAxis1 () const
 Gets angle between two bodies on primary axis (0 is the initial angle).
dReal getRelAngleRateAxis1 () const
 Derivate of the getAngleAxis1() value.
dReal getRelAngleRateAxis2 () const
 Used for hinge2.
dReal getRelPosAxis1 () const
 Gets relative position along axis 1 (0 is the initial position).
dReal getRelPosRateAxis1 () const
 Derivate of the getRelPosAxis1() value.
General parameters
void setCFM (dReal val, UINT axis=0)
 Sets CFM (when not at a stop).
dReal getCFM (UINT axis=0) const
Stop parameters
Stop parameters allow the joint to be limited in movement.

Note that zero always correspond to initial relative position (or rotation). Note that angles must be in [-pi, pi] to be effective (otherwise they are considered as infinity). If the high stop is less than the low stop, then the stop will be disabled (ineffective).

void setLoStop (dReal val, UINT axis=0)
 Defines a low limit for the joint. Ex: -PI/2 can be the lowest angle for a hinge.
dReal getLoStop (UINT axis=0) const
void setHiStop (dReal val, UINT axis=0)
 Defines a high limit for the joint. Ex: PI/2 can be the higest angle for a hinge.
dReal getHiStop (UINT axis=0) const
void setStopBouncyness (dReal val, UINT axis=0)
 Defines the bouncyness for the limits of the joint, in [0;1].
dReal getStopBouncyness (UINT axis=0) const
void setStopERP (dReal val, UINT axis=0)
 Defines the ERP for the limits of the joint.
dReal getStopERP (UINT axis=0) const
void setStopCFM (dReal val, UINT axis=0)
 Sets CFM for the limit of the joint (warning : this does not work as expected for powered joints).
dReal getStopCFM (UINT axis=0) const
Motor parameters
Motor parameters allow to continuously set a given speed for the joint, provided that it does not need too much force to accomplish.

void setMotorVel (dReal val, UINT axis=0)
dReal getMotorVel (UINT axis=0) const
void setMotorMaxForce (dReal val, UINT axis=0)
dReal getMotorMaxForce (UINT axis=0) const
void setMotorFudgeFactor (dReal val, UINT axis=0)
 Sets a factor for the force applied to the joint when it leaves its stop position. Used to correct the behaviour if a "jumping" motion appears.
dReal getMotorFudgeFactor (UINT axis=0) const
Utility methods
void copyParameters (const Joint &v)
 Copies all parameters of a joint of the same type.
Position and orientation
Joints position and orientation are meaningful when attached to the enviroment.

These methods handle the case.

void translate (const osg::Vec3 &vec)
void rotate (const osg::Quat &quat)
void rotate (const osg::Quat &quat, const osg::Vec3 &center)
 Rotates the joint around a given point.

Protected Types

typedef void(* TFuncODESetParam )(dJointID, int, dReal)
typedef dReal(* TFuncODEGetParam )(dJointID, int)

Protected Member Functions

 Joint (World *pWorld, EJointType type, dJointGroupID joinGroup)
 Joint (World *pWorld, Contact *pContact, dJointGroupID joinGroup)
void init (EJointType type, dContact *pContact=NULL, dJointGroupID joinGroup=NULL)
TFuncODESetParam getODESetParamFuncPt () const
 Retreives the function pointer for setting ODE param.
TFuncODEGetParam getODEGetParamFuncPt () const
 Retreives the function pointer for getting ODE param.

Protected Attributes

dJointID id
dWorldID worldId

Friends

class JointGroup


Detailed Description

Wrapper for joints between bodies.

Joints use current data when setting parameters ; for example, when you set a fixed joint, the current relative position of the two bodies will be stored and kept as this. Note that joint parameters can be applied on different axis (in {0,1,2}). Number of axis available depends on the joint type. For a slider, you can only set the axis 0, whereas you can set 0 and 1 for a hinge2.

Author:
Sukender
Version:
0.2.0 Incomplete - Does not support Plane2D (Not stable in ODE 0.8), does not support all ODE joint functions. Added copy constructor and translation/rotation methods.
Todo:
Test AMotors/LMotors and complete implementation. Idea : If AMotors are only a way to set/limit velocities/stops, separate angular motors by setting them to be parameters of joints, not a joint itself.

Look for LMotors new functions in ODE next releases.

Implement Plane2D when it'll be more stable in ODE (dJointSetPlane2DXParam, dJointSetPlane2DYParam, dJointSetPlane2DAngleParam).

Implement wrappers for utility functions (chapter 7.6 / Wiki-Joints 1.6) : setting joints forces/torques directly (dJointAdd*Torque, dJointAddSliderForce)

See what are (and implement) : dJointSetBallAnchor2 (Directly set anchor for body 2 olny ?), dJointSetHingeAnchorDelta (???), dJointSetSliderAxisDelta (Set axis with offset for body 1 ???)

Definition at line 72 of file Joint.h.


Member Typedef Documentation

typedef dReal(* Physics::Joint::TFuncODEGetParam)(dJointID, int) [protected]

Definition at line 311 of file Joint.h.

typedef void(* Physics::Joint::TFuncODESetParam)(dJointID, int, dReal) [protected]

Definition at line 310 of file Joint.h.


Member Enumeration Documentation

Mode for angular motors.

Enumerator:
ANGULAR_MOTOR_USER 
ANGULAR_MOTOR_EULER 

Definition at line 102 of file Joint.h.

Anchor type for motor joints.

Enumerator:
GLOBAL 
BODY1 
BODY2 

Definition at line 95 of file Joint.h.

Different types the joint can be.

Joints have degrees of freedom, written (t,r), where t is the number of axis on which translations are possible, and r are for rotations.

Enumerator:
BALL  Ball and socket joint (0,3).
HINGE  Hinge joint (0,1).
HINGE2  Two hinges in series (0,2) with the ability to function as a suspension axis (Axis 1 only).
UNIVERSAL  Two hinges in series (0,2) where axes are perpendicular to each other, and with a perfectly rigid connection in place of the suspension.
SLIDER  Slider joint (1,0).
PRISMATIC_ROTOIDE  Prismatic-rotoide (1,1). Combination of a slider and a hinge.
FIXED  Fixed joint (0,0).
CONTACT  Contact joint (2.5,3), allow to move in only one direction for an axis.
ANGULAR_MOTOR  Angular motor.
LINEAR_MOTOR  Linear motor.
PLANE2D 

Definition at line 76 of file Joint.h.


Constructor & Destructor Documentation

Physics::Joint::Joint ( World pWorld,
EJointType  type 
)

Creates a joint of the given type, except contact joints.

Definition at line 37 of file Joint.cpp.

References init().

Physics::Joint::Joint ( World pWorld,
Contact pContact = NULL 
)

Creates contact a joint, using the provided contact data.

Definition at line 38 of file Joint.cpp.

References CONTACT, and init().

Physics::Joint::Joint ( const Joint v  ) 

Copies a joint but do not attach bodies and do not allocate a feedback structure.

Definition at line 43 of file Joint.cpp.

References CONTACT, copyParameters(), getType(), init(), and THROW_TRACED_EXCEPTION.

Physics::Joint::~Joint (  )  [inline]

Definition at line 114 of file Joint.h.

Physics::Joint::Joint ( World pWorld,
EJointType  type,
dJointGroupID  joinGroup 
) [protected]

Definition at line 40 of file Joint.cpp.

References init().

Physics::Joint::Joint ( World pWorld,
Contact pContact,
dJointGroupID  joinGroup 
) [protected]

Definition at line 41 of file Joint.cpp.

References CONTACT, and init().


Member Function Documentation

void Physics::Joint::accept ( Visitor v  )  [virtual]

Definition at line 498 of file Joint.cpp.

References Physics::Visitor::apply().

Referenced by C3DPhy::accept().

void Physics::Joint::attach ( Body pBody1,
Body pBody2 
)

Attaches two bodies with the joint. A NULL body is equivalent to the global frame (= "the environment"). Joining two NULL bodies is possible but has no effet on the simulation.

Definition at line 134 of file Joint.cpp.

References FIXED, getType(), and Physics::Body::id.

Referenced by C3DPhy::attachBodies(), and Physics::NearCallback::operator()().

void Physics::Joint::copyParameters ( const Joint v  ) 

Joint::EAMotorMode Physics::Joint::getAMotorMode (  )  const

Gets the mode for an AMotor.

Definition at line 303 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Referenced by copyParameters().

osg::Vec3 Physics::Joint::getAxis1 (  )  const

Used for hinge, slider, universal, hinge2, prismatic rotoide.

Definition at line 248 of file Joint.cpp.

References ASSERT, getType(), HINGE, HINGE2, PRISMATIC_ROTOIDE, SLIDER, Physics::toGraphVec3(), and UNIVERSAL.

Referenced by copyParameters(), and rotate().

osg::Vec3 Physics::Joint::getAxis2 (  )  const

Used for universal, hinge2, prismatic rotoide.

Definition at line 280 of file Joint.cpp.

References ASSERT, getType(), HINGE2, PRISMATIC_ROTOIDE, Physics::toGraphVec3(), and UNIVERSAL.

Referenced by copyParameters(), and rotate().

dReal Physics::Joint::getAxisAngleAMotor ( UCHAR  num  )  const

Gets one of the axis angle for the joint.

Used for AMotor.

Definition at line 350 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Referenced by copyParameters().

dReal Physics::Joint::getAxisAngleRateAMotor ( UCHAR  num  )  const

Gets one of the axis angle rate for the joint.

Used for AMotor.

Definition at line 356 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Joint::EAnchoredTo Physics::Joint::getAxisFrameAMotor ( UCHAR  num  )  const

Gets one of the axis frame for the joint.

Used for AMotor.

Definition at line 337 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Referenced by copyParameters(), and rotate().

const Body * Physics::Joint::getBody1 (  )  const

const version of getBody1().

Definition at line 141 of file Joint.cpp.

Body * Physics::Joint::getBody1 (  ) 

Gets first body in joint, or NULL (= global frame).

Definition at line 139 of file Joint.cpp.

Referenced by C3DPhy::attachBodies(), rotate(), and translate().

const Body * Physics::Joint::getBody2 (  )  const

const version of getBody2().

Definition at line 142 of file Joint.cpp.

Body * Physics::Joint::getBody2 (  ) 

Gets second body in joint, or NULL (= global frame).

Definition at line 140 of file Joint.cpp.

Referenced by C3DPhy::attachBodies(), rotate(), and translate().

dReal Physics::Joint::getCFM ( UINT  axis = 0  )  const [inline]

Definition at line 223 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

const JointFeedback* Physics::Joint::getFeedback (  )  const [inline]

const version of getFeedback().

Definition at line 140 of file Joint.h.

JointFeedback* Physics::Joint::getFeedback (  )  [inline]

Gets the current feetback structure.

Definition at line 138 of file Joint.h.

dReal Physics::Joint::getHiStop ( UINT  axis = 0  )  const [inline]

Definition at line 238 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

dReal Physics::Joint::getLoStop ( UINT  axis = 0  )  const [inline]

Definition at line 234 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

osg::Vec3 Physics::Joint::getMotorAxis ( UCHAR  num  )  const

Gets one of the axis for the joint.

Used for AMotor, LMotor.

Definition at line 328 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, getType(), LINEAR_MOTOR, and Physics::toGraphVec3().

Referenced by copyParameters(), and rotate().

dReal Physics::Joint::getMotorFudgeFactor ( UINT  axis = 0  )  const [inline]

Definition at line 265 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

dReal Physics::Joint::getMotorMaxForce ( UINT  axis = 0  )  const [inline]

Definition at line 261 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

dReal Physics::Joint::getMotorVel ( UINT  axis = 0  )  const [inline]

Definition at line 258 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

UCHAR Physics::Joint::getNumAxes (  )  const

Gets the number of axes for the joint.

Used for AMotor, LMotor.

Definition at line 315 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, getType(), and LINEAR_MOTOR.

Referenced by copyParameters(), and rotate().

UINT Physics::Joint::getNumBodies (  )  const [inline]

Return the number of bodies attached to the joint.

Definition at line 132 of file Joint.h.

Joint::TFuncODEGetParam Physics::Joint::getODEGetParamFuncPt (  )  const [protected]

Retreives the function pointer for getting ODE param.

Definition at line 414 of file Joint.cpp.

References ANGULAR_MOTOR, getType(), HINGE, HINGE2, LINEAR_MOTOR, PRISMATIC_ROTOIDE, SLIDER, THROW_TRACED_EXCEPTION, and UNIVERSAL.

Joint::TFuncODESetParam Physics::Joint::getODESetParamFuncPt (  )  const [protected]

Retreives the function pointer for setting ODE param.

Definition at line 390 of file Joint.cpp.

References ANGULAR_MOTOR, getType(), HINGE, HINGE2, LINEAR_MOTOR, PRISMATIC_ROTOIDE, SLIDER, THROW_TRACED_EXCEPTION, and UNIVERSAL.

osg::Vec3 Physics::Joint::getPosBody1 (  )  const

Gets position of the joint on body 1 (should be the same result for body 2 if joint is perfectly matched).

Used for ball, hinge, universal, hinge2, prismatic rotoide

Definition at line 195 of file Joint.cpp.

References ASSERT, BALL, getType(), HINGE, HINGE2, PRISMATIC_ROTOIDE, Physics::toGraphVec3(), and UNIVERSAL.

Referenced by copyParameters(), and translate().

osg::Vec3 Physics::Joint::getPosBody2 (  )  const

Gets position of the joint on body 2 (should be the same result for body 1 if joint is perfectly matched).

Used for ball, hinge, universal, hinge2

Definition at line 214 of file Joint.cpp.

References ASSERT, BALL, getType(), HINGE, HINGE2, Physics::toGraphVec3(), and UNIVERSAL.

dReal Physics::Joint::getRelAngleAxis1 (  )  const

Gets angle between two bodies on primary axis (0 is the initial angle).

Used for hinge, hinge2

Definition at line 363 of file Joint.cpp.

References ASSERT, getType(), HINGE, and HINGE2.

dReal Physics::Joint::getRelAngleRateAxis1 (  )  const

Derivate of the getAngleAxis1() value.

Used for hinge, hinge2

Definition at line 368 of file Joint.cpp.

References ASSERT, getType(), HINGE, and HINGE2.

dReal Physics::Joint::getRelAngleRateAxis2 (  )  const

Used for hinge2.

Definition at line 373 of file Joint.cpp.

References ASSERT, getType(), and HINGE2.

dReal Physics::Joint::getRelPosAxis1 (  )  const

Gets relative position along axis 1 (0 is the initial position).

Used for slider, prismatic rotoide

Definition at line 378 of file Joint.cpp.

References ASSERT, getType(), PRISMATIC_ROTOIDE, and SLIDER.

dReal Physics::Joint::getRelPosRateAxis1 (  )  const

Derivate of the getRelPosAxis1() value.

Used for slider, prismatic rotoide

Definition at line 384 of file Joint.cpp.

References ASSERT, getType(), PRISMATIC_ROTOIDE, and SLIDER.

dReal Physics::Joint::getStopBouncyness ( UINT  axis = 0  )  const [inline]

Definition at line 242 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

dReal Physics::Joint::getStopCFM ( UINT  axis = 0  )  const [inline]

Definition at line 250 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

dReal Physics::Joint::getStopERP ( UINT  axis = 0  )  const [inline]

Definition at line 246 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

EJointType Physics::Joint::getType (  )  const [inline]

void Physics::Joint::init ( EJointType  type,
dContact *  pContact = NULL,
dJointGroupID  joinGroup = NULL 
) [protected]

void Physics::Joint::rotate ( const osg::Quat &  quat,
const osg::Vec3 &  center 
)

Rotates the joint around a given point.

Definition at line 491 of file Joint.cpp.

References rotate(), and translate().

void Physics::Joint::rotate ( const osg::Quat &  quat  ) 

void Physics::Joint::setAMotorMode ( Joint::EAMotorMode  mode  ) 

Sets the mode for an AMotor.

Definition at line 298 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Referenced by copyParameters().

void Physics::Joint::setAxis1 ( const osg::Vec3 &  axis  ) 

Sets primary axis for the joint (attached to body 1 for 2-axis joints).

Used for hinge, slider, universal, hinge2, prismatic rotoide

Definition at line 231 of file Joint.cpp.

References ASSERT, getType(), HINGE, HINGE2, PRISMATIC_ROTOIDE, SLIDER, and UNIVERSAL.

Referenced by copyParameters(), and rotate().

void Physics::Joint::setAxis2 ( const osg::Vec3 &  axis  ) 

Sets secondary axis for the joint (attached to body 2 for universal and hinge2).

Used for universal, hinge2, prismatic rotoide

Definition at line 267 of file Joint.cpp.

References ASSERT, getType(), HINGE2, PRISMATIC_ROTOIDE, and UNIVERSAL.

Referenced by copyParameters(), and rotate().

void Physics::Joint::setAxisAngleAMotor ( UCHAR  num,
dReal  angle 
)

Sets one of the axis angle for the joint.

Used for AMotor.

Definition at line 344 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, and getType().

Referenced by copyParameters().

void Physics::Joint::setCFM ( dReal  val,
UINT  axis = 0 
) [inline]

Sets CFM (when not at a stop).

Definition at line 222 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setFeedback ( JointFeedback pJointFeedback  )  [inline]

Sets a feedback structure that will be filled with data on world step.

Setting NULL deactivates this feature for the current joint. As all joints don't need feedback, and as they are often destroyed and reallocated, the feedback is external to the joint class.

Definition at line 136 of file Joint.h.

void Physics::Joint::setHiStop ( dReal  val,
UINT  axis = 0 
) [inline]

Defines a high limit for the joint. Ex: PI/2 can be the higest angle for a hinge.

Definition at line 237 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setLoStop ( dReal  val,
UINT  axis = 0 
) [inline]

Defines a low limit for the joint. Ex: -PI/2 can be the lowest angle for a hinge.

Definition at line 233 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setMotorAxis ( UCHAR  num,
Joint::EAnchoredTo  frame,
const osg::Vec3 &  axis 
)

Sets one of the axis for the joint.

Used for AMotor, LMotor.

Definition at line 321 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, getType(), and LINEAR_MOTOR.

Referenced by copyParameters(), and rotate().

void Physics::Joint::setMotorFudgeFactor ( dReal  val,
UINT  axis = 0 
) [inline]

Sets a factor for the force applied to the joint when it leaves its stop position. Used to correct the behaviour if a "jumping" motion appears.

Definition at line 264 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setMotorMaxForce ( dReal  val,
UINT  axis = 0 
) [inline]

Definition at line 260 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setMotorVel ( dReal  val,
UINT  axis = 0 
) [inline]

Definition at line 257 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setNumAxes ( UCHAR  num  ) 

Sets the number of axes for the joint.

Used for AMotor, LMotor.

Definition at line 308 of file Joint.cpp.

References ANGULAR_MOTOR, ASSERT, getType(), and LINEAR_MOTOR.

Referenced by copyParameters().

void Physics::Joint::setPos ( const osg::Vec3 &  pos  ) 

Sets position (=anchor) of the joint.

Used for ball, hinge, universal, hinge2, prismatic rotoide

Definition at line 178 of file Joint.cpp.

References ASSERT, BALL, getType(), HINGE, HINGE2, PRISMATIC_ROTOIDE, and UNIVERSAL.

Referenced by copyParameters(), and translate().

void Physics::Joint::setStopBouncyness ( dReal  val,
UINT  axis = 0 
) [inline]

Defines the bouncyness for the limits of the joint, in [0;1].

Definition at line 241 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setStopCFM ( dReal  val,
UINT  axis = 0 
) [inline]

Sets CFM for the limit of the joint (warning : this does not work as expected for powered joints).

Definition at line 249 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::setStopERP ( dReal  val,
UINT  axis = 0 
) [inline]

Defines the ERP for the limits of the joint.

Definition at line 245 of file Joint.h.

References ASSERT.

Referenced by copyParameters().

void Physics::Joint::translate ( const osg::Vec3 &  vec  ) 


Friends And Related Function Documentation

friend class JointGroup [friend]

Definition at line 300 of file Joint.h.


Member Data Documentation

dJointID Physics::Joint::id [mutable, protected]

Definition at line 301 of file Joint.h.

dWorldID Physics::Joint::worldId [protected]

Definition at line 302 of file Joint.h.

Referenced by init().


The documentation for this class was generated from the following files:

Generated on Sun Jan 17 11:39:36 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9