Hinge2Joint Class Reference

#include <Joints.h>

Inherits Joint.

Collaboration diagram for Hinge2Joint:

List of all members.


Public Member Functions

 Hinge2Joint ()
virtual ~Hinge2Joint ()
void setAnchor (float anchorX, float anchorY, float anchorZ)
void setAxis1 (float axisX, float axisY, float axisZ)
void setAxis2 (float axisX, float axisY, float axisZ)
virtual void getMemberValue (std::string type, void *result)
virtual void setMemberValue (std::string type, void *source)

Protected Member Functions

virtual void attachJoint (dBodyID obj1, dBodyID obj2)
virtual void detachJoint ()

Protected Attributes

gmtl::Vec3f anchor
gmtl::Vec3f axis1
gmtl::Vec3f axis2
bool usedHelperJoint
dBodyID helperBody
dJointID helperJoint

Detailed Description

This class represents a joint which is built out of 2 HingeJoints (which don't have to be perpendicular). It can be defined by setting the Anchor and the two hinge-Axes. The members helperBody and helperJoint are needed to avoid problems with ODE (v0.5), when a Hinge2-Joint is connected to the static environment. Since ODE always throws a Segmentation Fault in this case i added a helperBody which is put between the Hinge2Joint and the fixed environment.

Constructor & Destructor Documentation

Hinge2Joint::Hinge2Joint (  ) 

virtual Hinge2Joint::~Hinge2Joint (  )  [inline, virtual]


Member Function Documentation

void Hinge2Joint::attachJoint ( dBodyID  obj1,
dBodyID  obj2 
) [protected, virtual]

This method is called if the joint should be attached. It creates the ODE-joint, calculates the current anchor-position and axis-orientation and attaches the Joint.

Parameters:
obj1 first ODE-object to attach with
obj2 second ODE-object to attach with

Implements Joint.

void Hinge2Joint::detachJoint (  )  [protected, virtual]

This method is called if the joint should be detached. It stores the actual Joint-axis, which can change their orientation at Hinge2Joints, and destroys the helper body and joint.

Implements Joint.

void Hinge2Joint::getMemberValue ( std::string  type,
void *  result 
) [virtual]

This method copies the value of the field with the passed name to the result-pointer. It is a little helper to avoid type-casts when accessing joint-pointers.

Parameters:
type name of the field
result destination where the value should be stored

Implements Joint.

void Hinge2Joint::setAnchor ( float  anchorX,
float  anchorY,
float  anchorZ 
)

This method sets the Anchor of the Joint in OBJECT-COORDINATES!!! This means that the Anchor is relative to the position of the main EntityTransform. Take care that the Anchor-offset is also scaled by the scale-Value of the EntityTransform. The reason for using object coordinates is because modelers can easily read the offset out of the modelling application.

Parameters:
anchorX X-position of the Anchor
anchorY Y-position of the Anchor
anchorZ Z-position of the Anchor

void Hinge2Joint::setAxis1 ( float  axisX,
float  axisY,
float  axisZ 
)

This method sets the first Axis of the Joint in OBJECT-COORDINATES!!! This means that the axis is rotated by the rotation-value of the main EntityTransform.

Parameters:
axisX X-value of the Axis
axisY Y-value of the Axis
axisZ Z-value of the Axis

void Hinge2Joint::setAxis2 ( float  axisX,
float  axisY,
float  axisZ 
)

This method sets the second Axis of the Joint in OBJECT-COORDINATES!!! This means that the axis is rotated by the rotation-value of the main EntityTransform.

Parameters:
axisX X-value of the Axis
axisY Y-value of the Axis
axisZ Z-value of the Axis

void Hinge2Joint::setMemberValue ( std::string  type,
void *  source 
) [virtual]

Implements Joint.


Member Data Documentation

gmtl::Vec3f Hinge2Joint::anchor [protected]

gmtl::Vec3f Hinge2Joint::axis1 [protected]

gmtl::Vec3f Hinge2Joint::axis2 [protected]

dBodyID Hinge2Joint::helperBody [protected]

dJointID Hinge2Joint::helperJoint [protected]

bool Hinge2Joint::usedHelperJoint [protected]


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

Generated on Wed Oct 20 16:11:57 2010 for inVRs by doxygen 1.5.8