Class TransformationUtil
Utilities for the ProgramToMcTransform chain. Each entry has “Source” (string) and “Mat4d” (16-element JsonArray). AddOrReplaceTransform(JsonObject, string, Mat4d) inserts or replaces an entry by source name. GetComposedTransform(JsonObject) composes all entries into a single Mat4d.
public static class TransformationUtil
- Inheritance
-
TransformationUtil
- Inherited Members
Fields
Mat4dKey
public const string Mat4dKey = "Mat4d"
Field Value
SourceKey
public const string SourceKey = "Source"
Field Value
Methods
AddOrReplaceTransform(JsonObject, string, Mat4d)
Adds or replaces a named transformation entry in the chain. If an entry with the same source already exists, it is replaced in-place. Otherwise the new entry is appended.
public static void AddOrReplaceTransform(JsonObject json, string source, Mat4d mat)
Parameters
jsonJsonObjectsourcestringmatMat4d
GetComposedTransform(JsonObject)
Composes all entries in the chain into a single Mat4d (left-to-right multiplication). Returns identity if chain is empty or absent.
public static Mat4d GetComposedTransform(JsonObject json)
Parameters
jsonJsonObject
Returns
GetTransformBySource(JsonObject, string)
Gets a specific entry's Mat4d by source name. Returns identity if not found.
public static Mat4d GetTransformBySource(JsonObject json, string source)
Parameters
jsonJsonObjectsourcestring
Returns
GetVec3d(JsonObject, string, Vec3d)
Reads a Vec3d from a sub-object with X/Y/Z keys.
Returns fallback if not present.
public static Vec3d GetVec3d(JsonObject json, string sectionKey, Vec3d fallback)
Parameters
jsonJsonObjectsectionKeystringfallbackVec3d
Returns
SetVec3d(JsonObject, string, Vec3d)
Writes a Vec3d as a sub-object with X/Y/Z keys.
public static void SetVec3d(JsonObject json, string sectionKey, Vec3d v)
Parameters
jsonJsonObjectsectionKeystringvVec3d