Skip to main content

ObjectTransform

class · immutable data
public class ObjectTransform

Namespace: AR51.Unity.SDK

A plain, immutable data class describing a single object's pose. Construct one and hand it to ObjectTransformConsumer.OnObject; the consumer creates (if new) or updates a prefab GameObject keyed by Id, selecting the prefab by Type. All properties are get-only — there is no way to mutate a pose after construction.

Units

Position is in Unity world-space meters. Scale is a local scale (unitless multiplier). Use a Quaternion for Rotation, not Euler degrees.

Properties

All get-only.

PropertyTypeDescription
Idstringobject identifier — the key the consumer tracks GameObjects by
Typestringobject type — selects which prefab the consumer instantiates
PositionVector3world-space position, in meters
RotationQuaternionworld-space rotation
ScaleVector3local scale

Constructors

public ObjectTransform(string id, string type, Vector3 position);
public ObjectTransform(string id, string type, Vector3 position, Quaternion rotation);
public ObjectTransform(string id, string type, Vector3 position, Quaternion rotation, Vector3 scale);

Three overloads, from minimal to full pose. Omitted arguments take Unity defaults:

ConstructorRotationScale
(id, type, position)Quaternion.identityVector3.one
(id, type, position, rotation)suppliedVector3.one
(id, type, position, rotation, scale)suppliedsupplied
Exampleinferred
// Place an object 2 m forward, 1 m up — meters, Unity world space.
var pose = new ObjectTransform(
id: "crate-7",
type: "crate",
position: new Vector3(0f, 1f, 2f));

ObjectTransformConsumer.Instance.OnObject(pose);

See also

Was this page helpful?