Click or drag to resize
DigitalRuneCompositeShape Class
Represents a shape consisting of several other geometric objects.
Inheritance Hierarchy
SystemObject
  DigitalRune.Geometry.ShapesShape
    DigitalRune.Geometry.ShapesCompositeShape

Namespace: DigitalRune.Geometry.Shapes
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
[SerializableAttribute]
public class CompositeShape : Shape

The CompositeShape type exposes the following members.

Constructors
  NameDescription
Public methodCompositeShape
Initializes a new instance of the CompositeShape class.
Top
Methods
  NameDescription
Public methodClone
Creates a new Shape that is a clone (deep copy) of the current instance.
(Inherited from Shape.)
Protected methodCloneCore
Makes the instance a clone (deep copy) of the specified Shape.
(Overrides ShapeCloneCore(Shape).)
Protected methodCreateInstanceCore
When implemented in a derived class, creates a new instance of the Shape derived class.
(Overrides ShapeCreateInstanceCore.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAabb
Computes the axis-aligned bounding box (AABB) for this shape in local space.
(Inherited from Shape.)
Public methodGetAabb(Pose)
Computes the axis-aligned bounding box (AABB) for this shape positioned in world space using the given Pose.
(Inherited from Shape.)
Public methodGetAabb(Vector3F, Pose)
Computes the axis-aligned bounding box (AABB) for this shape positioned in world space using the given scale and Pose.
(Overrides ShapeGetAabb(Vector3F, Pose).)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetMesh
Gets a mesh that represents this shape.
(Inherited from Shape.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVolume
Gets the volume of this shape.
(Overrides ShapeGetVolume(Single, Int32).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnChanged
Raises the Changed event.
(Inherited from Shape.)
Protected methodOnGetMesh
Called when a mesh should be generated for the shape.
(Overrides ShapeOnGetMesh(Single, Int32).)
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Properties
  NameDescription
Public propertyChildren
Gets the child geometric objects.
Public propertyInnerPoint
Gets an inner point.
(Overrides ShapeInnerPoint.)
Public propertyPartition
Gets or set the spatial partition used to improve the performance of geometric queries.
Top
Events
  NameDescription
Public eventChanged
Occurs when the shape was changed.
(Inherited from Shape.)
Top
Remarks

This shape is a collection of geometric objects (see Children). Each child has a Shape, Scale and a Pose (= position and orientation). All children are defined in the local space of the composite shape. That means that the Pose defines the position and orientation of each child relative to the parent composite shape. The resulting composite shape can be concave.

Other names for this type of shape: Complex, Compound, Group, ...

Spatial Partitioning: A spatial partitioning method (see Partition can be used to improve runtime performance if this composite shape consists of a lot of children. A spatial partition improves the collision detection speed at the cost of additional memory. If Partition is , no spatial partitioning method is used (which is the default). If a spatial partitioning scheme should be used, the property Partition must be set to an instance of ISpatialPartitionT. The items in the spatial partition will be the indices of the Children of this composite shape. The composite shape will automatically fill and update the spatial partition. Following example shows how a complex composite shape can be improved by using an AABB tree:

C#
myCompositeShape.Partition = new AabbTree<int>();

Shape Features: If a CompositeShape is involved in a Contact, the shape feature property (FeatureA and FeatureB) contains the index of the child that caused the Contact.

Cloning: If a CompositeShape is cloned, all Children and the spatial partition (if any is in use) will be cloned (deep copy).

See Also