Struct ManifoldContact2D
- Namespace
- Gravitas.CollisionHandling
- Assembly
- Gravitas.dll
A deterministic pure 2D narrow-phase contact point for a collision manifold.
public readonly struct ManifoldContact2D
- Inherited Members
Constructors
ManifoldContact2D(ulong, Vector2d, Vector2d, Fixed64, Vector2d, bool, PhysicsMaterial, PhysicsMaterial, bool)
Creates a deterministic planar contact from world-space witness points.
public ManifoldContact2D(ulong contactId, Vector2d pointA, Vector2d pointB, Fixed64 depth, Vector2d normal, bool hasMaterialOverride = false, PhysicsMaterial materialA = default, PhysicsMaterial materialB = default, bool depthIsClamped = false)
Parameters
contactIdulongpointAVector2dpointBVector2ddepthFixed64normalVector2dhasMaterialOverrideboolmaterialAPhysicsMaterialmaterialBPhysicsMaterialdepthIsClampedbool
ManifoldContact2D(ulong, ContactAnchor2D, ContactAnchor2D, Fixed64, Vector2d, bool, PhysicsMaterial, PhysicsMaterial, bool)
Creates a deterministic planar contact from authoritative relative anchors.
public ManifoldContact2D(ulong contactId, ContactAnchor2D anchorA, ContactAnchor2D anchorB, Fixed64 depth, Vector2d normal, bool hasMaterialOverride = false, PhysicsMaterial materialA = default, PhysicsMaterial materialB = default, bool depthIsClamped = false)
Parameters
contactIdulonganchorAContactAnchor2DanchorBContactAnchor2DdepthFixed64normalVector2dhasMaterialOverrideboolmaterialAPhysicsMaterialmaterialBPhysicsMaterialdepthIsClampedbool
Properties
AnchorA
Authoritative canonical contact anchor on collider A.
public ContactAnchor2D AnchorA { get; }
Property Value
AnchorB
Authoritative canonical contact anchor on collider B.
public ContactAnchor2D AnchorB { get; }
Property Value
ContactId
Stable identity derived from the unordered pair of pose-invariant canonical local feature terms.
public ulong ContactId { get; }
Property Value
Depth
Penetration depth along Normal.
public Fixed64 Depth { get; }
Property Value
- Fixed64
DepthIsClamped
Gets whether the conceptual penetration depth exceeded the scalar range.
public bool DepthIsClamped { get; }
Property Value
HasMaterialOverride
Gets whether this contact carries materials from private compound parts.
public bool HasMaterialOverride { get; }
Property Value
MaterialA
Material for collider A when HasMaterialOverride is true.
public PhysicsMaterial MaterialA { get; }
Property Value
MaterialB
Material for collider B when HasMaterialOverride is true.
public PhysicsMaterial MaterialB { get; }
Property Value
Normal
Unit normal pointing from collider A toward collider B.
public Vector2d Normal { get; }
Property Value
- Vector2d
PointA
Gets the world-space X/Z-plane contact point on collider A.
public Vector2d PointA { get; }
Property Value
- Vector2d
Exceptions
- InvalidOperationException
The conceptual world point is outside the scalar range.
PointB
Gets the world-space X/Z-plane contact point on collider B.
public Vector2d PointB { get; }
Property Value
- Vector2d
Exceptions
- InvalidOperationException
The conceptual world point is outside the scalar range.
Methods
TryGetPointA(out Vector2d)
Attempts to materialize the world-space contact point on collider A.
public bool TryGetPointA(out Vector2d point)
Parameters
pointVector2d
Returns
TryGetPointB(out Vector2d)
Attempts to materialize the world-space contact point on collider B.
public bool TryGetPointB(out Vector2d point)
Parameters
pointVector2d