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
pointFixedPointAnchor
ContactAnchor(Vector3d, FixedQuaternion, Vector3d)
Creates a contact anchor in a rigid local frame.
public ContactAnchor(Vector3d origin, FixedQuaternion rotation, Vector3d localPoint)
Parameters
originVector3drotationFixedQuaternionlocalPointVector3d
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
originVector3drotationFixedQuaternionlocalPointVector3dlocalDisplacementVector3d
ContactAnchor(Vector3d, Vector3d)
Creates a contact anchor in an identity-rotation rigid frame.
public ContactAnchor(Vector3d origin, Vector3d offset)
Parameters
originVector3doffsetVector3d
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
pointVector3d
Returns
TryGetOffset(out Vector3d)
Attempts to obtain the rotated offset from Origin to the conceptual contact point.
public bool TryGetOffset(out Vector3d offset)
Parameters
offsetVector3d
Returns
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
originVector3doffsetVector3d
Returns
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
otherContactAnchoroffsetVector3d
Returns
TryGetWorldPoint(out Vector3d)
Attempts to materialize the absolute world point without saturation.
public bool TryGetWorldPoint(out Vector3d point)
Parameters
pointVector3d
Returns
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
originVector3drotationFixedQuaternionanchorContactAnchor
Returns
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
originVector3danchorContactAnchor