H3D API
2.4.1
|
The HAnimHumanoid node is a container for the entire humanoid. More...
#include <H3D/HAnimHumanoid.h>
Public Types | |
typedef DependentSFNode< X3DCoordinateNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DCoordinateNode::propertyChanged > > | SFCoordinateNode |
The SFCoordinateNode is dependent on the propertyChanged field of the contained X3DCoordinateNode. | |
typedef DependentSFNode< X3DNormalNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DNormalNode::propertyChanged > > | SFNormalNode |
The SFNormalNode is dependent on the propertyChanged field of the More... | |
![]() | |
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 | |
HAnimHumanoid (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< MFString > _info=0, Inst< SFString > _name=0, Inst< SFString > _version=0, Inst< MFChild > _skin=0, Inst< MFJoint > _joints=0, Inst< MFSegment > _segments=0, Inst< MFSite > _sites=0, Inst< MFSkeletonNode > _skeleton=0, Inst< MFSite > _viewpoints=0, Inst< SFCoordinateNode > _skinCoord=0, Inst< SFNormalNode > _skinNormal=0, Inst< SFVec3f > _center=0, Inst< SFRotation > _rotation=0, Inst< SFVec3f > _scale=0, Inst< SFRotation > _scaleOrientation=0, Inst< SFVec3f > _translation=0, Inst< SFString > _renderMode=0) | |
Constructor. | |
virtual void | initialize () |
Initializes the root_transform. | |
virtual void | render () |
Render the skin. | |
virtual void | traverseSG (TraverseInfo &ti) |
Traverse the scenegraph. traverseSG() is called in all skin nodes. | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and a 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... | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (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. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
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 Field * | getField (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... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
bool | use_union_bound |
if true a route will be set up between the bound field of the nodes in skin and the bound field of the grouping node. More... | |
H3DUniquePtr< MFString > | info |
The info field consists of a sequence of strings, each of which is of the form "tag=value". More... | |
H3DUniquePtr< SFString > | name |
The name field stores the name of the humanoid defined by the Humanoid object. More... | |
H3DUniquePtr< SFString > | version |
The version field stores the version of the H-Anim International Standard to which the Humanoid object conforms. More... | |
H3DUniquePtr< MFChild > | skin |
The skin field contains the nodes that define the graphical appearance of the HAnimHumanoid. More... | |
H3DUniquePtr< MFJoint > | joints |
The joints field contains a list of references, one for each HAnimJoint object defined within the skeleton field hierarchy of the HAnimHumanoid object. More... | |
H3DUniquePtr< MFSegment > | segments |
The segments field contains a list of references, one for each HAnimSegment object defined within the skeleton field hierarchy of the Humanoid object. More... | |
H3DUniquePtr< MFSite > | sites |
The sites field contains a list of references, one for each HAnimSite object defined within the skeleton field hierarchy of the Humanoid object. More... | |
H3DUniquePtr< MFSkeletonNode > | skeleton |
The skeleton field contains the HAnimHumanoid root HAnimJoint object. More... | |
H3DUniquePtr< MFSite > | viewpoints |
The viewpoints field has a different functionality and behaviour than the joints, segments and sites fields. More... | |
H3DUniquePtr< SFCoordinateNode > | skinCoord |
The skinCoord field contains a single sequence of points which are used by the internal mechanisms of the HAnimHumanoid object to create the appropriate surface deformations as well as by the indexed face set definitions within the skin field which do the actual rendering of the surface geometry. More... | |
H3DUniquePtr< SFNormalNode > | skinNormal |
The skinNormal field contains the normal data definition which is used by the internal mechanisms of the HAnimHumanoid object to create the appropriate surface deformations as well as the indexed face set definitions within the skin field, which contains the actual surface geometry that is rendered. More... | |
H3DUniquePtr< SFVec3f > | center |
The center field specifies a translation offset from the origin of the local coordinate system (0,0,0). More... | |
H3DUniquePtr< SFRotation > | rotation |
The rotation field specifies a rotation of the coordinate system of the humanoid figure. More... | |
H3DUniquePtr< SFVec3f > | scale |
The scale field specifies a non-uniform scale of the humanoid figure coordinate system and the scale values shall be greater than zero. More... | |
H3DUniquePtr< SFRotation > | scaleOrientation |
The scaleOrientation specifies a rotation of the coordinate system of the humanoid figure before the scale (to specify scales in arbitrary orientations). More... | |
H3DUniquePtr< SFVec3f > | translation |
The translation field specifies a translation to the coordinate system of the entire humanoid figure. More... | |
H3DUniquePtr< SFString > | renderMode |
The renderMode field defines how the humanoid should be rendered. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFVec3f > | bboxCenter |
Specifies a the center of an axis-aligned bounding box enclosing the node. More... | |
H3DUniquePtr< SFVec3f > | bboxSize |
Specifies a the size of an axis-aligned bounding box enclosing the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Protected Member Functions | |
template<class VectorType > | |
void | updateCoordinates (const VectorType &orig_points, const vector< Vec3f > &orig_normals, VectorType &modified_points, vector< Vec3f > &modified_normals) |
Template function to apply the joint movements and displacements to original skin coordinates and normals. More... | |
template<class VectorType > | |
void | updateCoordinatesLBS (const VectorType &orig_points, const vector< Vec3f > &orig_normals, VectorType &modified_points, vector< Vec3f > &modified_normals) |
Function for updating the coordinates using linear blend skinning. More... | |
template<class VectorType > | |
void | updateCoordinatesLBS2 (const VectorType &orig_points, const vector< Vec3f > &orig_normals, VectorType &modified_points, vector< Vec3f > &modified_normals) |
Function for updating the coordinates using linear blend skinning using blending of matrices. More... | |
template<class VectorType > | |
void | updateCoordinatesDLB (const VectorType &orig_points, const vector< Vec3f > &orig_normals, VectorType &modified_points, vector< Vec3f > &modified_normals) |
Function for updating the coordinates using dual quaternion linear blending. More... | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
Protected Attributes | |
AutoRef< Transform > | root_transform |
Transform node that will contain the skin nodes and which values will be controlled by the transformation fields in the HAnimHumanoid. More... | |
vector< Vec3d > | points_double |
vector for storing the original points before joint and displacer modification if the original coord data is double precision. | |
vector< Vec3f > | points_single |
vector for storing the original points before joint and displacer modification if the original coord data is single precision. | |
vector< Vec3f > | normals_single |
vector for storing the original normals before joint and displacer modification if the original normal data is single precision. | |
AutoRef< X3DCoordinateNode > | current_coordinate |
The coordinate node that was used as base coordinate in last traverseSG. | |
AutoRef< X3DNormalNode > | current_normal |
The normal node that was used as base normals in last traverseSG. | |
H3DUniquePtr< Field > | jointMatrixChanged |
Field used to know if any values have changed so that the coordinates have to be updated. More... | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
The HAnimHumanoid node is a container for the entire humanoid.
In addition it is used to store human-readable data such as author and copyright information, as well as to store references to the HAnimJoint, HAnimSegment, and HAnimSite nodes in addition to serving as a container for the entire humanoid. Thus, it serves as a central node for moving the humanoid through its environment.
Examples:
typedef DependentSFNode< X3DNormalNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DNormalNode::propertyChanged > > H3D::HAnimHumanoid::SFNormalNode |
The SFNormalNode is dependent on the propertyChanged field of the
contained X3DNormalNode.
|
virtual |
Find closest point on Node to p.
Calls closestPoint for all skin
p | The point to find the closest point to. |
result | A struct containing various results of closest points such as which geometries the closest points where detected on. |
Reimplemented from H3D::Node.
References root_transform.
|
virtual |
Detect intersection between a line segment and a Node.
Calls lineIntersect for all skin
from | The start of the line segment. |
to | The end of the line segment. |
result | Contains info about the closest intersection for every object that intersects the line. |
Reimplemented from H3D::Node.
References root_transform.
|
virtual |
Detect collision between a moving sphere and the Node.
Calls movingSphereIntersect for all skin
radius | The radius of the sphere |
from | The start position of the sphere |
to | The end position of the sphere. |
result | A struct containing various results of intersections such as which geometries intersected the moving sphere. |
Reimplemented from H3D::Node.
References root_transform.
|
protected |
Template function to apply the joint movements and displacements to original skin coordinates and normals.
Since the points can be both floats or doubles a template is used.
orig_points | The original points before any deformation. |
orig_normals | The original normals before any deformation. |
modified_points | At input a copy of orig_points, at function return it will contain the points with the deformations applied. |
modified_normals | At input a copy of orig_normals, at function return it will contain the normals with the deformations applied. |
References H3D::HAnimJoint::accumulatedJointMatrix, H3D::HAnimDisplacer::displaceCoordinates(), H3D::HAnimJoint::displacers, joints, renderMode, H3DUtil::AutoRefVector< class >::size(), updateCoordinatesDLB(), and updateCoordinatesLBS2().
Referenced by traverseSG().
|
protected |
Function for updating the coordinates using dual quaternion linear blending.
orig_points | The original points before any deformation. |
orig_normals | The original normals before any deformation. |
modified_points | At input a copy of orig_points, at function return it will contain the points with the deformations applied. |
modified_normals | At input a copy of orig_normals, at function return it will contain the normals with the deformations applied. |
References H3DMax().
Referenced by updateCoordinates().
|
protected |
Function for updating the coordinates using linear blend skinning.
orig_points | The original points before any deformation. |
orig_normals | The original normals before any deformation. |
modified_points | At input a copy of orig_points, at function return it will contain the points with the deformations applied. |
modified_normals | At input a copy of orig_normals, at function return it will contain the normals with the deformations applied. |
References H3D::HAnimJoint::accumulatedJointMatrix, H3DMax(), joints, H3DUtil::AutoRefVector< class >::size(), H3D::HAnimJoint::skinCoordIndex, and H3D::HAnimJoint::skinCoordWeight.
|
protected |
Function for updating the coordinates using linear blend skinning using blending of matrices.
Same results as updateCoordinateLBS.
orig_points | The original points before any deformation. |
orig_normals | The original normals before any deformation. |
modified_points | At input a copy of orig_points, at function return it will contain the points with the deformations applied. |
modified_normals | At input a copy of orig_normals, at function return it will contain the normals with the deformations applied. |
References H3D::HAnimJoint::accumulatedJointMatrix, H3DMax(), joints, H3DUtil::AutoRefVector< class >::size(), H3D::HAnimJoint::skinCoordIndex, and H3D::HAnimJoint::skinCoordWeight.
Referenced by updateCoordinates().
H3DUniquePtr< SFVec3f > H3D::HAnimHumanoid::center |
The center field specifies a translation offset from the origin of the local coordinate system (0,0,0).
Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )
Referenced by initialize().
H3DUniquePtr< MFString > H3D::HAnimHumanoid::info |
The info field consists of a sequence of strings, each of which is of the form "tag=value".
The following tags are currently defined by the H-Anim Specification:
The gender tag typically has a value of "female", "male" or "neuter". The humanoidVersion tag refers to the version of the humanoid being used, in order to track revisions to the data. It is not the same as the version field of the Humanoid object, which refers to the version of the H-Anim specification that was used when building the humanoid. Additional tag=value pairs can be included as needed for specific applications and can be proposed as additions to future versions of this International Standard.
Access type: inputOutput
Default value: []
|
protected |
Field used to know if any values have changed so that the coordinates have to be updated.
All joints accumulatedJointMatrx and displacers fields are routed here.
Referenced by traverseSG().
H3DUniquePtr< MFJoint > H3D::HAnimHumanoid::joints |
The joints field contains a list of references, one for each HAnimJoint object defined within the skeleton field hierarchy of the HAnimHumanoid object.
The order in which the joints are listed is irrelevant since the names of the joints are stored in the HAnimJoint objects themselves.
Access type: inputOutput
Referenced by updateCoordinates(), updateCoordinatesLBS(), and updateCoordinatesLBS2().
H3DUniquePtr< SFString > H3D::HAnimHumanoid::name |
The name field stores the name of the humanoid defined by the Humanoid object.
Access type: inputOutput
Default value: ""
H3DUniquePtr< SFString > H3D::HAnimHumanoid::renderMode |
The renderMode field defines how the humanoid should be rendered.
Access type: inputOutput
Default value: "SKIN", "SKIN_DLB", "JOINTS", "SKELETON"
Default value: "SKIN"
Referenced by render(), and updateCoordinates().
Transform node that will contain the skin nodes and which values will be controlled by the transformation fields in the HAnimHumanoid.
Referenced by closestPoint(), initialize(), lineIntersect(), movingSphereIntersect(), render(), and traverseSG().
H3DUniquePtr< SFRotation > H3D::HAnimHumanoid::rotation |
The rotation field specifies a rotation of the coordinate system of the humanoid figure.
Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )
Referenced by initialize().
H3DUniquePtr< SFVec3f > H3D::HAnimHumanoid::scale |
The scale field specifies a non-uniform scale of the humanoid figure coordinate system and the scale values shall be greater than zero.
Access type: inputOutput
Default value: Vec3f( 1, 1, 1 )
Referenced by initialize().
H3DUniquePtr< SFRotation > H3D::HAnimHumanoid::scaleOrientation |
The scaleOrientation specifies a rotation of the coordinate system of the humanoid figure before the scale (to specify scales in arbitrary orientations).
The scaleOrientation applies only to the scale operation.
Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )
Referenced by initialize().
H3DUniquePtr< MFSegment > H3D::HAnimHumanoid::segments |
The segments field contains a list of references, one for each HAnimSegment object defined within the skeleton field hierarchy of the Humanoid object.
The order in which the segments are listed is irrelevant since the names of the segments are stored in the HAnimSegment objects themselves.
Access type: inputOutput
H3DUniquePtr< MFSite > H3D::HAnimHumanoid::sites |
The sites field contains a list of references, one for each HAnimSite object defined within the skeleton field hierarchy of the Humanoid object.
The order in which the sites are listed is irrelevant since the names of the sites are stored in the HAnimSite objects themselves.
Access type: inputOutput
H3DUniquePtr< MFSkeletonNode > H3D::HAnimHumanoid::skeleton |
The skeleton field contains the HAnimHumanoid root HAnimJoint object.
The HAnimHumanoid object is considered the parent object of this joint object and defines a coordinate space for it. Thus, the HAnimHumanoid object's transformation affects the HAnimJoint object hierarchy in the skeleton field. A hierarchy of HAnimJoint objects is defined for each H-Anim humanoid figure within the skeleton field of the HAnimHumanoid object and a hierarchical definition of joints is present even when the geometry of the humanoid figure is not defined within the skeleton field. The skeleton field contain can also contain zero or more HAnimSite objects which allow landmarks to be established with respect to the overall humanoid figure, but which will not be affected by the movement of any of the HAnimJoint objects.
Access type: inputOutput
Referenced by render(), and traverseSG().
H3DUniquePtr< MFChild > H3D::HAnimHumanoid::skin |
The skin field contains the nodes that define the graphical appearance of the HAnimHumanoid.
It should contain one or more triangle set definitions that utilize the point and normal data that is defined within the skinCoord and skinNormal fields.
Access type: inputOutput
Referenced by initialize().
H3DUniquePtr< SFCoordinateNode > H3D::HAnimHumanoid::skinCoord |
The skinCoord field contains a single sequence of points which are used by the internal mechanisms of the HAnimHumanoid object to create the appropriate surface deformations as well as by the indexed face set definitions within the skin field which do the actual rendering of the surface geometry.
Access type: inputOutput
Referenced by traverseSG().
H3DUniquePtr< SFNormalNode > H3D::HAnimHumanoid::skinNormal |
The skinNormal field contains the normal data definition which is used by the internal mechanisms of the HAnimHumanoid object to create the appropriate surface deformations as well as the indexed face set definitions within the skin field, which contains the actual surface geometry that is rendered.
Access type: inputOutput
Referenced by traverseSG().
H3DUniquePtr< SFVec3f > H3D::HAnimHumanoid::translation |
The translation field specifies a translation to the coordinate system of the entire humanoid figure.
Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )
Referenced by initialize().
bool H3D::HAnimHumanoid::use_union_bound |
if true a route will be set up between the bound field of the nodes in skin and the bound field of the grouping node.
H3DUniquePtr< SFString > H3D::HAnimHumanoid::version |
The version field stores the version of the H-Anim International Standard to which the Humanoid object conforms.
E.g. "200x".
Access type: inputOutput
Default value: ""
H3DUniquePtr< MFSite > H3D::HAnimHumanoid::viewpoints |
The viewpoints field has a different functionality and behaviour than the joints, segments and sites fields.
The viewpoints field can contain zero or more HAnimSite object definitions. The HAnimSite objects defined within this field are affected by the transformations applied to the HAnimHumanoid object, but are not affected by any of the transformations performed on the skeletal hierarchy defined within the skeleton field. The purpose of these HAnimSite objects is to define locations for virtual cameras in the reference frame of the HAnimHumanoid object. HAnimSite objects that are defined in this manner are intended to be used as attachment points from which a certain viewing perspective can be seen (such as viewing the face or profile of the human figure).
Access type: inputOutput