H3D::MatrixTransform Class Reference
[X3D node classes.]

The MatrixTransform 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/MatrixTransform.h>

Inheritance diagram for H3D::MatrixTransform:

Inheritance graph

List of all members.

Classes

class  SFTransformedBound
 SFTransformedBound maintains the routes from the owner Node's bound and matrix field to the contained TransformedBoxBound instance's boxBound and matrix field. More...

Public Member Functions

 MatrixTransform (Inst< MFChild > _addChildren=0, Inst< MFChild > _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 render ()
 Render the children.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and this Node.
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p.
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node.

Public Attributes

auto_ptr< SFMatrix4fmatrix
 The transformation matrix.
auto_ptr< SFMatrix4faccumulatedForward
 The accumulated forward transform matrix.
auto_ptr< SFMatrix4faccumulatedInverse
 The accumulated inverse transform matrix.
auto_ptr< SFTransformedBoundtransformedBound
 This is the same as the bound field, but with the transformation applied to the bound.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The MatrixTransform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors.

The matrix field is a 4x4 matrix defining the transform matrix from the children's coordinate system to its ancestors coordinate system.

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.

Internal routes:
MatrixTransform.dot

Member Function Documentation

void MatrixTransform::closestPoint ( const Vec3f &  p,
NodeIntersectResult &  result 
) [virtual]

Find closest point on Node to p.

Transforms point p and calls closestPoint for all children.

Parameters:
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::X3DGroupingNode.

References matrix.

bool MatrixTransform::lineIntersect ( const Vec3f &  from,
const Vec3f &  to,
LineIntersectResult &  result 
) [virtual]

Detect intersection between a line segment and this Node.

Transforms the line into correct coordinate system and also transforms the result if there is a result. Calls lineIntersect for its children.

Parameters:
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.
Returns:
true if intersected, false otherwise.

Reimplemented from H3D::X3DGroupingNode.

References matrix.

bool MatrixTransform::movingSphereIntersect ( H3DFloat  radius,
const Vec3f &  from,
const Vec3f &  to,
NodeIntersectResult &  result 
) [virtual]

Detect collision between a moving sphere and the Node.

Transforms points and radius (if non-uniform scaling the biggest of the scale parameters is chosen)

Parameters:
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.
Returns:
true if intersected, false otherwise.

Reimplemented from H3D::X3DGroupingNode.

References matrix.


Member Data Documentation

The accumulated forward transform matrix.

Access type: inputOutput
Default value: Unit matrix

Referenced by traverseSG().

The accumulated inverse transform matrix.

Access type: inputOutput
Default value: Unit matrix

Referenced by traverseSG().

This is the same as the bound field, but with the transformation applied to the bound.

Access type: outputOnly

MatrixTransform_transformedBound.dot

Referenced by H3D::H3DWindowNode::calculateFarAndNearPlane(), MatrixTransform(), H3D::X3DGroupingNode::MFChild::onAdd(), and H3D::X3DGroupingNode::MFChild::onRemove().


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

Generated on Fri Nov 7 10:30:35 2008 for H3D API by  doxygen 1.5.7