Node - a builder for the GLTF node object

Hierarchy

  • default<
        {
            children: Node[];
            matrix: Mat4;
            mesh: Mesh;
            rotation: Vec4;
            scale: Vec3;
            translation: Vec3;
        },
    >
    • Node

Methods

  • Adds a child node under this one

    Parameters

    Returns Node

    this

  • Sets a matrix transformation property on this node. Should not be used in conjunction with translation, rotation or scale properties.

    Parameters

    • matrix: Mat4

      A 4x4 transformation matrix stored in column-major order. Can be an array of numbers or a typed array.

    Returns Node

    this

  • Sets the mesh for this node

    Parameters

    Returns Node

    this

  • Sets the node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar. Should not be used in conjunction with the matrix property.

    Parameters

    • x: number
    • y: number
    • z: number
    • w: number

    Returns Node

    this

  • Sets the node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar. Should not be used in conjunction with the matrix property.

    Parameters

    • rotation: Vec4

      a 4D vector representing the quaternion. Can be an array or typed array.

    Returns Node

    this

  • Sets the node's non-uniform scale, given as the scaling factors along the x, y, and z axes. Should not be used in conjunction with the matrix property.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Node

    this

  • Sets the node's non-uniform scale, given as the scaling factors along the x, y, and z axes. Should not be used in conjunction with the matrix property.

    Parameters

    • scale: Vec3

      a 3D vector formatted as an array or typed array.

    Returns Node

    this

  • Sets the translation of this node along the x, y, and z axes. Should not be used in conjunction with the matrix property.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Node

    this

  • Sets the translation of this node along the x, y, and z axes. Should not be used in conjunction with the matrix property.

    Parameters

    • translation: Vec3

      a 3D vector formatted as an array or typed array.

    Returns Node

    this