SO3Engine
|
hinge joint. More...
#include <OgreNewt_BasicJoints.h>
Public Member Functions | |
Hinge (const OgreNewt::Body *child, const OgreNewt::Body *parent, const Ogre::Vector3 &pos, const Ogre::Vector3 &pin) | |
constructor | |
~Hinge () | |
destructor | |
void | enableLimits (bool state) |
enable hinge limits. | |
void | enableMotor (bool state) |
void | setLimits (Ogre::Radian minAngle, Ogre::Radian maxAngle) |
set minimum and maximum hinge limits. | |
Ogre::Radian | getJointAngle () const |
get the relative joint angle around the hinge pin. | |
Ogre::Vector3 | getJointForce () |
retrieve the current joint force. | |
Ogre::Radian | getJointAngularVelocity () const |
get the relative joint angle around the hinge pin. | |
Ogre::Vector3 | getJointPin () const |
get the joint pin in global space | |
void | setDesiredOmega (Ogre::Radian omega, Ogre::Real strength=0.5f) |
sets desired rotational velocity of the joint | |
void | setDesiredAngle (Ogre::Radian angle, Ogre::Real minFriction=0, Ogre::Real maxFriction=0) |
set desired angle and optionally minimum and maximum friction | |
void | setTorque (Ogre::Real torque) |
sets hinge torque | |
void | setBrake (Ogre::Real maxForce=0) |
apply hinge brake for one frame. | |
void | clearConstraints () |
clears the motor constraints | |
virtual void | submitConstraint (Ogre::Real timestep, int threadindex) |
must be define for a functioning joint. | |
Public Member Functions inherited from OgreNewt::Joint | |
Joint () | |
constructor | |
virtual | ~Joint () |
destructor | |
Body * | getBody0 () const |
get the pointer to the first rigid body | |
Body * | getBody1 () const |
get the pointer to the first rigid body | |
const OgreNewt::World * | getWorld () |
get the pointer to the world | |
virtual void | showDebugData (Ogre::SceneNode *debugRootNode) |
show joint visual debugging data | |
int | getCollisionState () const |
returns collision state | |
void | setCollisionState (int state) const |
sets the collision state | |
Ogre::Real | getStiffness () const |
get joint stiffness | |
void | setStiffness (Ogre::Real stiffness) const |
set joint stiffness | |
Protected Types | |
enum | ConstraintType { CONSTRAINT_NONE , CONSTRAINT_OMEGA , CONSTRAINT_ANGLE , CONSTRAINT_BRAKE } |
Protected Attributes | |
ConstraintType | m_constraintType |
ConstraintType | m_lastConstraintType |
Ogre::Radian | m_desiredOmega |
Ogre::Radian | m_desiredAngle |
bool | m_useLimits |
bool | m_useMotor |
Ogre::Radian | m_minAngle |
Ogre::Radian | m_maxAngle |
Ogre::Real | m_motorStrength |
Ogre::Real | m_motorTorque |
Ogre::Real | m_motorMinFriction |
Ogre::Real | m_motorMaxFriction |
Ogre::Real | m_brakeMaxForce |
bool | m_torqueOn |
Protected Attributes inherited from OgreNewt::Joint | |
CustomJoint * | m_joint |
Additional Inherited Members | |
Protected Member Functions inherited from OgreNewt::Joint | |
void | addLinearRow (const Ogre::Vector3 &pt0, const Ogre::Vector3 &pt1, const Ogre::Vector3 &dir) const |
void | addAngularRow (Ogre::Radian relativeAngleError, const Ogre::Vector3 &dir) const |
void | addGeneralRow (const Ogre::Vector3 &linear0, const Ogre::Vector3 &angular0, const Ogre::Vector3 &linear1, const Ogre::Vector3 &angular1) const |
void | setRowMinimumFriction (Ogre::Real friction) const |
void | setRowMaximumFriction (Ogre::Real friction) const |
void | setRowStiffness (Ogre::Real stiffness) const |
void | setRowAcceleration (Ogre::Real accel) const |
void | setRowSpringDamper (Ogre::Real springK, Ogre::Real springD) const |
void | SetSupportJoint (CustomJoint *supportJoint) |
SetSupportJoint. | |
CustomJoint * | GetSupportJoint () const |
GetSupportJoint. | |
Static Protected Member Functions inherited from OgreNewt::Joint | |
static void _CDECL | destructorCallback (const CustomJoint *me) |
joint destructor callback glue | |
static void _CDECL | submitConstraintCallback (const CustomJoint *me, dFloat timestep, int threadIndex) |
submintContraint | |
hinge joint.
simple hinge joint. implement motors/limits through a callback.
Definition at line 144 of file OgreNewt_BasicJoints.h.
|
protected |
Enumerator | |
---|---|
CONSTRAINT_NONE | |
CONSTRAINT_OMEGA | |
CONSTRAINT_ANGLE | |
CONSTRAINT_BRAKE |
Definition at line 207 of file OgreNewt_BasicJoints.h.
OgreNewt::Hinge::Hinge | ( | const OgreNewt::Body * | child, |
const OgreNewt::Body * | parent, | ||
const Ogre::Vector3 & | pos, | ||
const Ogre::Vector3 & | pin | ||
) |
constructor
child | pointer to the child rigid body. |
parent | pointer to the parent rigid body. pass NULL to make the world itself the parent (aka a rigid joint) |
pin | direction of the joint pin in global space |
Definition at line 278 of file OgreNewt_BasicJoints.cpp.
OgreNewt::Hinge::~Hinge | ( | ) |
destructor
Definition at line 306 of file OgreNewt_BasicJoints.cpp.
|
inline |
clears the motor constraints
Definition at line 202 of file OgreNewt_BasicJoints.h.
void OgreNewt::Hinge::enableLimits | ( | bool | state | ) |
enable hinge limits.
Definition at line 311 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::enableMotor | ( | bool | state | ) |
Definition at line 320 of file OgreNewt_BasicJoints.cpp.
Ogre::Radian OgreNewt::Hinge::getJointAngle | ( | ) | const |
get the relative joint angle around the hinge pin.
Definition at line 415 of file OgreNewt_BasicJoints.cpp.
Ogre::Radian OgreNewt::Hinge::getJointAngularVelocity | ( | ) | const |
get the relative joint angle around the hinge pin.
Definition at line 435 of file OgreNewt_BasicJoints.cpp.
Ogre::Vector3 OgreNewt::Hinge::getJointForce | ( | ) |
retrieve the current joint force.
This can be used to find the "stress" on the joint. you can do special effects like break the joint if the force exceedes some value, etc.
Definition at line 421 of file OgreNewt_BasicJoints.cpp.
Ogre::Vector3 OgreNewt::Hinge::getJointPin | ( | ) | const |
get the joint pin in global space
Definition at line 443 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::setBrake | ( | Ogre::Real | maxForce = 0 | ) |
apply hinge brake for one frame.
Definition at line 402 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::setDesiredAngle | ( | Ogre::Radian | angle, |
Ogre::Real | minFriction = 0 , |
||
Ogre::Real | maxFriction = 0 |
||
) |
set desired angle and optionally minimum and maximum friction
Definition at line 378 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::setDesiredOmega | ( | Ogre::Radian | omega, |
Ogre::Real | strength = 0.5f |
||
) |
sets desired rotational velocity of the joint
Definition at line 345 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::setLimits | ( | Ogre::Radian | minAngle, |
Ogre::Radian | maxAngle | ||
) |
set minimum and maximum hinge limits.
Definition at line 330 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Hinge::setTorque | ( | Ogre::Real | torque | ) |
sets hinge torque
torque can be applied at the same time as other constraints (omega/angle/brake)
torque | torque to apply |
Definition at line 364 of file OgreNewt_BasicJoints.cpp.
|
virtual |
must be define for a functioning joint.
Reimplemented from OgreNewt::Joint.
Definition at line 451 of file OgreNewt_BasicJoints.cpp.
|
protected |
Definition at line 224 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 209 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 213 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 212 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 210 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 218 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 217 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 223 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 222 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 220 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 221 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 226 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 215 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 216 of file OgreNewt_BasicJoints.h.