Table of Contents

Class FixedTransform

Namespace
FixedMathSharp
Assembly
FixedMathSharp.dll

Provides a mutable deterministic transform snapshot with optional hierarchy composition.

public class FixedTransform
Inheritance
FixedTransform
Inherited Members

Remarks

This engine-neutral shell stores local components and a parent reference only. It does not own children, scene state, synchronization, caches, or dirty propagation.

Constructors

FixedTransform(Vector2d, Fixed64, Vector2d, FixedTransform?)

Initializes an X/Z local transform at zero Y position with unit Y scale.

public FixedTransform(Vector2d localPositionXZ, Fixed64 localRotationXZRadians, Vector2d localScaleXZ, FixedTransform? parent = null)

Parameters

localPositionXZ Vector2d
localRotationXZRadians Fixed64
localScaleXZ Vector2d
parent FixedTransform

FixedTransform(Vector3d, FixedQuaternion, Vector3d, FixedTransform?)

Initializes a transform from authoritative 3D local components.

public FixedTransform(Vector3d localPosition, FixedQuaternion localRotation, Vector3d localScale, FixedTransform? parent = null)

Parameters

localPosition Vector3d
localRotation FixedQuaternion
localScale Vector3d
parent FixedTransform

Properties

LocalEulerAngles

Gets or sets the local rotation as Euler angles in degrees.

public Vector3d LocalEulerAngles { get; set; }

Property Value

Vector3d

LocalMatrix

Gets the matrix rebuilt from the authoritative local components.

public Fixed4x4 LocalMatrix { get; }

Property Value

Fixed4x4

LocalPosition

Gets or sets the authoritative local translation.

public Vector3d LocalPosition { get; set; }

Property Value

Vector3d

LocalPositionXZ

Gets or sets local X/Z position while preserving local Y.

public Vector2d LocalPositionXZ { get; set; }

Property Value

Vector2d

LocalRotation

Gets or sets the authoritative normalized local rotation.

public FixedQuaternion LocalRotation { get; set; }

Property Value

FixedQuaternion

LocalRotationXZRadians

Gets or sets local X/Z rotation in radians from planar right toward planar forward.

public Fixed64 LocalRotationXZRadians { get; set; }

Property Value

Fixed64

Remarks

The setter replaces pitch and roll with a pure Y-axis rotation.

LocalScale

Gets or sets the authoritative exact signed local scale.

public Vector3d LocalScale { get; set; }

Property Value

Vector3d

LocalScaleXZ

Gets or sets local X/Z scale while preserving local Y.

public Vector2d LocalScaleXZ { get; set; }

Property Value

Vector2d

LocalToWorldMatrix

Gets the iteratively composed local-to-world matrix.

public Fixed4x4 LocalToWorldMatrix { get; }

Property Value

Fixed4x4

Remarks

Row-vector order multiplies this local matrix by its parent local matrix and then each ancestor local matrix. Reading is linear in hierarchy depth and allocation-free.

LossyScale

Gets canonical signed lossy scale from the composed matrix.

public Vector3d LossyScale { get; }

Property Value

Vector3d

Remarks

Zero magnitudes are preserved and reflected handedness is canonicalized to negative X.

Parent

Gets the optional parent transform.

public FixedTransform? Parent { get; }

Property Value

FixedTransform

WorldPosition

Gets world translation from the composed matrix.

public Vector3d WorldPosition { get; }

Property Value

Vector3d

WorldPositionXZ

Gets world position projected onto X/Z.

public Vector2d WorldPositionXZ { get; }

Property Value

Vector2d

WorldRotation

Gets the normalized rotational parent-to-child quaternion chain.

public FixedQuaternion WorldRotation { get; }

Property Value

FixedQuaternion

Remarks

This is an orientation chain derived only from stored local quaternions. It is independent of scale, reflections, and any shear in LocalToWorldMatrix, so it is not a decomposition of that matrix.

WorldRotationXZRadians

Gets world X/Z rotation in radians from planar right toward planar forward.

public Fixed64 WorldRotationXZRadians { get; }

Property Value

Fixed64

Methods

InverseTransformPoint(Vector3d)

Transforms a point from world space to local space through the complete composed affine hierarchy.

public Vector3d InverseTransformPoint(Vector3d point)

Parameters

point Vector3d

Returns

Vector3d

Exceptions

InvalidOperationException

The composed transform is singular or unrepresentable, or the final local-space point is not representable.

InverseTransformPointXZ(Vector2d)

Transforms a point from world X/Z space to local X/Z space through a plane-preserving affine hierarchy.

public Vector2d InverseTransformPointXZ(Vector2d point)

Parameters

point Vector2d

Returns

Vector2d

Exceptions

InvalidOperationException

The hierarchy couples X/Z with Y, is singular or unrepresentable, or the final local-space point is not representable.

SetParentKeepingLocal(FixedTransform?)

Changes the parent without changing any local component.

public void SetParentKeepingLocal(FixedTransform? parent)

Parameters

parent FixedTransform

Exceptions

ArgumentException

The proposed parent would create a cycle.

TransformPoint(Vector3d)

Transforms a point from local space to world space through the complete composed affine hierarchy.

public Vector3d TransformPoint(Vector3d point)

Parameters

point Vector3d

Returns

Vector3d

Exceptions

InvalidOperationException

The composed transform or final world-space point is not representable.

TransformPointXZ(Vector2d)

Transforms a point from local X/Z space to world X/Z space through a plane-preserving affine hierarchy.

public Vector2d TransformPointXZ(Vector2d point)

Parameters

point Vector2d

Returns

Vector2d

Exceptions

InvalidOperationException

The hierarchy couples X/Z with Y, or the composed transform or final world-space point is not representable.

TryCreateFromLocalMatrix(Fixed4x4, out FixedTransform?, FixedTransform?)

Attempts to create a transform from a strict, nonsingular local TRS matrix.

public static bool TryCreateFromLocalMatrix(Fixed4x4 localMatrix, out FixedTransform? transform, FixedTransform? parent = null)

Parameters

localMatrix Fixed4x4
transform FixedTransform
parent FixedTransform

Returns

bool

Remarks

Perspective, shear, singular, and non-round-trippable inputs return null and false.

TryGetLocalToWorldMatrix(out Fixed4x4)

Attempts to get the iteratively composed local-to-world matrix without intermediate saturation.

public bool TryGetLocalToWorldMatrix(out Fixed4x4 matrix)

Parameters

matrix Fixed4x4

Returns

bool

Remarks

Failure returns a zero matrix and does not mutate this transform or any ancestor.

TryGetLossyScale(out Vector3d)

Attempts to get canonical signed lossy scale from strict hierarchy composition.

public bool TryGetLossyScale(out Vector3d scale)

Parameters

scale Vector3d

Returns

bool

Remarks

Failure returns zero and does not mutate this transform or any ancestor.

TryGetWorldToLocalMatrix(out Fixed4x4)

Attempts to get a verified inverse of the composed local-to-world matrix.

public bool TryGetWorldToLocalMatrix(out Fixed4x4 matrix)

Parameters

matrix Fixed4x4

Returns

bool

Remarks

The inverse candidate must multiply to identity in both orders within CanonicalSinCosErrorBound. Singular, saturated, and unrepresentable candidates return identity and false.

TryInverseTransformPoint(Vector3d, out Vector3d)

Attempts to transform a point from world space to local space through the complete composed affine hierarchy.

public bool TryInverseTransformPoint(Vector3d point, out Vector3d result)

Parameters

point Vector3d
result Vector3d

Returns

bool

TryInverseTransformPointXZ(Vector2d, out Vector2d)

Attempts to transform a point from world X/Z space to local X/Z space through a plane-preserving affine hierarchy.

public bool TryInverseTransformPointXZ(Vector2d point, out Vector2d result)

Parameters

point Vector2d
result Vector2d

Returns

bool

TrySetParentKeepingWorld(FixedTransform?)

Attempts to change the parent while preserving the complete world matrix.

public bool TrySetParentKeepingWorld(FixedTransform? parent)

Parameters

parent FixedTransform

Returns

bool

Remarks

Failure leaves the parent and every local component unchanged.

Exceptions

ArgumentException

The proposed parent would create a cycle.

TrySetWorldPose(Vector3d, FixedQuaternion)

Attempts to set world position and normalized world rotation atomically.

public bool TrySetWorldPose(Vector3d position, FixedQuaternion rotation)

Parameters

position Vector3d
rotation FixedQuaternion

Returns

bool

Remarks

Relative rotation is derived from the parent's stored rotational hierarchy, independent of scale and shear. Failure leaves both local position and local rotation unchanged.

TrySetWorldPosition(Vector3d)

Attempts to set world position through the verified parent inverse.

public bool TrySetWorldPosition(Vector3d position)

Parameters

position Vector3d

Returns

bool

Remarks

Failure leaves local position unchanged.

TryTransformPoint(Vector3d, out Vector3d)

Attempts to transform a point from local space to world space through the complete composed affine hierarchy.

public bool TryTransformPoint(Vector3d point, out Vector3d result)

Parameters

point Vector3d
result Vector3d

Returns

bool

TryTransformPointXZ(Vector2d, out Vector2d)

Attempts to transform a point from local X/Z space to world X/Z space through a plane-preserving affine hierarchy.

public bool TryTransformPointXZ(Vector2d point, out Vector2d result)

Parameters

point Vector2d
result Vector2d

Returns

bool