Class TriangleEdgeCollisionFilter
Filters internal edge collisions for TriangleShape geometry. Adjusts collision normals at shared edges to match neighboring triangles, or discards the collision if the normal cannot be resolved. Requires triangle adjacency information; boundary edges (no neighbor) are left unmodified. Back-face collisions are discarded.
public class TriangleEdgeCollisionFilter : INarrowPhaseFilter
- Inheritance
-
TriangleEdgeCollisionFilter
- Implements
- Inherited Members
Properties
AngleThreshold
Gets or sets the angle threshold used for two purposes: determining when two triangle normals are considered coplanar (using simpler snapping logic), and discarding back-face collisions whose normal is anti-parallel to the triangle normal within this angle.
public JAngle AngleThreshold { get; set; }
Property Value
- JAngle
The default value is approximately 2.5 degrees.
EdgeThreshold
Gets or sets the distance threshold for edge collision detection, in world units.
public float EdgeThreshold { get; set; }
Property Value
- float
The default value is 0.01 world units.
Remarks
Larger values are more aggressive at filtering edges but may incorrectly affect legitimate collisions near triangle boundaries.
ProjectionThreshold
Gets or sets the minimum length of the projected collision normal required to keep the contact.
public float ProjectionThreshold { get; set; }
Property Value
- float
The default value is 0.5.
Remarks
When the collision normal is projected onto the plane formed by the triangle normal and its neighbor's normal, a very short projection indicates the collision is occurring along the edge crease itself and is discarded. Lower values allow more edge collisions through; higher values are more aggressive at filtering.
Methods
Filter(RigidBodyShape, RigidBodyShape, ref JVector, ref JVector, ref JVector, ref float)
Called for each detected collision with its contact data.
public bool Filter(RigidBodyShape shapeA, RigidBodyShape shapeB, ref JVector pointA, ref JVector pointB, ref JVector normal, ref float penetration)
Parameters
shapeARigidBodyShapeThe first shape in the collision.
shapeBRigidBodyShapeThe second shape in the collision.
pointAJVectorContact point on shape A (modifiable).
pointBJVectorContact point on shape B (modifiable).
normalJVectorCollision normal from B to A (modifiable).
penetrationfloatPenetration depth (modifiable).
Returns
- bool
trueto keep the collision;falseto discard it.