OgreRefApp::Joint Class Reference

#include <OgreRefAppJoint.h>

Inheritance diagram for OgreRefApp::Joint:

Inheritance graph
[legend]

List of all members.

Public Types

enum  JointType {
  JT_BALL, JT_SLIDER, JT_HINGE, JT_UNIVERSAL,
  JT_HINGE2
}
 The type of joint. More...

Public Member Functions

 Joint (JointType jtype)
JointType getType (void)
virtual void setAnchorPosition (const Vector3 &point)=0
virtual const Vector3 & getAnchorPosition (void)
virtual const std::pair
< ApplicationObject
*, ApplicationObject * > & 
getAttachments (void)
virtual void setAxes (const Vector3 &primaryAxis, const Vector3 &secondaryAxis=Vector3::ZERO)=0
virtual const std::pair
< Vector3, Vector3 > & 
getAxes (void)

Protected Member Functions

void setAttachments (ApplicationObject *obj1, ApplicationObject *obj2)


Detailed Description

Represents a linkage between application objects or between them and the world, enforcing certain constraints.
Remarks:
Joints can be used to link application objects together, or to link them to a static point in the world according to certain constraints. You should create joints using World::createJoint. You should then set certain global options, like it's world anchor position, before attaching it to application objects. You application objects should already be positioned how you would like relative to the joint anchor, since once they are attached, they will be constrained by it.

Member Enumeration Documentation

The type of joint.

Enumerator:
JT_BALL  Ball & socket joint, has 3 degrees of freedom.
JT_SLIDER  Sliding joint, 1 degree of freedom (in-out).
JT_HINGE  Hinge joint, 1 degree of freedom.
JT_UNIVERSAL  Universal joint, like a double-hinge, 2 degrees of freedom.
JT_HINGE2  2 hinges in series, like the axel of a car


Constructor & Destructor Documentation

OgreRefApp::Joint::Joint ( Joint::JointType  jtype  ) 

Constructor, however you should use World::createJoint(type, obj1, obj2).


Member Function Documentation

Joint::JointType OgreRefApp::Joint::getType ( void   ) 

Returns the type of this joint.

virtual void OgreRefApp::Joint::setAnchorPosition ( const Vector3 &  point  )  [pure virtual]

Set the anchor point of this joint.

Remarks:
Sets the location, in world space, of the anchor point of this joint, which is usually the hinge point or just the origin of joint. It has no meaning for JT_SLIDER and thus you don't need to call it for that.

Implemented in OgreRefApp::BallJoint, OgreRefApp::SliderJoint, OgreRefApp::HingeJoint, OgreRefApp::UniversalJoint, and OgreRefApp::Hinge2Joint.

const Vector3 & OgreRefApp::Joint::getAnchorPosition ( void   )  [virtual]

Gets the anchor position of this joint.

const std::pair< ApplicationObject *, ApplicationObject * > & OgreRefApp::Joint::getAttachments ( void   )  [virtual]

Gets the attached objects, a NULL means no object ie a static attachment.

virtual void OgreRefApp::Joint::setAxes ( const Vector3 &  primaryAxis,
const Vector3 &  secondaryAxis = Vector3::ZERO 
) [pure virtual]

Sets the axes for this joint.

Remarks:
The meaning of axes for a joint depends on it's type:
  • For JT_BALL, it has no meaning and you don't need to call it.
  • For JT_SLIDER, only one is applicable and it's the axis along which the slide occurs.
  • For JT_HINGE, only one is applicable and it's the hinge axis.
  • For JT_UNIVERSAL, and JT_HINGE2 it's the 2 hinge axes.

Implemented in OgreRefApp::BallJoint, OgreRefApp::SliderJoint, OgreRefApp::HingeJoint, OgreRefApp::UniversalJoint, and OgreRefApp::Hinge2Joint.

const std::pair< Vector3, Vector3 > & OgreRefApp::Joint::getAxes ( void   )  [virtual]

Gets the axes of this joint.

void OgreRefApp::Joint::setAttachments ( ApplicationObject obj1,
ApplicationObject obj2 
) [protected]

Sets the objects attached to this joint.

Remarks:
It appears that this has to be set before other joint params like anchor etc, otherwise the joint does not behave. Therefore it is internal and is called during construction.


The documentation for this class was generated from the following files:

Generated on Sun Jun 15 18:43:30 2008 for SpadeShip Project by  doxygen 1.5.5