Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreRefApp::BallJoint Class Reference

Implementation of ball joint. More...

#include <OgreRefAppJointSubtypes.h>

Inheritance diagram for OgreRefApp::BallJoint:

Inheritance graph
[legend]
Collaboration diagram for OgreRefApp::BallJoint:

Collaboration 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 Methods

 BallJoint (Joint::JointType jtype, ApplicationObject *obj1, ApplicationObject *obj2)
 ~BallJoint ()
void setAnchorPosition (const Vector3 &point)
 Set the anchor point of this joint.

void setAxes (const Vector3 &primaryAxis, const Vector3 &secondaryAxis=Vector3::ZERO)
 Sets the axes for this joint.

JointType getType (void)
 Returns the type of this joint.

virtual const Vector3 & getAnchorPosition (void)
 Gets the anchor position of this joint.

virtual const std::pair< ApplicationObject *,
ApplicationObject * > & 
getAttachments (void)
 Gets the attached objects, a NULL means no object ie a static attachment.

virtual const std::pair< Vector3,
Vector3 > & 
getAxes (void)
 Gets the axes of this joint.


Protected Methods

void setAttachments (ApplicationObject *obj1, ApplicationObject *obj2)
 Sets the objects attached to this joint.


Protected Attributes

JointType mType
Vector3 mAnchor
std::pair< ApplicationObject *,
ApplicationObject * > 
mAttachedObjects
std::pair< Vector3, Vector3 > mAxes
dJoint * mOdeJoint

Detailed Description

Implementation of ball joint.

Definition at line 34 of file OgreRefAppJointSubtypes.h.


Member Enumeration Documentation

enum OgreRefApp::Joint::JointType [inherited]
 

The type of joint.

Enumeration values:
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

Definition at line 46 of file OgreRefAppJoint.h.


Constructor & Destructor Documentation

OgreRefApp::BallJoint::BallJoint Joint::JointType    jtype,
ApplicationObject   obj1,
ApplicationObject   obj2
 

Definition at line 31 of file OgreRefAppJointSubtypes.cpp.

References OgreRefApp::Joint::mOdeJoint, and OgreRefApp::Joint::setAttachments().

OgreRefApp::BallJoint::~BallJoint  
 

Definition at line 38 of file OgreRefAppJointSubtypes.h.


Member Function Documentation

const Vector3 & OgreRefApp::Joint::getAnchorPosition void    [virtual, inherited]
 

Gets the anchor position of this joint.

Definition at line 46 of file OgreRefAppJoint.cpp.

References OgreRefApp::Joint::mAnchor.

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

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

Definition at line 73 of file OgreRefAppJoint.cpp.

References OgreRefApp::Joint::mAttachedObjects.

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

Gets the axes of this joint.

Definition at line 79 of file OgreRefAppJoint.cpp.

References OgreRefApp::Joint::mAxes.

Joint::JointType OgreRefApp::Joint::getType void    [inherited]
 

Returns the type of this joint.

Definition at line 41 of file OgreRefAppJoint.cpp.

References OgreRefApp::Joint::mType.

void OgreRefApp::BallJoint::setAnchorPosition const Vector3 &    point [virtual]
 

Set the anchor point of this joint.

Remarks:
Sets the location, in world space, of the anchor point of this joint, which can be the hinge point or just the origin of joint.

Implements OgreRefApp::Joint.

Definition at line 38 of file OgreRefAppJointSubtypes.cpp.

References OgreRefApp::Joint::mAnchor.

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

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.

Definition at line 51 of file OgreRefAppJoint.cpp.

References OgreRefApp::ApplicationObject::getOdeBody(), OgreRefApp::Joint::mAttachedObjects, and OgreRefApp::Joint::mOdeJoint.

Referenced by BallJoint(), OgreRefApp::Hinge2Joint::Hinge2Joint(), OgreRefApp::HingeJoint::HingeJoint(), OgreRefApp::SliderJoint::SliderJoint(), and OgreRefApp::UniversalJoint::UniversalJoint().

void OgreRefApp::BallJoint::setAxes const Vector3 &    primaryAxis,
const Vector3 &    secondaryAxis = Vector3::ZERO
[virtual]
 

Sets the axes for this joint.

Remarks:
Has no meaning for this type of joint, so does nothing.

Implements OgreRefApp::Joint.

Definition at line 50 of file OgreRefAppJointSubtypes.h.


Member Data Documentation

Vector3 OgreRefApp::Joint::mAnchor [protected, inherited]
 

Definition at line 106 of file OgreRefAppJoint.h.

Referenced by OgreRefApp::Joint::getAnchorPosition(), OgreRefApp::Hinge2Joint::setAnchorPosition(), OgreRefApp::UniversalJoint::setAnchorPosition(), OgreRefApp::HingeJoint::setAnchorPosition(), and setAnchorPosition().

std::pair<ApplicationObject*, ApplicationObject*> OgreRefApp::Joint::mAttachedObjects [protected, inherited]
 

Definition at line 107 of file OgreRefAppJoint.h.

Referenced by OgreRefApp::Joint::getAttachments(), and OgreRefApp::Joint::setAttachments().

std::pair<Vector3, Vector3> OgreRefApp::Joint::mAxes [protected, inherited]
 

Definition at line 108 of file OgreRefAppJoint.h.

Referenced by OgreRefApp::Joint::getAxes(), OgreRefApp::Joint::Joint(), OgreRefApp::Hinge2Joint::setAxes(), OgreRefApp::UniversalJoint::setAxes(), OgreRefApp::HingeJoint::setAxes(), and OgreRefApp::SliderJoint::setAxes().

dJoint* OgreRefApp::Joint::mOdeJoint [protected, inherited]
 

Definition at line 111 of file OgreRefAppJoint.h.

Referenced by BallJoint(), OgreRefApp::Hinge2Joint::Hinge2Joint(), OgreRefApp::HingeJoint::HingeJoint(), OgreRefApp::Joint::setAttachments(), OgreRefApp::SliderJoint::SliderJoint(), and OgreRefApp::UniversalJoint::UniversalJoint().

JointType OgreRefApp::Joint::mType [protected, inherited]
 

Definition at line 105 of file OgreRefAppJoint.h.

Referenced by OgreRefApp::Joint::getType().


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

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:21:41 2004