TriangleMeshShape Class |
Namespace: DigitalRune.Geometry.Shapes
The TriangleMeshShape type exposes the following members.
Name | Description | |
---|---|---|
TriangleMeshShape |
Initializes a new instance of the TriangleMeshShape class.
| |
TriangleMeshShape(ITriangleMesh) |
Initializes a new instance of the TriangleMeshShape class from the given
triangle mesh.
| |
TriangleMeshShape(ITriangleMesh, Boolean) |
Initializes a new instance of the TriangleMeshShape class from the given
triangle mesh.
| |
TriangleMeshShape(ITriangleMesh, Boolean, ISpatialPartitionInt32) |
Initializes a new instance of the TriangleMeshShape class from the given
triangle mesh.
|
Name | Description | |
---|---|---|
Clone |
Creates a new Shape that is a clone (deep copy) of the current instance.
(Inherited from Shape.) | |
CloneCore |
Makes the instance a clone (deep copy) of the specified Shape.
(Overrides ShapeCloneCore(Shape).) | |
CreateInstanceCore |
When implemented in a derived class, creates a new instance of the Shape
derived class.
(Overrides ShapeCreateInstanceCore.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAabb |
Computes the axis-aligned bounding box (AABB) for this shape in local space.
(Inherited from Shape.) | |
GetAabb(Pose) |
Computes the axis-aligned bounding box (AABB) for this shape positioned in world space using
the given Pose.
(Inherited from Shape.) | |
GetAabb(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).) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetMesh |
Gets a mesh that represents this shape.
(Inherited from Shape.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetVolume |
Computes the enclosed volume of the mesh.
| |
GetVolume(Single, Int32) |
Computes the enclosed volume of the mesh.
(Overrides ShapeGetVolume(Single, Int32).) | |
Invalidate |
Invalidates the triangle mesh.
| |
Invalidate(Boolean) |
Invalidates the triangle mesh.
| |
Invalidate(Int32, Boolean) |
Invalidates the whole triangle mesh or a single triangle.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnChanged |
Raises the Changed event.
(Inherited from Shape.) | |
OnGetMesh |
Called when a mesh should be generated for the shape.
(Overrides ShapeOnGetMesh(Single, Int32).) | |
ToString | (Overrides ObjectToString.) |
Name | Description | |
---|---|---|
EnableContactWelding |
Gets or sets a value indicating whether contact welding is enabled.
| |
InnerPoint |
Gets an inner point.
(Overrides ShapeInnerPoint.) | |
IsTwoSided |
Gets or sets a value indicating whether the mesh is two-sided.
| |
Mesh |
Gets or sets the triangle mesh.
| |
Partition |
Gets or set the spatial partition used to improve the performance of geometric queries.
|
One-sided and two-sided meshes: Per default, the collision detection treats the triangle mesh as one-sided (IsTwoSided is ); that means, only the front side of a triangle is solid. If the collision detection is used in a physics simulation, then objects can pass through the back side of a triangle. IsTwoSided can be set to to treat the mesh as two-sided (double-sided).
Meshes are hollow: Further, meshes are not treated as solid volumes. For example if a triangle mesh represents a sphere and another object is inside the sphere but does not touch any triangles, then no collision is reported.
Spatial Partitioning: A spatial partitioning method (see Partition can be used to improve runtime performance if the Mesh consists of a lot of triangles. 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 a ISpatialPartitionT instance. The items in the spatial partition will be the indices of the mesh triangles. The triangle mesh shape will automatically fill and update the spatial partition. Following example shows how a complex triangle mesh shape can be improved by using an AABB tree:
myTriangleMeshShape.Partition = new AabbTree<int>();
Shape Features: If a TriangleMeshShape is involved in a Contact the shape feature property (FeatureA and FeatureB) contains the index of the triangle that causes the Contact.
Cloning: A TriangleMeshShape can be cloned. The clone will reference the same ITriangleMesh (shallow copy)! If a Partition is in use, the spatial partition will be cloned.