Table of Contents

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

contactId ulong
pointA Vector2d
pointB Vector2d
depth Fixed64
normal Vector2d
hasMaterialOverride bool
materialA PhysicsMaterial
materialB PhysicsMaterial
depthIsClamped bool

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

contactId ulong
anchorA ContactAnchor2D
anchorB ContactAnchor2D
depth Fixed64
normal Vector2d
hasMaterialOverride bool
materialA PhysicsMaterial
materialB PhysicsMaterial
depthIsClamped bool

Properties

AnchorA

Authoritative canonical contact anchor on collider A.

public ContactAnchor2D AnchorA { get; }

Property Value

ContactAnchor2D

AnchorB

Authoritative canonical contact anchor on collider B.

public ContactAnchor2D AnchorB { get; }

Property Value

ContactAnchor2D

ContactId

Stable identity derived from the unordered pair of pose-invariant canonical local feature terms.

public ulong ContactId { get; }

Property Value

ulong

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

bool

HasMaterialOverride

Gets whether this contact carries materials from private compound parts.

public bool HasMaterialOverride { get; }

Property Value

bool

MaterialA

Material for collider A when HasMaterialOverride is true.

public PhysicsMaterial MaterialA { get; }

Property Value

PhysicsMaterial

MaterialB

Material for collider B when HasMaterialOverride is true.

public PhysicsMaterial MaterialB { get; }

Property Value

PhysicsMaterial

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

point Vector2d

Returns

bool

TryGetPointB(out Vector2d)

Attempts to materialize the world-space contact point on collider B.

public bool TryGetPointB(out Vector2d point)

Parameters

point Vector2d

Returns

bool