APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene

public non-sealed Class DirectionalLight

extends LightBase
Class Inheritance
Imports
com.sun.javafx.scene.DirectionalLightHelper, .DirtyBits, .NodeHelper, com.sun.javafx.sg.prism.NGDirectionalLight, .NGNode, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, javafx.geometry.Point3D, javafx.scene.paint.Color, .PhongMaterial

A light that illuminates an object from a specific direction. The direction is defined by the direction vector property.

DirectionalLights can represent strong light sources that are far enough from the objects they illuminate that their light rays appear to be parallel. Because these light sources are considered to be infinitely far, they cannot be attenuated. The sun is a common light source that can be simulated with this light type.

Since
18
See Also
PhongMaterial

Field Summary

Modifier and TypeField and Description
private static final Point3D
private ObjectProperty<Point3D>
direction

The direction vector of the directional light.

Constructor Summary

AccessConstructor and Description
public
DirectionalLight()

Creates a new DirectionalLight with a default Color.WHITE color.

public
DirectionalLight(Color
the color of the light source
color
)

Creates a new DirectionalLight with the specified color.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Point3D>
private NGNode
private void
public final Point3D
public final void
Inherited from javafx.scene.LightBase:
colorPropertygetColorgetExclusionScopegetLightDoublePropertygetScopeisLightOnlightOnPropertyscenesChangedsetColorsetLightOn

Field Detail

DEFAULT_DIRECTIONback to summary
private static final Point3D DEFAULT_DIRECTION
directionback to summary
private ObjectProperty<Point3D> direction

The direction vector of the directional light. It can be rotated by setting a rotation transform on the DirectionalLight. The vector need not be normalized.

Default Value
Point3D(0, 0, 1)

Constructor Detail

DirectionalLightback to summary
public DirectionalLight()

Creates a new DirectionalLight with a default Color.WHITE color.

DirectionalLightback to summary
public DirectionalLight(Color color)

Creates a new DirectionalLight with the specified color.

Parameters
color:Color

the color of the light source

Method Detail

directionPropertyback to summary
public final ObjectProperty<Point3D> directionProperty()
doCreatePeerback to summary
private NGNode doCreatePeer()
doUpdatePeerback to summary
private void doUpdatePeer()

Hides javafx.scene.LightBase.doUpdatePeer.

getDirectionback to summary
public final Point3D getDirection()
setDirectionback to summary
public final void setDirection(Point3D value)