SO3Engine
|
this class represents a Universal joint. More...
#include <OgreNewt_BasicJoints.h>
Public Types | |
typedef void(* | UniversalCallback) (Universal *me) |
custom universal callback function. | |
Public Member Functions | |
Universal (const World *world, const OgreNewt::Body *child, const OgreNewt::Body *parent, const Ogre::Vector3 &pos, const Ogre::Vector3 &pin0, const Ogre::Vector3 &pin1) | |
constructor | |
~Universal () | |
destructor | |
Ogre::Radian | getJointAngle0 () const |
get the angle around pin0. | |
Ogre::Radian | getJointAngle1 () const |
get the angle around pin1. | |
Ogre::Real | getJointOmega0 () const |
get the rotational velocity around pin0. | |
Ogre::Real | getJointOmega1 () const |
get the rotational velocity around pin1. | |
Ogre::Vector3 | getJointForce () const |
get the force on the joint. | |
void | setCallback (UniversalCallback callback) |
set a custom callback for controlling this joint. | |
void | setCallbackAccel (Ogre::Real accel, unsigned axis) |
set the acceleration around a particular pin. | |
void | setCallbackFrictionMin (Ogre::Real min, unsigned axis) |
set the minimum friction around a particular pin | |
void | setCallbackFrictionMax (Ogre::Real max, unsigned axis) |
set the maximum friction around a particular pin. | |
Ogre::Real | getCallbackTimestep () const |
get the current phsics timestep. | |
Ogre::Real | calculateStopAlpha0 (Ogre::Real angle) const |
calculate the acceleration neccesary to stop the joint at the specified angle on pin 0. | |
Ogre::Real | calculateStopAlpha1 (Ogre::Real angle) const |
calculate the acceleration neccesary to stop the joint at the specified angle on pin 1. | |
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 | submitConstraint (Ogre::Real timeStep, int threadIndex) |
must be define for a functioning joint. | |
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 | |
Static Protected Member Functions | |
static unsigned _CDECL | newtonCallback (const NewtonJoint *universal, NewtonHingeSliderUpdateDesc *desc) |
newton callback. used internally. | |
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 | |
Protected Attributes | |
UniversalCallback | m_callback |
NewtonHingeSliderUpdateDesc * | m_desc |
unsigned | m_retval |
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. | |
this class represents a Universal joint.
simple universal joint. implement motors/limits through a callback.
Definition at line 329 of file OgreNewt_BasicJoints.h.
typedef void(* OgreNewt::Universal::UniversalCallback) (Universal *me) |
custom universal callback function.
use the setCallback() function to assign your custom function to the joint.
Definition at line 338 of file OgreNewt_BasicJoints.h.
OgreNewt::Universal::Universal | ( | const World * | world, |
const OgreNewt::Body * | child, | ||
const OgreNewt::Body * | parent, | ||
const Ogre::Vector3 & | pos, | ||
const Ogre::Vector3 & | pin0, | ||
const Ogre::Vector3 & | pin1 | ||
) |
constructor
world | pointer to the OgreNewt::World |
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) |
pos | position of the joint in global space |
pin0 | direction of the first axis of rotation in global space |
pin1 | direction of the second axis of rotation in global space |
Definition at line 928 of file OgreNewt_BasicJoints.cpp.
OgreNewt::Universal::~Universal | ( | ) |
destructor
Definition at line 950 of file OgreNewt_BasicJoints.cpp.
Ogre::Real OgreNewt::Universal::calculateStopAlpha0 | ( | Ogre::Real | angle | ) | const |
calculate the acceleration neccesary to stop the joint at the specified angle on pin 0.
For implementing joint limits. This command is only valid when used inside a custom callback.
Definition at line 1021 of file OgreNewt_BasicJoints.cpp.
Ogre::Real OgreNewt::Universal::calculateStopAlpha1 | ( | Ogre::Real | angle | ) | const |
calculate the acceleration neccesary to stop the joint at the specified angle on pin 1.
For implementing joint limits. This command is only valid when used inside a custom callback.
Definition at line 1029 of file OgreNewt_BasicJoints.cpp.
Ogre::Real OgreNewt::Universal::getCallbackTimestep | ( | ) | const |
get the current phsics timestep.
Definition at line 1013 of file OgreNewt_BasicJoints.cpp.
|
inline |
get the angle around pin0.
Definition at line 355 of file OgreNewt_BasicJoints.h.
|
inline |
get the angle around pin1.
Definition at line 358 of file OgreNewt_BasicJoints.h.
Ogre::Vector3 OgreNewt::Universal::getJointForce | ( | ) | const |
get the force on the joint.
Definition at line 954 of file OgreNewt_BasicJoints.cpp.
|
inline |
get the rotational velocity around pin0.
Definition at line 361 of file OgreNewt_BasicJoints.h.
|
inline |
get the rotational velocity around pin1.
Definition at line 364 of file OgreNewt_BasicJoints.h.
|
staticprotected |
newton callback. used internally.
Definition at line 963 of file OgreNewt_BasicJoints.cpp.
|
inline |
set a custom callback for controlling this joint.
Joint callbacks allow you to make complex joint behavior such as limits or motors. just make a custom static function that accepts a pointer to a OgreNewt::BasicJoints::Universal as the single parameter. this function will be called automatically every time you upate the World.
Definition at line 375 of file OgreNewt_BasicJoints.h.
void OgreNewt::Universal::setCallbackAccel | ( | Ogre::Real | accel, |
unsigned | axis | ||
) |
set the acceleration around a particular pin.
Definition at line 980 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Universal::setCallbackFrictionMax | ( | Ogre::Real | max, |
unsigned | axis | ||
) |
set the maximum friction around a particular pin.
Definition at line 991 of file OgreNewt_BasicJoints.cpp.
void OgreNewt::Universal::setCallbackFrictionMin | ( | Ogre::Real | min, |
unsigned | axis | ||
) |
set the minimum friction around a particular pin
Definition at line 1002 of file OgreNewt_BasicJoints.cpp.
|
protected |
Definition at line 429 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 430 of file OgreNewt_BasicJoints.h.
|
protected |
Definition at line 432 of file OgreNewt_BasicJoints.h.