#include <joint.h>
Inheritance diagram for oxygen::Joint:
Public Types | |
enum | EBodyIndex { BI_FIRST = 0, BI_SECOND = 1 } |
enum | EAxisIndex { AI_FIRST = 0, AI_SECOND = 1, AI_THIRD = 2 } |
Public Member Functions | |
Joint () | |
virtual | ~Joint () |
virtual void | Attach (boost::shared_ptr< Body > body1, boost::shared_ptr< Body > body2) |
attaches the joint to some new bodies. | |
void | Attach (const std::string &path1, const std::string &path2) |
attaches the joint to some new bodies, that are given as path expressions. | |
boost::shared_ptr< Body > | GetBody (EBodyIndex idx) |
returns one of the bodies that this joint connects, according to the given EBodyIndex | |
int | GetType () |
returns the type of the managed ODE joint, possible return values are dJointTypeNone, dJointTypeBall, dJointTypeHinge, dJointTypeSlider, dJointTypeContact, dJointTypeUniversal, dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor. | |
void | EnableFeedback (bool enable) |
during the world time step, the forces that are applied by each joint are added directly to the joined bodies, and the user normally has no way of telling which joint contributed how much force. | |
bool | FeedBackEnabled () |
returns true if the joint is set to collect feedback information | |
salt::Vector3f | GetFeedbackForce (EBodyIndex idx) |
queries the force that the joint applied to one body attached to it during the last timestep. | |
salt::Vector3f | GetFeedbackTorque (EBodyIndex idx) |
queries the torque that the joint applied to one body attached to it during the last timestep. | |
void | SetBounce (EAxisIndex idx, float bounce) |
sets the bouncyness of the stops. | |
float | GetBounce (EAxisIndex idx) |
returns the bouncyness of the stops | |
void | SetLowStopDeg (EAxisIndex idx, float deg) |
sets the low stop angle in degrees, this stop must be greater than -180 to be effective | |
float | GetLowStopDeg (EAxisIndex idx) |
returns the low stop angle in degrees | |
void | SetHighStopDeg (EAxisIndex idx, float deg) |
sets the high stop angle in degrees, this stop must be less than +180 to be effective | |
float | GetHighStopDeg (EAxisIndex idx) |
returns the high stop angle in degrees | |
void | SetLowStopPos (EAxisIndex idx, float deg) |
sets the low stop position | |
float | GetLowStopPos (EAxisIndex idx) |
returns the low stop position | |
void | SetHighStopPos (EAxisIndex idx, float deg) |
sets the high stop position | |
float | GetHighStopPos (EAxisIndex idx) |
returns the high stop position | |
void | SetCFM (EAxisIndex idx, float cfm) |
the constraint force mixing (CFM) value used when not at a stop | |
float | GetCFM (EAxisIndex idx) |
returns the constraint force mixing value used when not a a stop | |
void | SetStopCFM (EAxisIndex idx, float cfm) |
sets the constraint force mixing (CFM) value used by the stops. | |
float | GetStopCFM (EAxisIndex idx) |
returns the constraint force mixing value used by the stops | |
void | SetStopERP (EAxisIndex idx, float erp) |
sets the error reduction parameter (ERP) used by the stops. | |
float | GetStopERP (EAxisIndex idx) |
returns the error reduction parameter used by the stops | |
void | SetSuspensionERP (EAxisIndex idx, float erp) |
sets the suspension error reduction parameter (ERP). | |
float | GetSuspensionERP (EAxisIndex idx) |
returns the suspension error reduction parameter (ERP). | |
void | SetSuspensionCFM (EAxisIndex idx, float cfm) |
sets the suspension constraint force mixing value. | |
float | GetSuspensionCFM (EAxisIndex idx) |
returns the suspension constraint force mixing value. | |
void | SetLinearMotorVelocity (EAxisIndex idx, float vel) |
sets the linear motor velocity | |
float | GetLinearMotorVelocity (EAxisIndex idx) |
returns the linear motor velocity | |
void | SetAngularMotorVelocity (EAxisIndex idx, float deg) |
sets the angular motor velocity in degrees | |
float | GetAngularMotorVelocity (EAxisIndex idx) |
returns the angular motor velocity in degrees | |
void | SetMaxMotorForce (EAxisIndex idx, float f) |
sets the maximum force or torque that the motor will use to achieve the desired velocity. | |
float | GetMaxMotorForce (EAxisIndex idx) |
returns the maximum force or torque that the motor will use to achieve the desired velocity. | |
Static Public Member Functions | |
static boost::shared_ptr< Joint > | GetJoint (dJointID id) |
returns the Joint node corresponding to the given ODE joint | |
static bool | AreConnected (boost::shared_ptr< Body > body1, boost::shared_ptr< Body > body2) |
returns true if the two given bodies are connected by a joint | |
static bool | AreConnectedExcluding (boost::shared_ptr< Body > body1, boost::shared_ptr< Body > body2, int joint_type) |
returns true if the two given bodies are connected together by a joint that does not have the given joint type. | |
Protected Member Functions | |
virtual void | OnLink () |
associated the created ODE joint with this node | |
boost::shared_ptr< Body > | GetBody (const std::string &path) |
get the node at 'path' and tries a cast to Body | |
virtual void | SetParameter (int parameter, float value)=0 |
sets a joint parameter value | |
virtual float | GetParameter (int parameter)=0 |
returns a joint parameter value | |
Protected Attributes | |
dJointID | mODEJoint |
the managed ODE joint | |
boost::shared_ptr< dJointFeedback > | mFeedback |
the allocated joint feedback structure |
A joint is a relationship (a constraint) that is enforced between two bodies so that they can only have certain positions and orientations relative to each other.
Note that the joint geometry parameter setting functions should only be called after the joint has been attached to bodies, and those bodies have been correctly positioned, otherwise the joint may not be initialized correctly. If the joint is not already attached, these functions will do nothing.
The default anchor for all joints is global (0,0,0). The default axis for all joints is global (1,0,0).
There are no functions to set joint angles or positions (or their rates) directly, instead you must set the corresponding body positions and velocities.
Definition at line 49 of file joint.h.
|
|
|
|
|
|
|
Definition at line 33 of file joint.cpp. References EnableFeedback(), and mODEJoint. Here is the call graph for this function: ![]() |
|
returns true if the two given bodies are connected by a joint
|
|
returns true if the two given bodies are connected together by a joint that does not have the given joint type. For possible joint type constants see GetType() |
|
attaches the joint to some new bodies, that are given as path expressions. These path expressions are allowed to be relative to this joint node. Definition at line 156 of file joint.cpp. References Attach(), and GetBody(). Here is the call graph for this function: ![]() |
|
attaches the joint to some new bodies. If the joint is already attached, it will be detached from the old bodies first. To attach this joint to only one body, set body1 or body2 to null. A null body refers to the static environment. Setting both bodies to zero puts the joint into "limbo", i.e. it will have no effect on the simulation. Reimplemented in oxygen::SliderJoint. Referenced by Attach(). |
|
during the world time step, the forces that are applied by each joint are added directly to the joined bodies, and the user normally has no way of telling which joint contributed how much force. If this information is desired the joint can be enabled to collect feedback information. By default a joint does not collect any feedback information. Definition at line 203 of file joint.cpp. References mFeedback, and mODEJoint. Referenced by ~Joint(). |
|
returns true if the joint is set to collect feedback information
Definition at line 223 of file joint.cpp. References mODEJoint. |
|
returns the angular motor velocity in degrees
Definition at line 401 of file joint.cpp. References GetParameter(), and salt::gRadToDeg(). Here is the call graph for this function: ![]() |
|
get the node at 'path' and tries a cast to Body
Definition at line 124 of file joint.cpp. References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), and zeitgeist::Object::GetSelf(). Here is the call graph for this function: ![]() |
|
returns one of the bodies that this joint connects, according to the given EBodyIndex
Definition at line 169 of file joint.cpp. References oxygen::Body::GetBody(), and mODEJoint. Referenced by Attach(). Here is the call graph for this function: ![]() |
|
returns the bouncyness of the stops
Definition at line 291 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the constraint force mixing value used when not a a stop
Definition at line 341 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
queries the force that the joint applied to one body attached to it during the last timestep.
|
|
queries the torque that the joint applied to one body attached to it during the last timestep.
|
|
returns the high stop angle in degrees
Definition at line 331 of file joint.cpp. References GetParameter(), and salt::gRadToDeg(). Here is the call graph for this function: ![]() |
|
returns the high stop position
Definition at line 311 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the Joint node corresponding to the given ODE joint
Definition at line 53 of file joint.cpp. References zeitgeist::Object::GetSelf(). Here is the call graph for this function: ![]() |
|
returns the linear motor velocity
Definition at line 391 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the low stop angle in degrees
Definition at line 321 of file joint.cpp. References GetParameter(), and salt::gRadToDeg(). Here is the call graph for this function: ![]() |
|
returns the low stop position
Definition at line 301 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the maximum force or torque that the motor will use to achieve the desired velocity.
Definition at line 411 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns a joint parameter value
Implemented in oxygen::AngularMotor, oxygen::BallJoint, oxygen::FixedJoint, oxygen::Hinge2Joint, oxygen::HingeJoint, oxygen::SliderJoint, and oxygen::UniversalJoint. Referenced by GetAngularMotorVelocity(), GetBounce(), GetCFM(), GetHighStopDeg(), GetHighStopPos(), GetLinearMotorVelocity(), GetLowStopDeg(), GetLowStopPos(), GetMaxMotorForce(), GetStopCFM(), GetStopERP(), GetSuspensionCFM(), and GetSuspensionERP(). |
|
returns the constraint force mixing value used by the stops
Definition at line 351 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the error reduction parameter used by the stops
Definition at line 361 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the suspension constraint force mixing value. As of ode 0.039 this is only implemented on the hinge-2 joint. Definition at line 381 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the suspension error reduction parameter (ERP). As of ode 0.039 this is only implemented on the hinge-2 joint. Definition at line 371 of file joint.cpp. References GetParameter(). Here is the call graph for this function: ![]() |
|
returns the type of the managed ODE joint, possible return values are dJointTypeNone, dJointTypeBall, dJointTypeHinge, dJointTypeSlider, dJointTypeContact, dJointTypeUniversal, dJointTypeHinge2, dJointTypeFixed or dJointTypeAMotor.
Definition at line 164 of file joint.cpp. References mODEJoint. |
|
associated the created ODE joint with this node
Reimplemented from zeitgeist::Leaf. Reimplemented in oxygen::AngularMotor, oxygen::BallJoint, oxygen::FixedJoint, oxygen::Hinge2Joint, oxygen::HingeJoint, oxygen::SliderJoint, and oxygen::UniversalJoint. Definition at line 43 of file joint.cpp. References mODEJoint. |
|
sets the angular motor velocity in degrees
Definition at line 396 of file joint.cpp. References salt::gDegToRad(), and SetParameter(). Here is the call graph for this function: ![]() |
|
sets the bouncyness of the stops. This is a restitution parameter in the range 0..1. 0 means the stops are not bouncy at all, 1 means maximum bouncyness. Definition at line 286 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
the constraint force mixing (CFM) value used when not at a stop
Definition at line 336 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the high stop angle in degrees, this stop must be less than +180 to be effective
Definition at line 326 of file joint.cpp. References salt::gDegToRad(), and SetParameter(). Here is the call graph for this function: ![]() |
|
sets the high stop position
Definition at line 306 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the linear motor velocity
Definition at line 386 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the low stop angle in degrees, this stop must be greater than -180 to be effective
Definition at line 316 of file joint.cpp. References salt::gDegToRad(), and SetParameter(). Here is the call graph for this function: ![]() |
|
sets the low stop position
Definition at line 296 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the maximum force or torque that the motor will use to achieve the desired velocity. This must always be greater than or equal to zero. Setting this to zero (the default value) turns off the motor Definition at line 406 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets a joint parameter value
Implemented in oxygen::AngularMotor, oxygen::BallJoint, oxygen::FixedJoint, oxygen::Hinge2Joint, oxygen::HingeJoint, oxygen::SliderJoint, and oxygen::UniversalJoint. Referenced by SetAngularMotorVelocity(), SetBounce(), SetCFM(), SetHighStopDeg(), SetHighStopPos(), SetLinearMotorVelocity(), SetLowStopDeg(), SetLowStopPos(), SetMaxMotorForce(), SetStopCFM(), SetStopERP(), SetSuspensionCFM(), and SetSuspensionERP(). |
|
sets the constraint force mixing (CFM) value used by the stops. Together with the ERP value this can be used to get spongy or soft stops. This is intended for unpowered joints, it does not really work as expected when a powered joint reaches its limit. Definition at line 346 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the error reduction parameter (ERP) used by the stops.
Definition at line 356 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the suspension constraint force mixing value. As of ode 0.039 this is only implemented on the hinge-2 joint. Definition at line 376 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
sets the suspension error reduction parameter (ERP). As of ode 0.039 this is only implemented on the hinge-2 joint. Definition at line 366 of file joint.cpp. References SetParameter(). Here is the call graph for this function: ![]() |
|
the allocated joint feedback structure
Definition at line 259 of file joint.h. Referenced by EnableFeedback(), GetFeedbackForce(), and GetFeedbackTorque(). |
|