Hierarchy (view full)

Constructors

Properties

appendChild: ((_child) => void)

Simply calls addChild. This reference is here solely because appendChild is the equivalent method in DOM. See and preferably use addChild

Type declaration

    • (_child): void
    • Parameters

      • _child: Node

      Returns void

mtxWorld: Matrix4x4
nNodesInBranch: number

The number of nodes of the whole branch including this node and all successors

name: string
radius: number

The radius of the bounding sphere in world dimensions enclosing the geometry of this node and all successors in the branch

timestampUpdate: number

Accessors

  • get cmpTransform(): ComponentTransform
  • Shortcut to retrieve this nodes ComponentTransform

    Returns ComponentTransform

  • get mtxLocal(): Matrix4x4
  • Shortcut to retrieve the local Matrix4x4 attached to this nodes ComponentTransform Fails if no ComponentTransform is attached

    Returns Matrix4x4

  • get nChildren(): number
  • Returns the number of children attached to this

    Returns number

Methods

  • Adds the given reference to a node to the list of children, if not already in

    Parameters

    • _child: Node

    Returns void

    Throws

    Error when trying to add an ancestor of this

  • Adds the given reference to a node to the list of children at the given index. If it is already a child, it is moved to the new position.

    Parameters

    • _child: Node
    • _index: number

    Returns void

  • Adds an event listener to the node. The given handler will be called when a matching event is passed to the node. Deviating from the standard EventTarget, here the _handler must be a function and _capture is the only option.

    Parameters

    • _type: string
    • _handler: EventListenerUnified
    • Optional _capture: boolean

    Returns void

  • Broadcasts a synthetic event to this node and from there to all nodes deeper in the hierarchy, invoking matching handlers of the nodes listening to the capture phase. Watch performance when there are many nodes involved

    Parameters

    • _event: Event

    Returns void

  • Dispatches a synthetic event to target. This implementation always returns true (standard: return true only if either event's cancelable attribute value is false or its preventDefault() method was not invoked) The event travels into the hierarchy to this node dispatching the event, invoking matching handlers of the nodes ancestors listening to the capture phase, than the matching handler of the target node in the target phase, and back out of the hierarchy in the bubbling phase, invoking appropriate handlers of the anvestors

    Parameters

    • _event: Event

    Returns boolean

  • Returns the first compontent found of the given class attached this node or null, if list is empty or doesn't exist

    Type Parameters

    • T extends Component

    Parameters

    • _class: (new () => T)
        • new (): T
        • Returns T

    Returns T

  • Returns a clone of the list of components of the given class attached to this node.

    Type Parameters

    • T extends Component

    Parameters

    • _class: (new () => T)
        • new (): T
        • Returns T

    Returns T[]

  • Generator yielding the node and all decendants in the graph below for iteration Inactive nodes and their descendants can be filtered

    Parameters

    • Optional _active: boolean

    Returns IterableIterator<Node>

  • Returns true if this node is a descendant of the given node, directly or indirectly, else false

    Parameters

    • _ancestor: Node

    Returns boolean

  • Returns true if the given timestamp matches the last update timestamp this node underwent, else false

    Parameters

    • _timestampUpdate: number

    Returns boolean

  • Removes all components of the given class attached to this node.

    Parameters

    • _class: (new () => Component)
        • new (): Component
        • Returns Component

    Returns void

  • Removes an event listener from the node. The signature must match the one used with addEventListener

    Parameters

    • _type: string
    • _handler: EventListenerUnified
    • Optional _capture: boolean

    Returns void

  • Replaces a child node with another, preserving the position in the list of children

    Parameters

    • _replace: Node
    • _with: Node

    Returns boolean

  • Return the Node or Component found at the given path starting from the given node or undefined if not found

    Type Parameters

    • T = Node | Component

    Parameters

    • _from: Node | Component
    • _path: string

    Returns T

  • Return the mutator-like path string to get from one node to another or null if no path is found e.g.:

    "node/parent/children/1/components/ComponentSkeleton/0"
    

    Parameters

    • _from: Node | Component
    • _to: Node | Component

    Returns string