Interface StageNode3D

All Known Subinterfaces:
Mesh
All Known Implementing Classes:
Group, Light

public interface StageNode3D
Shared interface for all 3D graphics that can be added to the stage's scene graph. The renderer draws all graphics on the stage after each frame update by visiting all nodes.

Nodes have two different "transforms", which determines how and where they are drawn by the renderer. The local transform is interpreted relative to its parent node. Combining a node's local transform with the transform of its parent results in its global transform, which is interpreted relative to the stage.

Nodes do not implement the Updatable interface. Nodes are not expected to be updated every frame: The renderer will generally not draw graphics that are not currently visible, for performance reasons. Therefore, instead of relying on frame updates, the renderer will use animate(Timer) to update currently visible nodes while rendering the stage.

Although the stage can contain both 2D and 3D graphics, it has a hard separation between the two. Refer to StageNode2D for the equivalent interface for 2D graphics.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    animate(Timer animationTimer)
    Called by the renderer at the end of frame updates, while rendering the stage.
    Returns this node's global transform, which is interpreted relative to the stage.
    Returns this node's local transform, which is interpreted relative to its parent node.
  • Method Details

    • animate

      void animate(Timer animationTimer)
      Called by the renderer at the end of frame updates, while rendering the stage. animationTimer contains the elapsed time since the currently active scene was started. This allows animations to display correctly, without the need to update every single node during each frame update.
    • getTransform

      Transform3D getTransform()
      Returns this node's local transform, which is interpreted relative to its parent node. The local transform can be modified by application code to modify how and where the node is displayed.
    • getGlobalTransform

      Transform3D getGlobalTransform()
      Returns this node's global transform, which is interpreted relative to the stage. The global transform is updated by the renderer when drawing the stage at the end of frame updates. Recalculating the global transform is relatively expensive, and is therefore only done once per frame. This means that any changes made to a node's local transform since the last frame update may not yet been reflected in the current state of its global transform.