Table of Contents

Struct ContactAnchor

Namespace
Gravitas.CollisionHandling
Assembly
Gravitas.dll

Represents a 3D contact point in one rigid world-space frame.

public readonly struct ContactAnchor
Inherited Members

Remarks

The underlying origin, rotation, and local point remain authoritative when either the rotated offset or absolute world point lies outside the FixedMathSharp.Fixed64 scalar range.

Constructors

ContactAnchor(FixedPointAnchor)

Creates a physics-domain wrapper for an exact point anchor.

public ContactAnchor(FixedPointAnchor point)

Parameters

point FixedPointAnchor

ContactAnchor(Vector3d, FixedQuaternion, Vector3d)

Creates a contact anchor in a rigid local frame.

public ContactAnchor(Vector3d origin, FixedQuaternion rotation, Vector3d localPoint)

Parameters

origin Vector3d
rotation FixedQuaternion
localPoint Vector3d

ContactAnchor(Vector3d, FixedQuaternion, Vector3d, Vector3d)

Creates a contact anchor whose two local terms remain separate until the exact rotated point is evaluated.

public ContactAnchor(Vector3d origin, FixedQuaternion rotation, Vector3d localPoint, Vector3d localDisplacement)

Parameters

origin Vector3d
rotation FixedQuaternion
localPoint Vector3d
localDisplacement Vector3d

ContactAnchor(Vector3d, Vector3d)

Creates a contact anchor in an identity-rotation rigid frame.

public ContactAnchor(Vector3d origin, Vector3d offset)

Parameters

origin Vector3d
offset Vector3d

Properties

LocalDisplacement

Gets the secondary local displacement retained separately from LocalPoint.

public Vector3d LocalDisplacement { get; }

Property Value

Vector3d

LocalPoint

Gets the point in the contact frame's local coordinates.

public Vector3d LocalPoint { get; }

Property Value

Vector3d

Offset

Gets the rotated offset from Origin to the conceptual contact point.

public Vector3d Offset { get; }

Property Value

Vector3d

Exceptions

InvalidOperationException

The rotated offset lies outside the representable coordinate domain.

Origin

Gets the representable world-space origin.

public Vector3d Origin { get; }

Property Value

Vector3d

Rotation

Gets the normalized local-to-world frame rotation.

public FixedQuaternion Rotation { get; }

Property Value

FixedQuaternion

Methods

FromWorldPoint(Vector3d)

Creates an anchor for an already materialized world point.

public static ContactAnchor FromWorldPoint(Vector3d point)

Parameters

point Vector3d

Returns

ContactAnchor

TryGetOffset(out Vector3d)

Attempts to obtain the rotated offset from Origin to the conceptual contact point.

public bool TryGetOffset(out Vector3d offset)

Parameters

offset Vector3d

Returns

bool

TryGetOffsetFrom(Vector3d, out Vector3d)

Attempts to rebase the conceptual point onto another origin with one final exact component-wise add/subtract operation.

public bool TryGetOffsetFrom(Vector3d origin, out Vector3d offset)

Parameters

origin Vector3d
offset Vector3d

Returns

bool

TryGetOffsetFrom(in ContactAnchor, out Vector3d)

Attempts to obtain this point's exact world-space offset from another rigid-frame contact anchor.

public bool TryGetOffsetFrom(in ContactAnchor other, out Vector3d offset)

Parameters

other ContactAnchor
offset Vector3d

Returns

bool

TryGetWorldPoint(out Vector3d)

Attempts to materialize the absolute world point without saturation.

public bool TryGetWorldPoint(out Vector3d point)

Parameters

point Vector3d

Returns

bool

TryRebase(Vector3d, FixedQuaternion, out ContactAnchor)

Attempts to express the same conceptual point in another rigid frame.

public bool TryRebase(Vector3d origin, FixedQuaternion rotation, out ContactAnchor anchor)

Parameters

origin Vector3d
rotation FixedQuaternion
anchor ContactAnchor

Returns

bool

TryRebase(Vector3d, out ContactAnchor)

Attempts to express the same conceptual point relative to another representable origin.

public bool TryRebase(Vector3d origin, out ContactAnchor anchor)

Parameters

origin Vector3d
anchor ContactAnchor

Returns

bool