#include <Joint.h>
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. | |
Body * | getBody1 () |
Gets first body in joint, or NULL (= global frame). | |
Body * | getBody2 () |
Gets second body in joint, or NULL (= global frame). | |
const Body * | getBody1 () const |
const version of getBody1(). | |
const Body * | getBody2 () 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. | |
JointFeedback * | getFeedback () |
Gets the current feetback structure. | |
const JointFeedback * | getFeedback () 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 ¢er) |
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 |
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.
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.
typedef dReal(* Physics::Joint::TFuncODEGetParam)(dJointID, int) [protected] |
typedef void(* Physics::Joint::TFuncODESetParam)(dJointID, int, dReal) [protected] |
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.
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 |
Physics::Joint::Joint | ( | World * | pWorld, | |
EJointType | type | |||
) |
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 | ( | World * | pWorld, | |
EJointType | type, | |||
dJointGroupID | joinGroup | |||
) | [protected] |
void Physics::Joint::accept | ( | Visitor & | v | ) | [virtual] |
Definition at line 498 of file Joint.cpp.
References Physics::Visitor::apply().
Referenced by C3DPhy::accept().
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 | ) |
Copies all parameters of a joint of the same type.
Definition at line 50 of file Joint.cpp.
References ANGULAR_MOTOR, ASSERT, BALL, CONTACT, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, FIXED, getAMotorMode(), getAxis1(), getAxis2(), getAxisAngleAMotor(), getAxisFrameAMotor(), getCFM(), getHiStop(), getLoStop(), getMotorAxis(), getMotorFudgeFactor(), getMotorMaxForce(), getMotorVel(), getNumAxes(), getPosBody1(), getStopBouncyness(), getStopCFM(), getStopERP(), getType(), HINGE, HINGE2, LINEAR_MOTOR, PLANE2D, PRISMATIC_ROTOIDE, setAMotorMode(), setAxis1(), setAxis2(), setAxisAngleAMotor(), setCFM(), setHiStop(), setLoStop(), setMotorAxis(), setMotorFudgeFactor(), setMotorMaxForce(), setMotorVel(), setNumAxes(), setPos(), setStopBouncyness(), setStopCFM(), setStopERP(), SLIDER, THROW_TRACED_EXCEPTION, and UNIVERSAL.
Referenced by C3DPhy::attachBodies(), and Joint().
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 |
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 |
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] |
const JointFeedback* Physics::Joint::getFeedback | ( | ) | const [inline] |
JointFeedback* Physics::Joint::getFeedback | ( | ) | [inline] |
dReal Physics::Joint::getHiStop | ( | UINT | axis = 0 |
) | const [inline] |
dReal Physics::Joint::getLoStop | ( | UINT | axis = 0 |
) | const [inline] |
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] |
dReal Physics::Joint::getMotorMaxForce | ( | UINT | axis = 0 |
) | const [inline] |
dReal Physics::Joint::getMotorVel | ( | UINT | axis = 0 |
) | const [inline] |
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] |
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 |
dReal Physics::Joint::getRelAngleAxis1 | ( | ) | const |
dReal Physics::Joint::getRelAngleRateAxis1 | ( | ) | const |
dReal Physics::Joint::getRelAngleRateAxis2 | ( | ) | const |
dReal Physics::Joint::getRelPosAxis1 | ( | ) | const |
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] |
dReal Physics::Joint::getStopCFM | ( | UINT | axis = 0 |
) | const [inline] |
dReal Physics::Joint::getStopERP | ( | UINT | axis = 0 |
) | const [inline] |
EJointType Physics::Joint::getType | ( | ) | const [inline] |
Returns the type of the joint.
Definition at line 117 of file Joint.h.
Referenced by attach(), copyParameters(), getAMotorMode(), getAxis1(), getAxis2(), getAxisAngleAMotor(), getAxisAngleRateAMotor(), getAxisFrameAMotor(), getMotorAxis(), getNumAxes(), getODEGetParamFuncPt(), getODESetParamFuncPt(), getPosBody1(), getPosBody2(), getRelAngleAxis1(), getRelAngleRateAxis1(), getRelAngleRateAxis2(), getRelPosAxis1(), getRelPosRateAxis1(), Joint(), rotate(), setAMotorMode(), setAxis1(), setAxis2(), setAxisAngleAMotor(), setMotorAxis(), setNumAxes(), setPos(), and translate().
void Physics::Joint::init | ( | EJointType | type, | |
dContact * | pContact = NULL , |
|||
dJointGroupID | joinGroup = NULL | |||
) | [protected] |
Definition at line 145 of file Joint.cpp.
References ANGULAR_MOTOR, BALL, CONTACT, FIXED, HINGE, HINGE2, LINEAR_MOTOR, PLANE2D, PRISMATIC_ROTOIDE, SLIDER, THROW_TRACED_EXCEPTION, UNIVERSAL, and worldId.
Referenced by Joint().
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 | ) |
Definition at line 447 of file Joint.cpp.
References ANGULAR_MOTOR, getAxis1(), getAxis2(), getAxisFrameAMotor(), getBody1(), getBody2(), getMotorAxis(), getNumAxes(), getType(), HINGE, HINGE2, LINEAR_MOTOR, PLANE2D, PRISMATIC_ROTOIDE, setAxis1(), setAxis2(), setMotorAxis(), SLIDER, THROW_TRACED_EXCEPTION, and UNIVERSAL.
Referenced by rotate().
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.
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] |
void Physics::Joint::setMotorVel | ( | dReal | val, | |
UINT | axis = 0 | |||
) | [inline] |
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 | ) |
Definition at line 439 of file Joint.cpp.
References BALL, getBody1(), getBody2(), getPosBody1(), getType(), HINGE, HINGE2, PLANE2D, PRISMATIC_ROTOIDE, setPos(), THROW_TRACED_EXCEPTION, and UNIVERSAL.
Referenced by rotate(), and C3DPhy::translate().
friend class JointGroup [friend] |
dJointID Physics::Joint::id [mutable, protected] |
dWorldID Physics::Joint::worldId [protected] |