Post

CollidableShape

Overview

CollidableShape connects the collision detection system, the rigid body model, and the renderable scene graph. Contains a single Shape node (containerField='shape') for animating collidable geometry.

The CollidableShape node belongs to the RigidBodyPhysics component and requires at least level 1, its default container field is children. It is available from X3D version 3.2 or higher.

Hierarchy

1
2
3
4
+ X3DNode
  + X3DChildNode
    + X3DNBodyCollidableNode
      + CollidableShape

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFBool [in, out] enabled TRUE

Enables/disables node operation.

SFVec3f [in, out] translation 0 0 0 (-∞,∞)

Position (x, y, z in meters) of children relative to local coordinate system.

Hint

  • The order of operation is first apply the center offset, then scaleOrientation and scale, then rotation, then restore the center offset, then translation.

SFRotation [in, out] rotation 0 0 1 0 [0,1]

Orientation (axis, angle in radians) of children relative to local coordinate system.

Hint

  • The order of operation is first apply the center offset, then scaleOrientation and scale, then rotation, then restore the center offset, then translation.

SFBool [in, out] visible TRUE

Whether or not renderable content within this node is visually displayed.

Hints

  • The visible field has no effect on animation behaviors, event passing or other non-visual characteristics.
  • Content must be visible to be collidable and to be pickable.

SFBool [in, out] bboxDisplay FALSE

Whether to display bounding box for associated geometry, aligned with world coordinates.

Hint

  • The bounding box is displayed regardless of whether contained content is visible.

SFVec3f [ ] bboxSize -1 -1 -1 [0,∞) or −1 −1 −1

Bounding box size is usually omitted, and can easily be calculated automatically by an X3D player at scene-loading time with minimal computational cost. Bounding box size can also be defined as an optional authoring hint that suggests an optimization or constraint.

Hints

SFVec3f [ ] bboxCenter 0 0 0 (-∞,∞)

Bounding box center accompanies bboxSize and provides an optional hint for bounding box position offset from origin of local coordinate system.

Hints

SFNode [ ] shape NULL [Shape]

The shape field provides a geometry proxy for specifying which geometry best represents the collidable object.

Advice

Hint

  • Content must be visible to be collidable and to be pickable.

Warnings

  • Avoid changing Shape geometry at run time to prevent performance problems.
  • Apply containerField='shape' to single Shape child node, not containerField='children' default.

Example

See Also

This post is licensed under CC BY 4.0 by the author.