29 #ifndef __HANIMDISPLACER_H__
30 #define __HANIMDISPLACER_H__
70 Inst< MFInt32 > _coordIndex = 0,
71 Inst< MFVec3f > _displacements = 0,
72 Inst< SFString > _name = 0,
73 Inst< SFFloat > _weight = 0 );
80 template<
class VectorType >
82 const Matrix4f &displace_transform );
126 template<
class VectorClass >
128 const Matrix4f &displace_transform) {
130 const vector< int > &indices =
coordIndex->getValue();
136 size_t p_size = points.size();
137 size_t d_size = displace.size();
139 for(
size_t i = 0; i < indices.size(); ++i ) {
140 int index = indices[i];
141 if( (
unsigned int) index < p_size && i < d_size) {
142 Vec4f point_displacement = displace_transform *
Vec4f( displace[i].
x, displace[i].y, displace[i].z, 0 ) ;
143 points[index] = w * (Vec3f(point_displacement.x,
144 point_displacement.y,
145 point_displacement.z ) ) + points[index];
Contains the MFInt32 field class.
Contains the MFVec3f field class.
Contains the SFFloat field class.
Contains the SFString field class.
Header file for X3DGeometricPropertyNode, X3D scene-graph node.
Applications may need to alter the shape of individual segments.
Definition: HAnimDisplacer.h:66
H3DUniquePtr< SFFloat > weight
The displacements shall be uniformly scaled by the value of the weight field.
Definition: HAnimDisplacer.h:120
H3DUniquePtr< SFString > name
The name field contains a name that is used for identifying the object.
Definition: HAnimDisplacer.h:112
H3DUniquePtr< MFVec3f > displacements
The displacements field, if present, provides a set of 3D values that are added to the neutral or res...
Definition: HAnimDisplacer.h:103
void displaceCoordinates(VectorType &points, const Matrix4f &displace_transform)
Displaces the coordinates in points according to the HAnimDisplacer fields.
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: HAnimDisplacer.h:123
H3DUniquePtr< MFInt32 > coordIndex
The coordIndex field contains the indices into the coordinate array for the mesh of the vertices that...
Definition: HAnimDisplacer.h:90
This is the base node type for all geometric property node types defined in X3D.
Definition: X3DGeometricPropertyNode.h:43
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194