Transform#
A 3D pose: position in metres, rotation as a quaternion, scale (1 = authored size). A record: change one part with pose with { Position = p }. Yaw by θ about +Y is Quaternion.CreateFromAxisAngle(Vector3.UnitY, θ).
public sealed record Transform(Vector3 Position, Quaternion Rotation, Vector3 Scale)Record properties#
| Property | Type | Access | Constructor default |
|---|---|---|---|
Position | Vector3 | get; init; | required |
Rotation | Quaternion | get; init; | required |
Scale | Vector3 | get; init; | required |
Identity#
public static Transform Identity { get; }Initial value: new(Vector3.Zero, Quaternion.Identity, Vector3.One)
At the origin, unrotated, scale 1.
Matrix#
[System.Text.Json.Serialization.JsonIgnore]
public Matrix4x4 Matrix { get; }The pose as a scale-rotate-translate matrix.
Source#
- Model3D.cs