Component used for tracking objects in 3D space.

// @input Component.ObjectTracking3D objectTracking3D

script.objectTracking3D.onTrackingStarted = function(){
print("ObjectTracking3D Started Tracking");
}

script.objectTracking3D.onTrackingLost = function(){
print("ObjectTracking3D Lost Tracking");
}
interface ObjectTracking3D {
    attachmentModeInheritRotation: boolean;
    attachmentModeInheritScale: boolean;
    enabled: boolean;
    objectIndex: number;
    onTrackingLost: (() => void);
    onTrackingStarted: (() => void);
    sceneObject: SceneObject;
    trackingAsset: Object3DAsset;
    trackingMode: ObjectTracking3D.TrackingMode;
    trackPosition: boolean;
    uniqueIdentifier: string;
    addAttachmentPoint(name: string, object: SceneObject): void;
    createAttachmentPoint(name: string): SceneObject;
    destroy(): void;
    getAttachedObjects(name: string): SceneObject[];
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isAttachmentPointTracking(name: string): boolean;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    isTracking(): boolean;
    removeAttachmentPoint(object: SceneObject): void;
}

Hierarchy (view full)

Properties

attachmentModeInheritRotation: boolean

Whether world rotation is applied or not.

attachmentModeInheritScale: boolean

Whether world scale is applied or not.

enabled: boolean

If disabled, the Component will stop enacting its behavior.

objectIndex: number

Index of the object to track, starting at 0. Useful when tracking multiple instances of the same type of object.

onTrackingLost: (() => void)

Function called when tracking is lost.

onTrackingStarted: (() => void)

Function called when tracking begins.

sceneObject: SceneObject
trackingAsset: Object3DAsset

Asset containing tracking parameters, such as the tracking model and specific options.

Strategy for updating attached SceneObjects.

trackPosition: boolean

When true, the attached root SceneObject's world position will be updated to match the tracked object's world position.

uniqueIdentifier: string

Methods

  • Attaches the SceneObject to the specified attachment point.

    Parameters

    Returns void

  • Creates a SceneObject which is attached to the specified attachment point.

    Parameters

    • name: string

    Returns SceneObject

  • Destroys the component.

    Returns void

  • Returns all SceneObjects currently attached to the specified point.

    Parameters

    • name: string

    Returns SceneObject[]

  • Returns the name of this object's type.

    Returns string

  • Returns whether the specified attachment point is being tracked.

    Parameters

    • name: string

    Returns boolean

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Returns whether this object is currently being tracked.

    Returns boolean

  • Parameters

    Returns void