H3D API  2.4.1
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
H3D::HAnimJoint Class Reference

The HAnimJoint object is the fundamental building block that represents body parts. More...

#include <H3D/HAnimJoint.h>

Inheritance diagram for H3D::HAnimJoint:
Inheritance graph

Public Types

enum  RenderType { JOINTS , SKELETON }
 Settings for how to render joints. More...
 
typedef DependentMFNode< HAnimDisplacer, FieldRef< X3DGeometricPropertyNode, Field, &HAnimDisplacer::propertyChanged > > MFDisplacer
 The MFDisplacer is dependent on the propertyChanged field of the contained HAnimDisplacer.
 
- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 

Public Member Functions

 HAnimJoint (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< SFVec3f > _center=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFRotation > _rotation=0, Inst< SFVec3f > _scale=0, Inst< SFRotation > _scaleOrientation=0, Inst< SFVec3f > _translation=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFTransformedBound > _transformedBound=0, Inst< Matrix > _matrix=0, Inst< SFMatrix4f > _accumulatedForward=0, Inst< SFMatrix4f > _accumulatedInverse=0, Inst< MFDisplacer > _displacers=0, Inst< SFRotation > _limitOrientation=0, Inst< MFFloat > _llimit=0, Inst< MFFloat > _ulimit=0, Inst< SFString > _name=0, Inst< MFInt32 > _skinCoordIndex=0, Inst< MFFloat > _skinCoordWeight=0, Inst< MFFloat > _stiffness=0)
 Constructor.
 
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.
 
void renderSkeleton (RenderType type)
 Render the joints and skeleton with OpenGL with the specified type.
 
- Public Member Functions inherited from H3D::Transform
 Transform (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< SFVec3f > _center=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFRotation > _rotation=0, Inst< SFVec3f > _scale=0, Inst< SFRotation > _scaleOrientation=0, Inst< SFVec3f > _translation=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFTransformedBound > _transformedBound=0, Inst< Matrix > _matrix=0, Inst< SFMatrix4f > _accumulatedForward=0, Inst< SFMatrix4f > _accumulatedInverse=0)
 Constructor.
 
virtual void render ()
 Render the children.
 
- Public Member Functions inherited from H3D::MatrixTransform
 MatrixTransform (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFTransformedBound > _transformedBound=0, Inst< SFMatrix4f > _matrix=0, Inst< SFMatrix4f > _accumulatedForward=0, Inst< SFMatrix4f > _accumulatedInverse=0)
 Constructor.
 
void multiplyGLMatrix ()
 Multiply the currently active OpenGL matrix with the matrix of this node.
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and this Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
- Public Member Functions inherited from H3D::X3DGroupingNode
 X3DGroupingNode (Inst< AddChildren > _addChildren=0, Inst< RemoveChildren > _removeChildren=0, Inst< MFChild > _children=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0)
 Constructor.
 
virtual ~X3DGroupingNode ()
 Destructor.
 
virtual void initialize ()
 Sets up the bound field using the bboxCenter and bboxSize fields. More...
 
- Public Member Functions inherited from H3D::X3DChildNode
 X3DChildNode (Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
- Public Member Functions inherited from H3D::H3DBoundedObject
 H3DBoundedObject (Inst< SFBound > _bound=0)
 Constructor.
 
- Public Member Functions inherited from H3D::H3DDisplayListObject
 H3DDisplayListObject (Inst< DisplayList > _displayList=0)
 Constructor.
 

Public Attributes

H3DUniquePtr< MFDisplacerdisplacers
 The displacers field contains a list of HAnimDisplacer objects that are used to morph the deformable mesh using the morph targets defined in the Displacer objects. More...
 
H3DUniquePtr< SFRotationlimitOrientation
 The limitOrientation field gives the orientation of the coordinate frame in which the ulimit and llimit values are to be interpreted. More...
 
H3DUniquePtr< MFFloatllimit
 The llimit fields of the HAnimJoint object specify the lower joint rotation limits. More...
 
H3DUniquePtr< MFFloatulimit
 The ulimit fields of the HAnimJoint object specify the upper joint rotation limits. More...
 
H3DUniquePtr< SFStringname
 The name field contains a name that is used for identifying the object. More...
 
H3DUniquePtr< MFInt32skinCoordIndex
 The skinCoordIndex field contains a list of indices into the skinCoord field of the HAnimHumanoid object defining the coordinates to be influenced by this joint. More...
 
H3DUniquePtr< MFFloatskinCoordWeight
 The skinCoordWeight field contains a list of floating point values between 0.0 and 1.0 that describe an amount of weighting that should be used to affect a particular vertex from the skinCoord field of the HAnimHumanoid object. More...
 
H3DUniquePtr< MFFloatstiffness
 The stiffness field, if present, contains values ranging between 0.0 and 1.0 that provide an inverse kinematics system how much each degree of freedom should scale the calculated joint rotation at each step of the inverse kinematics solver. More...
 
H3DUniquePtr< SFMatrix4faccumulatedJointMatrix
 The accumulated joint transform from the local coordinate system of the joint to HAnimHumanoid local coordinate system. More...
 
- Public Attributes inherited from H3D::Transform
H3DUniquePtr< SFVec3fcenter
 The center field specifies a translation offset from the origin of the local coordinate system that the rotation and scaling should occur around. More...
 
H3DUniquePtr< SFRotationrotation
 The rotation field specifies an arbitrary rotation. More...
 
H3DUniquePtr< SFVec3fscale
 The scale field specifies a non-uniform scale of the coordinate system. More...
 
H3DUniquePtr< SFRotationscaleOrientation
 The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations). More...
 
H3DUniquePtr< SFVec3ftranslation
 Specifies a translation to the coordinate system. More...
 
- Public Attributes inherited from H3D::MatrixTransform
H3DUniquePtr< SFMatrix4fmatrix
 The transformation matrix. More...
 
H3DUniquePtr< SFMatrix4faccumulatedForward
 The accumulated forward transform matrix, i.e. More...
 
H3DUniquePtr< SFMatrix4faccumulatedInverse
 The accumulated inverse transform matrix, i.e. More...
 
H3DUniquePtr< SFTransformedBoundtransformedBound
 This is the same as the bound field, but with the transformation applied to the bound. More...
 
- Public Attributes inherited from H3D::X3DGroupingNode
bool use_union_bound
 if true a route will be set up between the bound field of the nodes in children and the bound field of the grouping node. More...
 
H3DUniquePtr< AddChildrenaddChildren
 The addChildren event appends nodes to the children field of a grouping node. More...
 
H3DUniquePtr< RemoveChildrenremoveChildren
 The removeChildren event removes nodes from the children field of the grouping node . More...
 
H3DUniquePtr< MFChildchildren
 The nodes that are grouped together by this node. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 
- Public Attributes inherited from H3D::X3DBoundedObject
H3DUniquePtr< SFVec3fbboxCenter
 Specifies a the center of an axis-aligned bounding box enclosing the node. More...
 
H3DUniquePtr< SFVec3fbboxSize
 Specifies a the size of an axis-aligned bounding box enclosing the node. More...
 
- Public Attributes inherited from H3D::H3DBoundedObject
H3DUniquePtr< SFBoundbound
 The field containing the bound object. More...
 
- Public Attributes inherited from H3D::H3DDisplayListObject
H3DUniquePtr< DisplayListdisplayList
 The DisplayList instance handling the OpenGL caching of this object.
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::Transform
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::MatrixTransform
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DGroupingNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Additional Inherited Members

- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Protected Attributes inherited from H3D::X3DGroupingNode
bool children_multi_pass_transparency
 Will be set in traverseSG to indicate if any of the children enables multi-pass transparency. More...
 
vector< H3DRenderStateObject * > render_states
 A vector of all the H3DRenderStatesObject within this X3DGroupingNode.
 
vector< ClipPlane * > clip_planes
 A vector of only ClipPlane children of this X3DGroupingNode.
 

Detailed Description

The HAnimJoint object is the fundamental building block that represents body parts.

The center field specifies a translation offset from the root of the overall humanoid body description and is not intended to receive events in most cases. Since all of the HAnimJoint objects have their centre values defined in the same coordinate frame, the length of any segment can be determined by calculating the distance between the parent's joint centre and the child's HAnimJoint object centre. The exception will be segments at the ends of the fingers and toes, for which the end effector HAnimSite objects within the HAnimSegment object shall be used.

The rotation field specifies a rotation of the coordinate system of the HAnimJoint object.

The scale field specifies a non-uniform scale of the humanoid figure coordinate system and the scale values shall be greater than zero.

The scaleOrientation specifies a rotation of the coordinate system of the humanoid figure before the scale.

The scaleOrientation applies only to the scale operation.

The translation field specifies a translation to the coordinate system.

The skinCoordWeight field contains a list of floating point values between 0.0 and 1.0 that describe an amount of weighting that should be used to affect a particular vertex from the skinCoord field of the HAnimHumanoid object. Each item in this list has a corresponding index value in the skinCoordIndex field of the HAnimJoint object indicating exactly which coordinate is to be influenced.

The ulimit and llimit fields of the HAnimJoint object specify the upper and lower joint rotation limits. Both fields are three-element float sequence containing separate values for the X, Y and Z rotation limits. The ulimit field stores the upper (i.e. maximum) values for rotation around the X, Y and Z axes. The llimit field stores the lower (i.e., minimum) values for rotation around those axes. The default values for each of these fields is the null set indicating that the joint is unconstrained.

The limitOrientation field gives the orientation of the coordinate frame in which the ulimit and llimit values are to be interpreted. The limitOrientation describes the orientation of a local coordinate frame, relative to the HAnimJoint object centre position described by the center field.

The stiffness field, if present, contains values ranging between 0.0 and 1.0 that provide an inverse kinematics system how much each degree of freedom should scale the calculated joint rotation at each step of the inverse kinematics solver.

The name field contains a name that is used for identifying the object.

The displacers field contains a list of HAnimDisplacer objects that are used to morph the deformable mesh using the morph targets defined in the Displacer objects.

Examples:

Internal routes:

Member Enumeration Documentation

◆ RenderType

Settings for how to render joints.

Enumerator
JOINTS 

Render the joints only as spheres.

SKELETON 

Render the joints as spheres and connect them with lines in the hierarchy they have.

Member Data Documentation

◆ accumulatedJointMatrix

H3DUniquePtr< SFMatrix4f > H3D::HAnimJoint::accumulatedJointMatrix

The accumulated joint transform from the local coordinate system of the joint to HAnimHumanoid local coordinate system.

Access type: inputOutput
Default value: [1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ]

Referenced by traverseSG(), H3D::HAnimHumanoid::updateCoordinates(), H3D::HAnimHumanoid::updateCoordinatesLBS(), and H3D::HAnimHumanoid::updateCoordinatesLBS2().

◆ displacers

H3DUniquePtr< MFDisplacer > H3D::HAnimJoint::displacers

The displacers field contains a list of HAnimDisplacer objects that are used to morph the deformable mesh using the morph targets defined in the Displacer objects.

Access type: inputOutput
Default value: []

Referenced by H3D::HAnimHumanoid::updateCoordinates().

◆ limitOrientation

H3DUniquePtr< SFRotation > H3D::HAnimJoint::limitOrientation

The limitOrientation field gives the orientation of the coordinate frame in which the ulimit and llimit values are to be interpreted.

The limitOrientation describes the orientation of a local coordinate frame, relative to the HAnimJoint object centre position described by the center field.

Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )

◆ llimit

H3DUniquePtr< MFFloat > H3D::HAnimJoint::llimit

The llimit fields of the HAnimJoint object specify the lower joint rotation limits.

It is a three-element float sequence containing separate values for the X, Y and Z rotation limits. The default values for each of these fields is the null set indicating that the joint is unconstrained.

Access type: inputOutput
Default value: []

◆ name

H3DUniquePtr< SFString > H3D::HAnimJoint::name

The name field contains a name that is used for identifying the object.

Access type: inputOutput
Default value: ""

◆ skinCoordIndex

H3DUniquePtr< MFInt32 > H3D::HAnimJoint::skinCoordIndex

The skinCoordIndex field contains a list of indices into the skinCoord field of the HAnimHumanoid object defining the coordinates to be influenced by this joint.

Access type: inputOutput
Default value: []

Referenced by H3D::HAnimHumanoid::updateCoordinatesLBS(), and H3D::HAnimHumanoid::updateCoordinatesLBS2().

◆ skinCoordWeight

H3DUniquePtr< MFFloat > H3D::HAnimJoint::skinCoordWeight

The skinCoordWeight field contains a list of floating point values between 0.0 and 1.0 that describe an amount of weighting that should be used to affect a particular vertex from the skinCoord field of the HAnimHumanoid object.

Each item in this list has a corresponding index value in the skinCoordIndex field of the HAnimJoint object indicating exactly which coordinate is to be influenced.

Access type: inputOutput
Default value: []

Referenced by H3D::HAnimHumanoid::updateCoordinatesLBS(), and H3D::HAnimHumanoid::updateCoordinatesLBS2().

◆ stiffness

H3DUniquePtr< MFFloat > H3D::HAnimJoint::stiffness

The stiffness field, if present, contains values ranging between 0.0 and 1.0 that provide an inverse kinematics system how much each degree of freedom should scale the calculated joint rotation at each step of the inverse kinematics solver.


Access type: inputOutput
Default value: [0 0 0]

◆ ulimit

H3DUniquePtr< MFFloat > H3D::HAnimJoint::ulimit

The ulimit fields of the HAnimJoint object specify the upper joint rotation limits.

It is a three-element float sequence containing separate values for the X, Y and Z rotation limits. The default values for each of these fields is the null set indicating that the joint is unconstrained.

Access type: inputOutput
Default value: []


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