H3D API
2.4.1
|
The Transform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors. More...
#include <H3D/Transform.h>
Classes | |
class | Matrix |
Specialize the SFMatrix4f to update the matrix from the fields in the Transform node. More... | |
Public Member Functions | |
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. | |
![]() | |
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. | |
virtual void | traverseSG (TraverseInfo &ti) |
Traverse the scenegraph. | |
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... | |
![]() | |
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... | |
![]() | |
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 | |
H3DUniquePtr< SFVec3f > | center |
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< SFRotation > | rotation |
The rotation field specifies an arbitrary rotation. More... | |
H3DUniquePtr< SFVec3f > | scale |
The scale field specifies a non-uniform scale of the coordinate system. More... | |
H3DUniquePtr< SFRotation > | scaleOrientation |
The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations). More... | |
H3DUniquePtr< SFVec3f > | translation |
Specifies a translation to the coordinate system. More... | |
![]() | |
H3DUniquePtr< SFMatrix4f > | matrix |
The transformation matrix. More... | |
H3DUniquePtr< SFMatrix4f > | accumulatedForward |
The accumulated forward transform matrix, i.e. More... | |
H3DUniquePtr< SFMatrix4f > | accumulatedInverse |
The accumulated inverse transform matrix, i.e. More... | |
H3DUniquePtr< SFTransformedBound > | transformedBound |
This is the same as the bound field, but with the transformation applied to the bound. More... | |
![]() | |
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< AddChildren > | addChildren |
The addChildren event appends nodes to the children field of a grouping node. More... | |
H3DUniquePtr< RemoveChildren > | removeChildren |
The removeChildren event removes nodes from the children field of the grouping node . More... | |
H3DUniquePtr< MFChild > | children |
The nodes that are grouped together by this node. 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. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
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. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
![]() | |
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. | |
The Transform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors.
The bboxCenter and bboxSize fields specify a bounding box that encloses the children of the Transform node. This is a hint that may be used for optimization purposes. The results are undefined if the specified bounding box is smaller than the actual bounding box of the children at any time. A default bboxSize value, (-1, -1, -1), implies that the bounding box is not specified and, if needed, shall be calculated by the browser. The bounding box shall be large enough at all times to enclose the union of the group's children's bounding boxes; it shall not include any transformations performed by the group itself (i.e., the bounding box is defined in the local coordinate system of the children). The results are undefined if the specified bounding box is smaller than the true bounding box of the group.
The translation, rotation, scale, scaleOrientation and center fields define a geometric 3D transformation consisting of (in order):
The center field specifies a translation offset from the origin of the local coordinate system (0,0,0). The rotation field specifies a rotation of the coordinate system. The scale field specifies a non-uniform scale of the coordinate system. scale values may have any value: positive, negative (indicating a reflection), or zero. A value of zero indicates that any child geometry shall not be displayed. The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations). The scaleOrientation applies only to the scale operation. The translation field specifies a translation to the coordinate system.
Given a 3-dimensional point P and Transform node, P is transformed into point P' in its parent's coordinate system by a series of intermediate transformations. In matrix transformation notation, where C (center), SR (scaleOrientation), T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
Examples:
H3DUniquePtr< SFVec3f > H3D::Transform::center |
The center field specifies a translation offset from the origin of the local coordinate system that the rotation and scaling should occur around.
Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )
Referenced by H3D::HAnimHumanoid::initialize(), H3D::HAnimJoint::renderSkeleton(), and Transform().
H3DUniquePtr< SFRotation > H3D::Transform::rotation |
The rotation field specifies an arbitrary rotation.
Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )
Referenced by H3D::HAnimHumanoid::initialize(), and Transform().
H3DUniquePtr< SFVec3f > H3D::Transform::scale |
The scale field specifies a non-uniform scale of the coordinate system.
scale values may have any value: positive, negative (indicating a reflection), or zero. A value of zero indicates that any child geometry shall not be displayed. The rotation field specifies an arbitrary rotation.
Access type: inputOutput
Default value: Vec3f( 1, 1, 1 )
Referenced by H3D::HAnimHumanoid::initialize(), render(), and Transform().
H3DUniquePtr< SFRotation > H3D::Transform::scaleOrientation |
The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations).
Access type: inputOutput
Default value: Rotation( 0, 0, 1, 0 )
Referenced by H3D::HAnimHumanoid::initialize(), and Transform().
H3DUniquePtr< SFVec3f > H3D::Transform::translation |
Specifies a translation to the coordinate system.
Access type: inputOutput
Default value: Vec3f( 0, 0, 0 )
Referenced by H3D::HAnimHumanoid::initialize(), and Transform().