#include <ODEJoint.h>
Inheritance diagram for opal::ODEJoint:
Public Member Functions | |
ODEJoint (dWorldID worldID) | |
virtual | ~ODEJoint () |
virtual void OPAL_CALL | init (const JointData &data) |
virtual real OPAL_CALL | getAngle (int axisNum) const |
virtual real OPAL_CALL | getDistance (int axisNum) const |
virtual real OPAL_CALL | getVelocity (int axisNum) const |
virtual void OPAL_CALL | setLimitsEnabled (int axisNum, bool e) |
virtual void OPAL_CALL | setEnabled (bool e) |
virtual void OPAL_CALL | setLimitRange (int axisNum, real low, real high) |
virtual void OPAL_CALL | setLimitHardness (int axisNum, real h) |
virtual void OPAL_CALL | setLimitBounciness (int axisNum, real b) |
virtual JointAxis OPAL_CALL | getAxis (int axisNum) const |
virtual Point3r OPAL_CALL | getAnchor () const |
virtual void OPAL_CALL | internal_update () |
virtual void OPAL_CALL | internal_setDesiredVel (int axisNum, real value) |
virtual void OPAL_CALL | internal_setMaxTorque (int axisNum, real value) |
dJointID OPAL_CALL | internal_getJointID () const |
Protected Member Functions | |
virtual void | setAxis (int axisNum, const JointAxis &axis) |
virtual void | setAnchor (const Point3r &anchor) |
void | setJointParam (int parameter, dReal value) |
virtual real | calcStress () |
virtual void | attachODEBodies (Solid *s0, Solid *s1) |
void | filterSolidForStaticness (Solid *s0, Solid *s1) |
Protected Attributes | |
dJointID | mJointID |
dJointID | mAMotorID |
dWorldID | mWorldID |
dJointFeedback | mJointFeedback |
Definition at line 39 of file ODEJoint.h.
|
Definition at line 33 of file ODEJoint.cpp. |
|
Definition at line 40 of file ODEJoint.cpp. |
|
Attaches the ODE Joint to the given ODESolids.
Definition at line 1016 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::JointData::getType(), mAMotorID, opal::Joint::mData, and mJointID. Referenced by setEnabled(). |
|
Returns the current amount of stress on this Joint.
Definition at line 968 of file ODEJoint.cpp. References opal::ACCUMULATED_MODE, opal::JointData::breakMode, opal::Vec3r::length(), opal::Joint::mData, mJointID, opal::THRESHOLD_MODE, and opal::UNBREAKABLE_MODE. Referenced by internal_update(). |
|
Static solids are set to NULL internally.
Definition at line 213 of file ODEJoint.cpp. References opal::JointData::enabled, opal::Solid::isStatic(), opal::Joint::mData, and opal::Joint::setSolids(). Referenced by setEnabled(). |
|
Returns the current anchor point in global coordinates. Passing in an invalid axis number will return invalid data. Implements opal::Joint. Definition at line 524 of file ODEJoint.cpp. References opal::defaults::joint::anchor, opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, opal::Joint::mData, mJointID, opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
For rotational axes, returns the current angle in degrees measured from the initial Joint configuration. For translational axes, simply returns 0. Implements opal::Joint. Definition at line 239 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, mAMotorID, opal::Joint::mData, mJointID, opal::Joint::mNumAxes, opal::radToDeg(), opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Returns the current specified axis in global coordinates. Passing in an invalid axis number will return invalid data. Implements opal::Joint. Definition at line 452 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, mAMotorID, opal::Joint::mData, mJointID, opal::Joint::mNumAxes, opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
For translational axes, returns the distance from the initial Joint configuration. For rotational axes, simply returns 0. Implements opal::Joint. Definition at line 292 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, opal::Joint::mData, mJointID, opal::Joint::mNumAxes, opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Returns the current rate (degrees per second for rotational axes, distance units per second for translational axes) for a given axis. Implements opal::Joint. Definition at line 327 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, mAMotorID, opal::Joint::mData, mJointID, opal::Joint::mNumAxes, opal::radToDeg(), opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Note: For a perfect save/restore in ODE, the "warm starting" data should be stored in JointData. However, there is currently no easy way to get this data. Reimplemented from opal::Joint. Definition at line 49 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, opal::Joint::init(), opal::defaults::ode::jointFudgeFactor, mAMotorID, opal::Joint::mAxisRotational, opal::Joint::mInitCalled, opal::Joint::mJointBreakEventHandler, mJointID, opal::Joint::mNumAxes, mWorldID, setJointParam(), opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Returns the ODE joint ID of this ODEJoint.
Definition at line 1004 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::JointData::getType(), mAMotorID, and opal::Joint::mData. |
|
Set the desired linear or angular velocity for this Joint. This is to be used internally by Motors. Implements opal::Joint. Definition at line 566 of file ODEJoint.cpp. References opal::Joint::mNumAxes, and setJointParam(). |
|
Set the max force this Joint can use to attain its desired velocity. This is to be used internally by Motors. Implements opal::Joint. Definition at line 587 of file ODEJoint.cpp. References opal::Joint::mNumAxes, and setJointParam(). |
|
Various things could be updated here, including damage values. If the Joint breaks during this update, it will automatically be disabled, and the event handler will be notified. Implements opal::Joint. Definition at line 557 of file ODEJoint.cpp. References calcStress(), opal::JointData::enabled, opal::Joint::mData, and opal::Joint::updateDamage(). |
|
Sets the anchor point for this Joint. Both Solids must be valid (non-NULL) before this is called for it to affect anything. This Joint's Solids must be positioned and attached before calling this function. Reimplemented from opal::Joint. Definition at line 704 of file ODEJoint.cpp. References opal::defaults::joint::anchor, opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, opal::Joint::mData, mJointID, opal::Joint::setAnchor(), opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Specifies the given axis for this Joint. Invalid axes numbers will be silently ignored. The axis direction vector will be normalized. This Joint's Solids must be positioned and attached before calling this function. Reimplemented from opal::Joint. Definition at line 608 of file ODEJoint.cpp. References opal::defaults::sensor::incline::axis, opal::BALL_JOINT, opal::JointAxis::direction, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, mAMotorID, opal::Joint::mData, mJointID, opal::Joint::mNumAxes, opal::Vec3r::normalize(), opal::Joint::setAxis(), opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. |
|
Set whether the Joint can affect its Solids. If both Solids are NULL, this will remain disabled. If the Joint has not yet been initialized, this will have no effect. Reimplemented from opal::Joint. Definition at line 821 of file ODEJoint.cpp. References attachODEBodies(), filterSolidForStaticness(), opal::Joint::mData, opal::Joint::mInitCalled, opal::Joint::setEnabled(), opal::JointData::solid0, and opal::JointData::solid1. |
|
Helper function to make it easier to set parameters for various ODE Joint types. Definition at line 908 of file ODEJoint.cpp. References opal::BALL_JOINT, opal::FIXED_JOINT, opal::JointData::getType(), opal::HINGE_JOINT, mAMotorID, opal::Joint::mData, mJointID, opal::SLIDER_JOINT, opal::UNIVERSAL_JOINT, and opal::WHEEL_JOINT. Referenced by init(), internal_setDesiredVel(), internal_setMaxTorque(), setLimitBounciness(), setLimitHardness(), setLimitRange(), and setLimitsEnabled(). |
|
Sets the bounciness for the given axis' limits. Bounciness (i.e. restitution) represents how much the Joint will bounce when it hits a limit. Bounciness must be between 0 and 1, inclusive. Reimplemented from opal::Joint. Definition at line 425 of file ODEJoint.cpp. References opal::defaults::ode::maxERP, opal::defaults::ode::minERP, setJointParam(), and opal::Joint::setLimitBounciness(). |
|
Sets the hardness for the given axis' limits. Hardness represents how "squishy" the limit is. Hardness must be between 0 and 1, inclusive. Setting the hardness for axis 1 of the Wheel Joint will adjust its suspension. Reimplemented from opal::Joint. Definition at line 391 of file ODEJoint.cpp. References opal::JointData::getType(), opal::defaults::ode::maxERP, opal::Joint::mData, opal::defaults::ode::minERP, setJointParam(), opal::Joint::setLimitHardness(), and opal::WHEEL_JOINT. |
|
Sets the Joint's limit angles (in degrees for rotational axes, distance for translational axes). No limits are applied if this is not called. The Wheel Joint does not use limits for axis 1, so setting this will do nothing. Reimplemented from opal::Joint. Definition at line 853 of file ODEJoint.cpp. References opal::JointData::axis, opal::degToRad(), opal::Joint::isRotational(), opal::JointAxis::limitsEnabled, opal::Joint::mData, setJointParam(), and opal::Joint::setLimitRange(). |
|
Enables or disables the given Joint axis' limits.
Reimplemented from opal::Joint. Definition at line 740 of file ODEJoint.cpp. References opal::JointData::axis, opal::degToRad(), opal::JointLimits::high, opal::Joint::isRotational(), opal::JointAxis::limits, opal::JointLimits::low, opal::Joint::mData, setJointParam(), and opal::Joint::setLimitsEnabled(). |
|
The ODE AMotor ID, only used for ball Joints.
Definition at line 109 of file ODEJoint.h. Referenced by attachODEBodies(), getAngle(), getAxis(), getVelocity(), init(), internal_getJointID(), ODEJoint(), setAxis(), setJointParam(), and ~ODEJoint(). |
|
An ODE JointFeedback struct that must be allocated somewhere in order to get the Joint data necessary to calculate Joint stress. Definition at line 117 of file ODEJoint.h. |
|
The ODE Joint ID.
Definition at line 106 of file ODEJoint.h. Referenced by attachODEBodies(), calcStress(), getAnchor(), getAngle(), getAxis(), getDistance(), getVelocity(), init(), ODEJoint(), setAnchor(), setAxis(), setJointParam(), and ~ODEJoint(). |
|
The ID of the ODE World containing this Joint.
Definition at line 112 of file ODEJoint.h. Referenced by init(), and ODEJoint(). |