Capítulo 751 de 859

Chapter 751: NodeFrame

Core Idea

Management class for updating nodes. The module tracks metrics like the elapsed time, delta time, the render and frame ID to correctly call the node update methods Node#updateBefore, Node#update and Node#updateAfter depending on the node's configuration.

Key Concepts

  • camera : Camera: A reference to the current camera.
  • deltaTime : number: The delta time in seconds.
  • frameId : number: The frame ID.
  • material : Material: A reference to the current material.
  • object : Object3D: A reference to the current 3D object.
  • renderId : number: The render ID.
  • renderer : Renderer: A reference to the current renderer.
  • scene : Scene: A reference to the current scene.
  • time : number: The elapsed time in seconds.
  • updateAfterMap : WeakMap.<Node, Object>: Used to control the Node#updateAfter call.

Reference Tables

Constructor

Signature
new NodeFrame()

Properties

PropertyDescription
.camera : CameraA reference to the current camera.
.deltaTime : numberThe delta time in seconds.
.frameId : numberThe frame ID.
.material : MaterialA reference to the current material.
.object : Object3DA reference to the current 3D object.
.renderId : numberThe render ID.
.renderer : RendererA reference to the current renderer.
.scene : SceneA reference to the current scene.
.time : numberThe elapsed time in seconds.
.updateAfterMap : WeakMap.<Node, Object>Used to control the Node#updateAfter call.
.updateBeforeMap : WeakMap.<Node, Object>Used to control the Node#updateBefore call.
.updateMap : WeakMap.<Node, Object>Used to control the Node#update call.

Methods

MethodDescription
.update()Updates the internal state of the node frame. This method is called by the renderer in its internal animation loop.
.updateAfterNode( node : Node )This method executes the Node#updateAfter for the given node. It makes sure Node#updateAfterType is honored meaning the update is only executed o…
.updateBeforeNode( node : Node )This method executes the Node#updateBefore for the given node. It makes sure Node#updateBeforeType is honored meaning the update is only execut…
.updateNode( node : Node )This method executes the Node#update for the given node. It makes sure Node#updateType is honored meaning the update is only executed once per frame, rende…

Key Takeaways

  1. Most relevant properties: camera, deltaTime, frameId, material.
  2. Key methods: update, updateAfterNode, updateBeforeNode, updateNode.

Connects To