Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SceneNode

This class describes a node in a scene hierarchy. To render a scene, a renderer can traverse the hierarchy of SceneNodes, while recursively applying the transformations specfied by each node. Every node contains components that describe the contents of the node, e.g. the contained geometry or the applied transformation.

Hierarchy

  • SceneNode

Index

Constructors

constructor

Properties

Protected _components

_components: SceneNodeComponent[] = new Array<SceneNodeComponent>()

Protected _name

_name: string
see

name

Protected _nodes

_nodes: SceneNode[] = new Array<SceneNode>()
see

nodes

Protected _parent

_parent: SceneNode | undefined
see

parent

Accessors

components

isLeaf

  • get isLeaf(): boolean
  • Returns whether this node is a leaf, i.e. there are no child nodes attached to it.

    Returns boolean

isRoot

  • get isRoot(): boolean
  • Returns whether this is the root node, i.e. it has no parent.

    Returns boolean

name

  • get name(): string

nodes

parent

Methods

addComponent

addNode

componentsOfType

  • Find all components of a specfic type that are registered on this node.

    Parameters

    • type: string

      @todo Name of component type to search for

    Returns Array<SceneNodeComponent>

traverse

  • Traverses the node hierarchy starting at this node and applies the given callback to each node.

    Parameters

    • callback: NodeCallback

      Function that will be called for each node in the tree.

    Returns void