μScene
    Preparing search index...

    Class RenderableNodeAbstract

    A node in a scene graph that can be rendered.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Create a renderable node in a scene graph.

      Parameters

      • enabled: boolean = true

        Whether or not the node should be enabled.

      • transparent: boolean = true

        Whether or not the node may be not completely opaque. Setting this to false can improve performance but may make transparent nodes display wrong.

      • ui: boolean = false

        Whether or not the node belongs to a user interface or a 2D scene. Setting this to true can improve performance but may make non-user interface nodes display in the wrong order.

      Returns RenderableNode

    Properties

    enabled: boolean

    Whether or not this node is enabled. Disabled nodes and their descendents are not included in traversals.

    matrix: Matrix4Like

    The transformation matrix of this node relative to its parent.

    transparent: boolean

    Whether or not this node may be not completely opaque.

    ui: boolean

    Whether or not this node belongs to a user interface or a 2D scene.

    Accessors

    • get scaling(): Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      The scaling of this node relative to its parent.

      Returns Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      • Readonlybuffer: Readonly<
            Pick<
                Float32Array["buffer"],
                "byteLength"
                | "maxByteLength"
                | "slice"
                | typeof Symbol.toStringTag,
            >,
        >

        The ArrayBuffer instance referenced by the array.

    • set scaling(value: Readonly<Vector3Like>): void

      The scaling of this node relative to its parent.

      Parameters

      Returns void

    • get translation(): Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      The translation of this node relative to its parent.

      Returns Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      • Readonlybuffer: Readonly<
            Pick<
                Float32Array["buffer"],
                "byteLength"
                | "maxByteLength"
                | "slice"
                | typeof Symbol.toStringTag,
            >,
        >

        The ArrayBuffer instance referenced by the array.

    • set translation(value: Readonly<Vector3Like>): void

      The translation of this node relative to its parent.

      Parameters

      Returns void

    • get worldMat(): Readonly<Matrix4Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      The world matrix of this node, which represents its transformation relative to the origin.

      Returns Readonly<Matrix4Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      • Readonlybuffer: Readonly<
            Pick<
                Float32Array["buffer"],
                "byteLength"
                | "maxByteLength"
                | "slice"
                | typeof Symbol.toStringTag,
            >,
        >

        The ArrayBuffer instance referenced by the array.

    • get worldTranslation(): Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      The translation of this node relative to the origin.

      Returns Readonly<Vector3Like> & Readonly<
          Omit<
              Float32Array<ArrayBufferLike>,
              "buffer" | "copyWithin" | "fill" | "reverse" | "set" | "sort",
          >,
      > & {
          buffer: Readonly<
              Pick<
                  Float32Array["buffer"],
                  "byteLength"
                  | "maxByteLength"
                  | "slice"
                  | typeof Symbol.toStringTag,
              >,
          >;
      }

      • Readonlybuffer: Readonly<
            Pick<
                Float32Array["buffer"],
                "byteLength"
                | "maxByteLength"
                | "slice"
                | typeof Symbol.toStringTag,
            >,
        >

        The ArrayBuffer instance referenced by the array.

    Methods

    • Add a child to this node.

      Parameters

      • node: Node

        The child. The child's parent will be updated to point to this node. If the child already had a parent, it will be removed from that parent's children.

      Returns void

    • Reset this node's transformation relative to its parent.

      Returns void

    • Remove a child from this node.

      Parameters

      • node: Node

        The child. The child's parent will be updated to point to nothing.

      Returns void

    • Rotate this node around the X-axis relative to its parent.

      Parameters

      • r: number

        The number of radians to rotate by.

      Returns void

    • Rotate this node around the Y-axis relative to its parent.

      Parameters

      • r: number

        The number of radians to rotate by.

      Returns void

    • Rotate this node around the Z-axis relative to its parent.

      Parameters

      • r: number

        The number of radians to rotate by.

      Returns void

    • Perform a function on this node and each of its children recursively.

      Parameters

      • f:
            | (
                (
                    self: Node,
                    worldMat: Float32Array<ArrayBufferLike> & Matrix4Like,
                ) => boolean
            )
            | (
                (
                    self: Node,
                    worldMat: Float32Array<ArrayBufferLike> & Matrix4Like,
                ) => void
            )

        The function to perform for each node. Receives as an argument the node and the node's transformation matrix relative to the node on which the traversal started. If this function returns false, the node's children are not included in the traversal.

      Returns void