API reference
API reference
Select your platform
No SDKs available
No versions available

TransformPosesJob Struct

Extends IJobFor
A job which transforms an array of TrackingSpacePose to a new space.
This job multiples each TrackingSpacePose in Poses by Transform and stores the result back into Poses (that is, in-place).
This job is useful for converting an anchor's tracking space pose into world space:
void TransformPoses(NativeArray\<TrackingSpacePose\> poses, Transform transform)
{
    var jobHandle = new TransformPosesJob
    {
        Poses = poses,
        Transform = transform.localToWorldMatrix,
        Rotation = transform.rotation,
    }.Schedule(poses.Length);
}
Read more about Unity's job system here.

Fields

The poses to transform.
The transform to apply to each TrackingSpacePose position in Poses.
You can generate a Matrix4x4 from a UnityEngine.Transform with transform.localToWorldMatrix.
The rotation to apply to each TrackingSpacePose rotation in Poses.
Typically, this should be the rotational component of Transform. It is separate because the rotation is not guaranteed to be extracted from a Matrix4x4 if, for example, it has non-uniform scale.

Member Functions

void IJobFor. Execute
( int index )
Did you find this page helpful?