Class Sun

  • All Implemented Interfaces:
    TransformProvider

    public class Sun
    extends Node
    Represents the "sun" - the default directional light in the scene.

    The following method will throw UnsupportedOperationException when called: setParent(NodeParent) - Sunlight's parent cannot be changed, it is always the scene.

    All other functionality in Node is supported. You can access the position and rotation of the sun, assign a collision shape to the sun, or add children to the sun. Disabling the sun turns off the default directional light.

    • Method Detail

      • setParent

        public void setParent​(@Nullable
                              NodeParent parent)
        Description copied from class: Node
        Changes the parent node of this node. If set to null, this node will be detached from its parent. The local position, rotation, and scale of this node will remain the same. Therefore, the world position, rotation, and scale of this node may be different after the parent changes.

        The parent may be another Node or a Scene. If it is a scene, then this Node is considered top level. Node.getParent() will return null, and Node.getScene() will return the scene.

        Overrides:
        setParent in class Node
        Parameters:
        parent - The new parent that this node will be a child of. If null, this node will be detached from its parent.
        See Also:
        Node.getParent(), Node.getScene()