Joint Class Reference
#include <Joints.h>
Inherited by BallJoint, Hinge2Joint, HingeJoint, SliderJoint, and UniversalJoint.

Public Member Functions | |
| Joint () | |
| Joint (dWorldID world) | |
| virtual | ~Joint () |
| virtual void | setMainEntity (int id) |
| virtual void | setEntities (int id1, int id2) |
| virtual void | getEntities (int &id1, int &id2) |
| virtual void | setWorld (dWorldID world) |
| virtual void | setJointInteractionClass (JointInteraction *jointInteraction) |
| virtual void | getMemberValue (std::string type, void *result)=0 |
| virtual void | setMemberValue (std::string type, void *source)=0 |
| virtual void | debugOutput () |
| void | attach () |
| void | detach () |
| void | setId (int id) |
| int | getId () |
| void | setActive (int isActive) |
| bool | isActive () |
| void | addConstraint (Constraint *constraint) |
| void | checkConstraints () |
Protected Member Functions | |
| virtual void | attachJoint (dBodyID obj1, dBodyID obj2)=0 |
| virtual void | detachJoint ()=0 |
Protected Attributes | |
| int | jointID |
| int | entityID1 |
| int | entityID2 |
| bool | alreadyAttached |
| bool | active |
| dWorldID | world |
| dJointID | joint |
| Entity * | mainEntity |
| JointInteraction * | jointInteraction |
| std::vector< Constraint * > | constraints |
Detailed Description
This class is the super-class of all Joints. It contains all general methods and fields. Every new Joint simply has to implement the methods attachJoint, detachJoint and getMemberValue.Constructor & Destructor Documentation
| Joint::Joint | ( | ) |
| Joint::Joint | ( | dWorldID | world | ) |
| Joint::~Joint | ( | ) | [virtual] |
Member Function Documentation
| void Joint::addConstraint | ( | Constraint * | constraint | ) |
This method adds a Constraint to the constraint-list.
- Parameters:
-
constraint new Constraint to add
| void Joint::attach | ( | ) |
| virtual void Joint::attachJoint | ( | dBodyID | obj1, | |
| dBodyID | obj2 | |||
| ) | [protected, pure virtual] |
Implemented in HingeJoint, BallJoint, SliderJoint, UniversalJoint, and Hinge2Joint.
| void Joint::checkConstraints | ( | ) |
This method checks all Constraints in the constraint-list.
| virtual void Joint::debugOutput | ( | ) | [inline, virtual] |
| void Joint::detach | ( | ) |
| virtual void Joint::detachJoint | ( | ) | [protected, pure virtual] |
Implemented in HingeJoint, BallJoint, SliderJoint, UniversalJoint, and Hinge2Joint.
| void Joint::getEntities | ( | int & | id1, | |
| int & | id2 | |||
| ) | [virtual] |
This method returns the IDs of the connected objects.
- Parameters:
-
id1,id2 IDs of the connected EntityTransforms
| int Joint::getId | ( | ) |
This method returns the ID of the joint.
- Returns:
- the Joint's ID
| virtual void Joint::getMemberValue | ( | std::string | type, | |
| void * | result | |||
| ) | [pure virtual] |
Implemented in HingeJoint, BallJoint, SliderJoint, UniversalJoint, and Hinge2Joint.
| bool Joint::isActive | ( | ) |
| void Joint::setActive | ( | int | isActive | ) |
This method is used for activating or deactivating the Joint. If the Joint was inactive and should be activated the fixed ODE-joint is removed and the virtual attachJoint-method is called. If the Joint was active and should be deactivated the virtual detachJoint-method is called and then a fixed ODE-joint is created and attached to the bodies.
- Parameters:
-
isActive 0 .. not active anything else .. active
| void Joint::setEntities | ( | int | id1, | |
| int | id2 | |||
| ) | [virtual] |
This method sets the IDs of the EntityTransforms which should be connected by the Joint. If one ID is 0 it meens, that the other EntityTransform is connected to the fixed world.
- Parameters:
-
id1,id2 IDs of the EntityTransforms which should be connected
| void Joint::setId | ( | int | id | ) |
This method sets the ID of the Joint
- Parameters:
-
id the Joint's ID
| void Joint::setJointInteractionClass | ( | JointInteraction * | jointInteraction | ) | [virtual] |
| void Joint::setMainEntity | ( | int | id | ) | [virtual] |
This method sets the main EntityTransform, where the Joint should be attached to.
- Parameters:
-
id 1 for the first EntityTransform, 2 for the second one
Reimplemented in HingeJoint.
| virtual void Joint::setMemberValue | ( | std::string | type, | |
| void * | source | |||
| ) | [pure virtual] |
Implemented in HingeJoint, BallJoint, SliderJoint, UniversalJoint, and Hinge2Joint.
| void Joint::setWorld | ( | dWorldID | world | ) | [virtual] |
This method sets the ODE-worldID. This is needed for the creation of ODE-joints.
- Parameters:
-
world ODE-worldID
Member Data Documentation
bool Joint::active [protected] |
bool Joint::alreadyAttached [protected] |
std::vector<Constraint*> Joint::constraints [protected] |
int Joint::entityID1 [protected] |
int Joint::entityID2 [protected] |
dJointID Joint::joint [protected] |
int Joint::jointID [protected] |
JointInteraction* Joint::jointInteraction [protected] |
Entity* Joint::mainEntity [protected] |
dWorldID Joint::world [protected] |
The documentation for this class was generated from the following files:
- src/inVRs/Modules/JointInteraction/Joints.h
- src/inVRs/Modules/JointInteraction/Joints.cpp
Generated on Wed Oct 20 16:11:57 2010 for inVRs by
1.5.8