V-ART
|
Representation of joints. More...
#include <joint.h>
Public Types | |
enum | DofID { FLEXION, ADDUCTION, TWIST } |
Public Types inherited from VART::SceneNode | |
enum | TypeID { NONE, GRAPHIC_OBJ, BOX, CONE, CURVE, BEZIER, CYLINDER, IMAGE, IMAGE_2D, VOLUME, MESH_OBJECT, SPHERE, JOINT, BIAXIAL_JOINT, CONDYLAR_JOINT, ELLIPSOID_JOINT, SADDLE_JOINT, PLANE_JOINT, POLYAXIAL_JOINT, UNIAXIAL_JOINT, HINGE_JOINT, PIVOT_JOINT, TRANSFORM } |
Public Member Functions | |
Joint () | |
Creates an uninitialized joint. More... | |
Joint (const Joint &j) | |
virtual | ~Joint () |
virtual VART::SceneNode * | Copy () |
Returns a copy of a Joint. Every derived class must reimplement this method, to avoid errors with VART::SceneNode::RecursiveCopy. More... | |
virtual void | CopyDofListFrom (VART::Joint &joint) |
Copy the dofList atribute from an joint, setting the ownerJoint atribute of copied dof to 'this' joint instance. More... | |
const Joint & | operator= (const Joint &j) |
unsigned short int | GetNumDofs () const |
virtual Dof * | AddDof (const Point4D &vec, const Point4D &pos, float min, float max) |
Adds a Dof. More... | |
virtual void | AddDof (Dof *dof) |
Adds a Dof. More... | |
void | MakeLim () |
Updates the LIM, based on DOFs' situation. More... | |
const Dof & | GetDof (DofID dof) const |
Returns a joint's DOF. More... | |
void | GetDofs (std::list< Dof * > *dofListPtr) |
Returns all DOFs. More... | |
DofID | GetDofID (const Dof *dofPtr) const |
Returns the DofID of some member Dof. More... | |
void | SetAtRest () |
Put the joint in a rest position. More... | |
bool | MoveDof (DofID dof, float variance) |
Moves a joint's DOF. More... | |
bool | HasDof (DofID dof) |
Checks whether a DOF exists in the joint. More... | |
virtual TypeID | GetID () |
Returns type identification of the node. More... | |
virtual void | XmlPrintOn (std::ostream &os, unsigned int indent) const |
Outputs XML representation of the scene. More... | |
Public Member Functions inherited from VART::Transform | |
Transform () | |
Creates an uninitialized transform. More... | |
Transform (const Transform &trans) | |
Copy constructor. More... | |
void | MakeIdentity () |
Turns transform into identity. More... | |
Point4D | operator* (const Point4D &point) const |
Applies transformation to a point. More... | |
Transform | operator* (const Transform &t) const |
Applies transformation to another transform. More... | |
Transform & | operator= (const Transform &t) |
Copies data from anoter transform. More... | |
void | Apply (const Transform &t) |
Applies a transformation to itself. More... | |
void | ApplyTo (Point4D *ptPoint) const |
Applies tranformation to a point. More... | |
void | MakeTranslation (const Point4D &translationVector) |
Turns transform into a translation. More... | |
void | MakeTranslation (double tx, double ty, double tz) |
Turns transform into a translation. More... | |
void | MakeXRotation (double radians) |
Turns transform into a rotation around the X axis. More... | |
void | MakeYRotation (double radians) |
Turns transform into a rotation around the Y axis. More... | |
void | MakeZRotation (double radians) |
Turns transform into a rotation around the Z axis. More... | |
void | MakeRotation (const Point4D &refVec, const float radians) |
Turns transform into a rotation (around some reference vetor). More... | |
void | MakeRotation (const Point4D &refPoint, const Point4D &refVec, const float radians) |
Turns transform into a rotation (around some reference axis). More... | |
void | MakeScale (double sX, double sY, double sZ) |
Turns transform into a scale. More... | |
void | MakeShear (double shX, double shY) |
Turns transform into a shear. More... | |
void | SetData (double *data) |
Set all data in the transform. More... | |
const double * | GetData () const |
Returns the address of transformation matrix. More... | |
void | GetVectorX (Point4D *result) const |
Returns the X vector of the transform. More... | |
void | GetVectorY (Point4D *result) const |
Returns the Y vector of the transform. More... | |
void | GetVectorZ (Point4D *result) const |
Returns the Z vector of the transform. More... | |
void | GetTranslation (Point4D *result) const |
Returns the translation part of the transform. More... | |
bool | HasNaN () const |
Check for NaNs inside the matrix. More... | |
virtual bool | DrawOGL () const |
Apply transform to rendering engine. More... | |
virtual void | DrawForPicking () const |
Draws and object, setting pick info. More... | |
virtual TypeID | GetID () const |
Returns type identification of the node. More... | |
virtual bool | RecursiveBoundingBox (BoundingBox *bBox) |
Returns the recursive bounding box. More... | |
void | ToggleRecVisibility () |
Toggles the recursive object's visibility. More... | |
void | CopyMatrix (const Transform &t) |
Copies matrix data from another transform. More... | |
Public Member Functions inherited from VART::SceneNode | |
SceneNode () | |
Creates an uninitialized scene node. More... | |
SceneNode (SceneNode &node) | |
virtual | ~SceneNode () |
SceneNode & | operator= (const SceneNode &node) |
virtual SceneNode * | RecursiveCopy () |
const std::string & | GetDescription () const |
Returns a copy of the object's description. More... | |
void | SetDescription (const std::string &desc) |
Changes the object's description. More... | |
void | AddChild (SceneNode &child) |
Add a child at the end of child list. More... | |
bool | DetachChild (SceneNode *childPtr) |
Removes a child from the child list. More... | |
void | AutoDeleteChildren () const |
Deletes (dealocate memory) recursively all children marked as 'autoDelete'. More... | |
SceneNode * | FindChildByName (const std::string &name) const |
Recusively searches its children for a given name. More... | |
std::list< SceneNode * > | GetChilds () |
bool | FindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const |
Search target among children. More... | |
bool | FindPathTo (const std::string &targetName, SGPath *resultPtr) const |
Search target among children. More... | |
int | GetNodeTypeList (TypeID type, std::list< SceneNode * > &nodeList) |
Find all the nodes of with typeID 'type'. More... | |
virtual void | TraverseDepthFirst (SNOperator *operatorPtr) const |
Process all children in depth-first order. More... | |
virtual void | TraverseBreadthFirst (SNOperator *operatorPtr) const |
Process all children in breadth-first order. More... | |
virtual void | LocateDepthFirst (SNLocator *locatorPtr) const |
Seaches for a particular scene node (depth first) More... | |
virtual void | LocateBreadthFirst (SNLocator *locatorPtr) const |
Seaches for a particular scene node (breadth first) More... | |
Public Member Functions inherited from VART::MemoryObj | |
MemoryObj () | |
Default constructor. More... | |
MemoryObj (const VART::MemoryObj &obj) | |
Copy constructor. More... | |
Protected Attributes | |
std::list< Dof * > | dofList |
Protected Attributes inherited from VART::Transform | |
double | matrix [16] |
Protected Attributes inherited from VART::SceneNode | |
std::list< SceneNode * > | childList |
Child list. More... | |
std::string | description |
Textual identification. More... | |
Additional Inherited Members | |
Public Attributes inherited from VART::MemoryObj | |
bool | autoDelete |
Static Public Attributes inherited from VART::SceneNode | |
static bool | recursivePrinting = true |
Protected Member Functions inherited from VART::SceneNode | |
virtual bool | DrawInstanceOGL () const |
Non-recursive drawing - should be overriden by every derived class. More... | |
bool | RecursiveFindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const |
Recursive auxiliar method for FindPathTo. More... | |
bool | RecursiveFindPathTo (const std::string &targetName, SGPath *resultPtr) const |
Recursive auxiliar method for FindPathTo. More... | |
Representation of joints.
A joint can be seen as a special kind of geometric transformation. It deals with the complexities of real articulations, producing geometric transformations that can be delivered to the graphics pipeline. A joint is a collecion of DOFs (see Dof) in which their order is important - the transformation of a joint is (... DOF3 * DOF2 * DOF1), that is, DOF1's transform, followed by DOF2's transform... In the current implementation, when DOFs change, their hierarchically inferior DOFs are transformed, that is, on a 3-DOF joint, changing the 2nd DOF tranforms the 3rd DOF. Their order is defined by AddDof method. On future implementations this should change to allow creation of more sophisticated joints. Joints may not share DOFs, see Dof for an explanation. Compile with symbol VISUAL_JOINTS if you want to see DOFs for debugging purposes.
enum VART::Joint::DofID |
|
virtual |
Adds a Dof.
vec | [in] A vector. Together with "pos", defines the rotation axis of the new Dof. |
pos | [in] A point. Together with "vec", defines the roatation axis of the new Dof. |
min | [in] An angle (radians). Minimal allowed rotation. |
max | [in] An angle (radians). Maximal allowed rotation. |
Creates a new Dof with given parameters. Attaches the Dof to itself. The memory will be released upon Joint destruction.
Reimplemented in VART::UniaxialJoint.
Definition at line 69 of file joint.cpp.
References VART::Dof::SetOwnerJoint().
Referenced by VART::PolyaxialJoint::AddDof(), and VART::BiaxialJoint::AddDof().
|
virtual |
Adds a Dof.
Reimplemented in VART::BiaxialJoint, VART::UniaxialJoint, and VART::PolyaxialJoint.
Definition at line 77 of file joint.cpp.
References VART::Dof::SetOwnerJoint().
|
virtual |
Returns a copy of a Joint. Every derived class must reimplement this method, to avoid errors with VART::SceneNode::RecursiveCopy.
Reimplemented from VART::Transform.
Reimplemented in VART::UniaxialJoint, VART::PolyaxialJoint, and VART::BiaxialJoint.
Definition at line 28 of file joint.cpp.
References CopyDofListFrom().
|
virtual |
Copy the dofList atribute from an joint, setting the ownerJoint atribute of copied dof to 'this' joint instance.
Definition at line 37 of file joint.cpp.
References dofList, and VART::Dof::SetOwnerJoint().
Referenced by VART::BiaxialJoint::Copy(), VART::PolyaxialJoint::Copy(), VART::UniaxialJoint::Copy(), and Copy().
VART::Joint::DofID VART::Joint::GetDofID | ( | const Dof * | dofPtr | ) | const |
Returns the DofID of some member Dof.
Definition at line 127 of file joint.cpp.
Referenced by VART::JointMover::CopyFrom(), and VART::OffsetModifier::Modify().
void VART::Joint::GetDofs | ( | std::list< Dof * > * | dofListPtr | ) |
Returns all DOFs.
Adds pointers to all DOFs to the given list.
Definition at line 113 of file joint.cpp.
Referenced by VART::IKChain::IKChain().
|
inlinevirtual |
Returns type identification of the node.
Definition at line 102 of file joint.h.
References VART::SceneNode::JOINT.
|
inline |
bool VART::Joint::HasDof | ( | DofID | dof | ) |
void VART::Joint::MakeLim | ( | ) |
bool VART::Joint::MoveDof | ( | DofID | dof, |
float | variance | ||
) |
const VART::Joint & VART::Joint::operator= | ( | const Joint & | j | ) |
void VART::Joint::SetAtRest | ( | ) |
|
virtual |
Outputs XML representation of the scene.
Reimplemented from VART::SceneNode.
|
protected |
Definition at line 118 of file joint.h.
Referenced by CopyDofListFrom(), VART::PolyaxialJoint::Flex(), VART::BiaxialJoint::Flex(), VART::UniaxialJoint::Flex(), GetNumDofs(), and operator=().