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

OgreRefApp::Hinge2Joint Class Reference

Implementation of hinge2 joint. More...

#include <OgreRefAppJointSubtypes.h>

Inheritance diagram for OgreRefApp::Hinge2Joint:

OgreRefApp::Joint 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

 Hinge2Joint (Joint::JointType jtype, ApplicationObject *obj1, ApplicationObject *obj2)
 ~Hinge2Joint ()
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 Vector3getAnchorPosition (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 Member Functions

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, Vector3mAxes
dJoint * mOdeJoint

Detailed Description

Implementation of hinge2 joint.

Definition at line 129 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::Hinge2Joint::Hinge2Joint Joint::JointType  jtype,
ApplicationObject obj1,
ApplicationObject obj2
 

OgreRefApp::Hinge2Joint::~Hinge2Joint  ) 
 

Definition at line 133 of file OgreRefAppJointSubtypes.h.


Member Function Documentation

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

Gets the anchor position of this joint.

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

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

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

Gets the axes of this joint.

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

Returns the type of this joint.

void OgreRefApp::Hinge2Joint::setAnchorPosition const Vector3 point  )  [virtual]
 

Set the anchor point of this joint.

Implements OgreRefApp::Joint.

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.

void OgreRefApp::Hinge2Joint::setAxes const Vector3 primaryAxis,
const Vector3 secondaryAxis = Vector3::ZERO
[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.

Implements OgreRefApp::Joint.


Member Data Documentation

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

Definition at line 106 of file OgreRefAppJoint.h.

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

Definition at line 107 of file OgreRefAppJoint.h.

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

Definition at line 108 of file OgreRefAppJoint.h.

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

Definition at line 111 of file OgreRefAppJoint.h.

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

Definition at line 105 of file OgreRefAppJoint.h.


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

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:12:01 2006