Hierarchy

  • ViewerUtils

Methods

  • Animates a single property of a target object from its current value to a given target value.
    Supported property types are defined by AnimatableProperties (i.e. number, Vector3, Color3).

    Type Parameters

    • T

    • K extends "position" | "scaling" | "rotation" | "influence" | "albedoColor"

    Parameters

    • target: T

      The object whose property should be animated

    • property: K

      The name of the property to animate. Must be a key of target whose value type is supported.

    • value: T[K]

      The target value the property should reach at the end of the animation.

    • animationName: string

      Name given to the internally created animation group.
      Use a stable, unique name per animated property so that concurrent calls can be identified (e.g. "$parameterAnimation.position.MyNode").

    • animationTimeMs: number

      Duration of the animation in milliseconds.

    Returns Promise<void>

  • Removes transformation data from the mesh and stores it in the geometry, which is called "baking". Also considers the geometry change from morph targets and skeletons.

    Parameters

    • mesh: Mesh
    • Optional settings: BakeGeometrySettings

      Optionally avoid baking the transformation, as this only works conveniently if the parent structure is baked as well. Baking morph targets only is a use case when preparing a mesh for CSG operations, which doesn't consider morph targets (yet).

    Returns void

  • Finds all child nodes (TransformNodes, Meshes, but also Lights, Cameras, etc...) that match a given criteria.

    Type Parameters

    • T extends Node<T>

    Parameters

    • Optional node: Node

      If left empty, all nodes of the scene are considered

    • Optional criteria: FindNodeCriteria<T>

      If left empty, all child nodes are returned

    Returns T[]

  • Finds nearest node that matches a given criteria.
    Returns undefined if no node could be found.

    Type Parameters

    • T extends Node<T>

    Parameters

    Returns undefined | T

Generated using TypeDoc