Attaches the SceneObject to the mesh surface of a different SceneObject. See the Pin To Mesh guide for more information.

interface PinToMeshComponent {
    enabled: boolean;
    offsetPosition: vec3;
    offsetRotation: vec3;
    orientation: PinToMeshComponent.Orientation;
    pinUV: vec2;
    preferredTriangle: number;
    preferredUVLayerIndex: number;
    sceneObject: SceneObject;
    target: BaseMeshVisual;
    uniqueIdentifier: string;
    useInterpolatedVertexNormal: boolean;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

enabled: boolean

If disabled, the Component will stop enacting its behavior.

offsetPosition: vec3

The position offset to apply.

offsetRotation: vec3

The euler angle offset to apply. Only has an effect when orientation is set to PositionAndDirection.

The orientation type to use.

pinUV: vec2

The UV coordinates on the target mesh to attach to.

preferredTriangle: number

The preferred triangle index to attach to when multiple triangles contain the desired UV coordinate.

preferredUVLayerIndex: number

Index of the UV coordinate set to use for pinning.

sceneObject: SceneObject

The target mesh to attach to.

uniqueIdentifier: string
useInterpolatedVertexNormal: boolean

If enabled, interpolated vertex normals will be used when calculating the attachment position.

Methods

  • Destroys the component.

    Returns void

  • Returns the name of this object's type.

    Returns string

  • 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