Table of Contents

Struct ContactAnchor2D

Namespace
Gravitas.CollisionHandling
Assembly
Gravitas.dll

Represents a planar contact point as a world-space origin plus a rotated local offset.

public readonly struct ContactAnchor2D
Inherited Members

Constructors

ContactAnchor2D(FixedPointAnchor2d)

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

public ContactAnchor2D(FixedPointAnchor2d point)

Parameters

point FixedPointAnchor2d

ContactAnchor2D(Vector2d, Fixed64, Vector2d)

Creates a planar contact anchor from a canonical local point.

public ContactAnchor2D(Vector2d origin, Fixed64 rotation, Vector2d localPoint)

Parameters

origin Vector2d
rotation Fixed64
localPoint Vector2d

ContactAnchor2D(Vector2d, Fixed64, Vector2d, Vector2d)

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

public ContactAnchor2D(Vector2d origin, Fixed64 rotation, Vector2d localPoint, Vector2d localDisplacement)

Parameters

origin Vector2d
rotation Fixed64
localPoint Vector2d
localDisplacement Vector2d

ContactAnchor2D(Vector2d, Vector2d)

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

public ContactAnchor2D(Vector2d origin, Vector2d offset)

Parameters

origin Vector2d
offset Vector2d

Properties

LocalDisplacement

Gets the secondary local displacement retained separately from LocalPoint.

public Vector2d LocalDisplacement { get; }

Property Value

Vector2d

LocalPoint

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

public Vector2d LocalPoint { get; }

Property Value

Vector2d

Offset

Gets the rotated composite offset from the rigid-frame origin.

public Vector2d Offset { get; }

Property Value

Vector2d

Exceptions

InvalidOperationException

The rotated offset is outside the representable scalar domain. Use TryGetOffset(out Vector2d) when handling domain edges.

Origin

Gets the representable world-space origin.

public Vector2d Origin { get; }

Property Value

Vector2d

Rotation

Gets the rotation applied to LocalPoint.

public Fixed64 Rotation { get; }

Property Value

Fixed64

Methods

FromWorldPoint(Vector2d)

Creates an anchor for an already materialized world point.

public static ContactAnchor2D FromWorldPoint(Vector2d point)

Parameters

point Vector2d

Returns

ContactAnchor2D

TryGetOffset(out Vector2d)

Attempts to materialize the rotated composite rigid-frame offset.

public bool TryGetOffset(out Vector2d offset)

Parameters

offset Vector2d

Returns

bool

TryGetOffsetFrom(Vector2d, out Vector2d)

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

public bool TryGetOffsetFrom(Vector2d origin, out Vector2d offset)

Parameters

origin Vector2d
offset Vector2d

Returns

bool

TryGetOffsetFrom(ContactAnchor2D, out Vector2d)

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

public bool TryGetOffsetFrom(ContactAnchor2D other, out Vector2d offset)

Parameters

other ContactAnchor2D
offset Vector2d

Returns

bool

TryGetWorldPoint(out Vector2d)

Attempts to materialize the absolute world point without saturation.

public bool TryGetWorldPoint(out Vector2d point)

Parameters

point Vector2d

Returns

bool

TryRebase(Vector2d, Fixed64, out ContactAnchor2D)

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

public bool TryRebase(Vector2d origin, Fixed64 rotation, out ContactAnchor2D anchor)

Parameters

origin Vector2d
rotation Fixed64
anchor ContactAnchor2D

Returns

bool

TryRebase(Vector2d, out ContactAnchor2D)

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

public bool TryRebase(Vector2d origin, out ContactAnchor2D anchor)

Parameters

origin Vector2d
anchor ContactAnchor2D

Returns

bool