Page Summary
-
Sunclass represents the default directional light source in a Sceneform scene, inheriting functionalities from theNodeclass. -
While most
Nodefunctionalities are supported, attempting to change theSun's parent usingsetParent()will throw anUnsupportedOperationException. -
The
Sun's position, rotation, collision shape can be accessed and modified, and adding children to it is permitted. -
Disabling the
Sunnode effectively turns off the default directional light within the scene.
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.
Public Methods
Inherited Methods
Public Methods
public void setParent ( NodeParent parent)
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. getParent()
will return null, and getScene()
will return the scene.

