Interface StageNode3D

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

public interface StageNode3D extends StageNode
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 StageNode.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
    default void
    Detaches this node from its parent, removing it from the stage.
    Returns this node's global transform, which is interpreted relative to the stage.
    @Nullable Group
    Returns this node's parent node.
    Returns this node's local transform, which is interpreted relative to its parent node.

    Methods inherited from interface StageNode

    animate
  • Method Details

    • getParent

      @Nullable Group getParent()
      Description copied from interface: StageNode
      Returns this node's parent node. Returns null if thos node does not have a parent, or if this is the root node.
      Specified by:
      getParent in interface StageNode
    • detach

      default void detach()
      Description copied from interface: StageNode
      Detaches this node from its parent, removing it from the stage. Does nothing if this node does not have a parent.
      Specified by:
      detach in interface StageNode
    • 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.