#include <Joint.h>
Inheritance diagram for opal::Joint:
Public Member Functions | |
Joint () | |
virtual void OPAL_CALL | init (const JointData &data) |
virtual const JointData &OPAL_CALL | getData () |
virtual void OPAL_CALL | setName (const std::string &name) |
virtual const std::string &OPAL_CALL | getName () const |
virtual void OPAL_CALL | setContactsEnabled (bool e) |
virtual bool OPAL_CALL | areContactsEnabled () const |
virtual JointType OPAL_CALL | getType () const |
virtual void OPAL_CALL | setBreakParams (JointBreakMode mode, real breakThresh, real accumThresh=0) |
virtual JointBreakMode OPAL_CALL | getBreakingMode () const |
virtual real OPAL_CALL | getBreakThresh () const |
virtual real OPAL_CALL | getAccumulatedDamage () const |
virtual real OPAL_CALL | getAccumulatedThresh () const |
virtual bool OPAL_CALL | isBroken () const |
virtual void OPAL_CALL | repairAccumDamage () |
virtual void OPAL_CALL | setJointBreakEventHandler (JointBreakEventHandler *eventHandler) |
virtual JointBreakEventHandler *OPAL_CALL | getJointBreakEventHandler () const |
virtual void OPAL_CALL | setLimitsEnabled (int axisNum, bool e) |
virtual bool OPAL_CALL | areLimitsEnabled (int axisNum) |
virtual void OPAL_CALL | setLimitRange (int axisNum, real low, real high) |
virtual real OPAL_CALL | getLowLimit (int axisNum) const |
virtual real OPAL_CALL | getHighLimit (int axisNum) const |
virtual void OPAL_CALL | setLimitHardness (int axisNum, real h) |
virtual real OPAL_CALL | getLimitHardness (int axisNum) const |
virtual void OPAL_CALL | setLimitBounciness (int axisNum, real b) |
virtual real OPAL_CALL | getLimitBounciness (int axisNum) const |
virtual real OPAL_CALL | getAngle (int axisNum) const =0 |
virtual real OPAL_CALL | getDistance (int axisNum) const =0 |
virtual real OPAL_CALL | getVelocity (int axisNum) const =0 |
virtual void OPAL_CALL | addForce (int axisNum, real magnitude, real duration, bool singleStep=false) |
virtual void OPAL_CALL | addTorque (int axisNum, real magnitude, real duration, bool singleStep=false) |
virtual void OPAL_CALL | wakeSolids () |
virtual Solid *OPAL_CALL | getSolid0 () const |
virtual Solid *OPAL_CALL | getSolid1 () const |
virtual JointAxis OPAL_CALL | getAxis (int axisNum) const =0 |
virtual Point3r OPAL_CALL | getAnchor () const =0 |
virtual int OPAL_CALL | getNumAxes () const |
virtual bool OPAL_CALL | isEnabled () const |
virtual void OPAL_CALL | setEnabled (bool e) |
virtual bool OPAL_CALL | isRotational (int axisNum) const |
virtual void OPAL_CALL | setUserData (void *data) |
virtual void *OPAL_CALL | getUserData () |
virtual void OPAL_CALL | internal_update ()=0 |
virtual void OPAL_CALL | internal_setDesiredVel (int axisNum, real value)=0 |
virtual void OPAL_CALL | internal_setMaxTorque (int axisNum, real value)=0 |
virtual bool OPAL_CALL | internal_dependsOnSolid (Solid *s) |
virtual void OPAL_CALL | internal_destroy () |
Protected Member Functions | |
virtual | ~Joint () |
void | setSolids (Solid *s0, Solid *s1) |
virtual void | setAnchor (const Point3r &anchor) |
virtual void | setAxis (int axisNum, const JointAxis &axis) |
void | updateDamage (real currentStress) |
Protected Attributes | |
JointData | mData |
JointBreakEventHandler * | mJointBreakEventHandler |
void * | mUserData |
bool | mInitCalled |
int | mNumAxes |
bool | mAxisRotational [3] |
Definition at line 54 of file Joint.h.
|
Definition at line 33 of file Joint.cpp. References mAxisRotational, mInitCalled, mNumAxes, setJointBreakEventHandler(), and setUserData(). |
|
|
|
Applies a force to this Joint's Solid(s). To be used for translational axes. This does nothing if the Joint is disabled. Definition at line 223 of file Joint.cpp. References opal::Solid::addForce(), opal::JointData::axis, opal::JointAxis::direction, opal::Force::duration, opal::JointData::enabled, opal::LOCAL_FORCE, mData, mNumAxes, opal::Force::singleStep, opal::JointData::solid0, opal::JointData::solid1, opal::Force::type, and opal::Force::vec. |
|
Applies a torque to this Joint's Solid(s). To be used for rotational Joints. This does nothing if the Joint is disabled. Definition at line 258 of file Joint.cpp. References opal::Solid::addForce(), opal::JointData::axis, opal::defaults::sensor::incline::axis, opal::JointAxis::direction, opal::Force::duration, opal::JointData::enabled, opal::LOCAL_TORQUE, mData, mNumAxes, opal::Force::singleStep, opal::JointData::solid0, opal::JointData::solid1, opal::Force::type, and opal::Force::vec. Referenced by opal::GearedMotor::internal_update(). |
|
Returns whether the Joint's two Solids are constrained by physical contacts. Definition at line 86 of file Joint.cpp. References opal::JointData::contactsEnabled, and mData. Referenced by opal::ode_hidden::internal_collisionCallback(). |
|
Returns true if the given Joint axis' limits are enabled.
Definition at line 157 of file Joint.cpp. References opal::JointData::axis, opal::JointAxis::limitsEnabled, mData, and mNumAxes. |
|
How much damage has a Joint taken so far?
Definition at line 119 of file Joint.cpp. References opal::JointData::accumDamage, and mData. |
|
What is minimum amount of damage that will be recorded?
Definition at line 124 of file Joint.cpp. References opal::JointData::accumThresh, and mData. |
|
Returns the current anchor point in global coordinates. Passing in an invalid axis number will return invalid data. Implemented in opal::ODEJoint. |
|
For rotational axes, returns the current angle in degrees measured from the initial Joint configuration. For translational axes, simply returns 0. Implemented in opal::ODEJoint. Referenced by opal::ServoMotor::internal_update(). |
|
Returns the current specified axis in global coordinates. Passing in an invalid axis number will return invalid data. Implemented in opal::ODEJoint. Referenced by getData(). |
|
What is the mode of breaking?
Definition at line 109 of file Joint.cpp. References opal::JointData::breakMode, and mData. |
|
How much damage can a Joint take?
Definition at line 114 of file Joint.cpp. References opal::JointData::breakThresh, and mData. |
|
Returns all data describing the Joint.
Definition at line 58 of file Joint.cpp. References opal::JointData::axis, getAxis(), mData, and mNumAxes. |
|
For translational axes, returns the distance from the initial Joint configuration. For rotational axes, simply returns 0. Implemented in opal::ODEJoint. |
|
Returns the high limit for a given axis (angle in degrees for rotational axes, distance for translational axes). Definition at line 191 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::high, opal::JointAxis::limits, mData, and mNumAxes. Referenced by opal::ServoMotor::setDesiredAngle(), and opal::ServoMotor::setDesiredAngleNorm(). |
|
Returns the Joint's break event handler. If this returns NULL, the Joint is not using one. Definition at line 146 of file Joint.cpp. References mJointBreakEventHandler. |
|
Returns the bounciness for the given axis' limits.
Definition at line 217 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::bounciness, opal::JointAxis::limits, mData, and mNumAxes. |
|
Returns the hardness for the given axis' limits.
Definition at line 204 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::hardness, opal::JointAxis::limits, mData, and mNumAxes. |
|
Returns the low limit for a given axis (angle in degrees for rotational axes, distance for translational axes). Definition at line 185 of file Joint.cpp. References opal::JointData::axis, opal::JointAxis::limits, opal::JointLimits::low, mData, and mNumAxes. Referenced by opal::ServoMotor::setDesiredAngle(), and opal::ServoMotor::setDesiredAngleNorm(). |
|
Returns the Joint's name.
Definition at line 76 of file Joint.cpp. References mData, and opal::JointData::name. Referenced by opal::BlueprintInstance::internal_addJoint(). |
|
Returns the number of axes used by this Joint.
Definition at line 323 of file Joint.cpp. References mNumAxes. Referenced by opal::ServoMotor::init(). |
|
Returns a pointer to Solid0.
Definition at line 307 of file Joint.cpp. References mData, and opal::JointData::solid0. |
|
Returns a pointer to Solid1.
Definition at line 312 of file Joint.cpp. References mData, and opal::JointData::solid1. |
|
Returns the Joint type.
Definition at line 91 of file Joint.cpp. References opal::JointData::getType(), and mData. Referenced by opal::ode_hidden::internal_collisionCallback(). |
|
Returns the user data pointer (NULL if it has not been set).
Definition at line 359 of file Joint.cpp. References mUserData. |
|
Returns the current rate (degrees per second for rotational axes, distance units per second for translational axes) for a given axis. Implemented in opal::ODEJoint. Referenced by opal::GearedMotor::internal_update(). |
|
Initializes the Joint with the given data structure. Calling this more than once will automatically detach the Joint from its old Solids first. Reimplemented in opal::ODEJoint. Definition at line 53 of file Joint.cpp. References mData. Referenced by opal::ODEJoint::init(). |
|
Returns true if this Joint depends on the given Solid.
Definition at line 364 of file Joint.cpp. References mData, opal::JointData::solid0, and opal::JointData::solid1. |
|
Internal function used to destroy this object.
|
|
Set the desired linear or angular velocity for this Joint. This is to be used internally by Motors. Implemented in opal::ODEJoint. Referenced by opal::ServoMotor::internal_update(), opal::ServoMotor::setDesiredVel(), opal::ServoMotor::setEnabled(), and opal::ServoMotor::~ServoMotor(). |
|
Set the max force this Joint can use to attain its desired velocity. This is to be used internally by Motors. Implemented in opal::ODEJoint. Referenced by opal::ServoMotor::setEnabled(), opal::ServoMotor::setMaxTorque(), and opal::ServoMotor::~ServoMotor(). |
|
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. Implemented in opal::ODEJoint. |
|
Returns true if the Joint has been broken.
Definition at line 104 of file Joint.cpp. References opal::JointData::isBroken, and mData. |
|
Returns true if the Joint is enabled.
Definition at line 333 of file Joint.cpp. References opal::JointData::enabled, and mData. |
|
Returns true if the given Joint axis is rotational, false if it is linear. Definition at line 348 of file Joint.cpp. References mAxisRotational, and mNumAxes. Referenced by opal::ServoMotor::init(), opal::GearedMotor::init(), opal::ODEJoint::setLimitRange(), and opal::ODEJoint::setLimitsEnabled(). |
|
Repairs accumulated damage to breakable Joints in accumulated damage mode. This does not reenable the Joint. Definition at line 129 of file Joint.cpp. References opal::JointData::accumDamage, and mData. |
|
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 in opal::ODEJoint. Definition at line 328 of file Joint.cpp. References opal::defaults::joint::anchor, opal::JointData::anchor, and mData. Referenced by opal::ODEJoint::setAnchor(). |
|
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 in opal::ODEJoint. Definition at line 317 of file Joint.cpp. References opal::defaults::sensor::incline::axis, opal::JointData::axis, mData, and mNumAxes. Referenced by opal::ODEJoint::setAxis(). |
|
Sets the parameters that determine how this Joint will break, if at all. Definition at line 96 of file Joint.cpp. References opal::JointData::accumThresh, opal::JointData::breakMode, opal::JointData::breakThresh, and mData. |
|
Sets whether the Joint's two Solids are constrained by physical contacts. Definition at line 81 of file Joint.cpp. References opal::JointData::contactsEnabled, and mData. |
|
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 in opal::ODEJoint. Definition at line 338 of file Joint.cpp. References opal::JointData::enabled, mData, and mInitCalled. Referenced by opal::ODEJoint::setEnabled(), and updateDamage(). |
|
Sets the Joint's break event handler.
Definition at line 140 of file Joint.cpp. References mJointBreakEventHandler. Referenced by Joint(). |
|
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 in opal::ODEJoint. Definition at line 210 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::bounciness, opal::JointAxis::limits, mData, and mNumAxes. Referenced by opal::ODEJoint::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 in opal::ODEJoint. Definition at line 197 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::hardness, opal::JointAxis::limits, mData, and mNumAxes. Referenced by opal::ODEJoint::setLimitHardness(). |
|
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 in opal::ODEJoint. Definition at line 177 of file Joint.cpp. References opal::JointData::axis, opal::JointLimits::high, opal::JointAxis::limits, opal::JointLimits::low, mData, and mNumAxes. Referenced by opal::ODEJoint::setLimitRange(). |
|
Enables or disables the given Joint axis' limits.
Reimplemented in opal::ODEJoint. Definition at line 151 of file Joint.cpp. References opal::JointData::axis, opal::JointAxis::limitsEnabled, mData, and mNumAxes. Referenced by opal::ODEJoint::setLimitsEnabled(). |
|
Sets the Joint's name.
Definition at line 71 of file Joint.cpp. References mData, and opal::JointData::name. |
|
Sets the Solids constrained by this Joint.
Definition at line 301 of file Joint.cpp. References mData, opal::JointData::solid0, and opal::JointData::solid1. Referenced by opal::ODEJoint::filterSolidForStaticness(). |
|
Set the user data pointer to some external data. The user data is totally user-managed (i.e. it is not destroyed when the Joint is destroyed). Definition at line 354 of file Joint.cpp. References mUserData. Referenced by Joint(). |
|
Updates this Joint's current damage status based on the current amount of stress. Definition at line 376 of file Joint.cpp. References opal::JointData::accumDamage, opal::JointData::accumThresh, opal::ACCUMULATED_MODE, opal::JointData::breakMode, opal::JointData::breakThresh, opal::JointBreakEventHandler::handleJointBreakEvent(), opal::JointData::isBroken, mData, mJointBreakEventHandler, setEnabled(), opal::THRESHOLD_MODE, and opal::UNBREAKABLE_MODE. Referenced by opal::ODEJoint::internal_update(). |
|
Wakes up this Joint's two Solids.
Definition at line 293 of file Joint.cpp. References mData, opal::Solid::setSleeping(), opal::JointData::solid0, and opal::JointData::solid1. Referenced by opal::ServoMotor::internal_update(). |
|
Definition at line 287 of file Joint.h. Referenced by opal::ODEJoint::init(), isRotational(), and Joint(). |
|
|
This is set to true when the Joint is initialized.
Definition at line 280 of file Joint.h. Referenced by opal::ODEJoint::init(), Joint(), opal::ODEJoint::setEnabled(), and setEnabled(). |
|
A pointer to the Joint's break event handler.
Definition at line 273 of file Joint.h. Referenced by getJointBreakEventHandler(), opal::ODEJoint::init(), setJointBreakEventHandler(), and updateDamage(). |
|
The number of axes used by the Joint.
Definition at line 283 of file Joint.h. Referenced by addForce(), addTorque(), areLimitsEnabled(), opal::ODEJoint::getAngle(), opal::ODEJoint::getAxis(), getData(), opal::ODEJoint::getDistance(), getHighLimit(), getLimitBounciness(), getLimitHardness(), getLowLimit(), getNumAxes(), opal::ODEJoint::getVelocity(), opal::ODEJoint::init(), opal::ODEJoint::internal_setDesiredVel(), opal::ODEJoint::internal_setMaxTorque(), isRotational(), Joint(), opal::ODEJoint::setAxis(), setAxis(), setLimitBounciness(), setLimitHardness(), setLimitRange(), and setLimitsEnabled(). |
|
Pointer to user data. This is totally user-managed (i.e. OPAL will never delete it). Definition at line 277 of file Joint.h. Referenced by getUserData(), and setUserData(). |