Package com.jme3.light
Class DirectionalLight
java.lang.Object
com.jme3.light.Light
com.jme3.light.DirectionalLight
DirectionalLight is a light coming from a certain direction in world space. 
 E.g. sun or moon light.
 Directional lights have no specific position in the scene, they always come from their direction regardless of where an object is placed.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.light.LightLight.Type
- 
Field SummaryFieldsFields inherited from class com.jme3.light.Lightcolor, enabled, lastDistance, name
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a DirectionalLightDirectionalLight(Vector3f direction) Creates a DirectionalLight with the given directionDirectionalLight(Vector3f direction, ColorRGBA color) Creates a DirectionalLight with the given direction and the given color
- 
Method SummaryModifier and TypeMethodDescriptionclone()voidcomputeLastDistance(Spatial owner) Used internally to compute the last distance value.Returns the direction vector of the light.getType()Returns the light typebooleanintersectsBox(BoundingBox box, TempVars vars) Determines if the light intersects with the given bounding box.booleanintersectsFrustum(Camera camera, TempVars vars) Determines if the light intersects with the given camera frustum.booleanintersectsSphere(BoundingSphere sphere, TempVars vars) Determines if the light intersects with the given bounding sphere.voidread(JmeImporter im) final voidsetDirection(Vector3f dir) Sets the direction of the light.toString()voidwrite(JmeExporter ex) Methods inherited from class com.jme3.light.LightgetColor, getName, isEnabled, isFrustumCheckNeeded, isIntersectsFrustum, setColor, setEnabled, setFrustumCheckNeeded, setIntersectsFrustum, setName
- 
Field Details- 
direction
 
- 
- 
Constructor Details- 
DirectionalLightpublic DirectionalLight()Creates a DirectionalLight
- 
DirectionalLightCreates a DirectionalLight with the given direction- Parameters:
- direction- the light's direction
 
- 
DirectionalLightCreates a DirectionalLight with the given direction and the given color- Parameters:
- direction- the light's direction
- color- the light's color
 
 
- 
- 
Method Details- 
computeLastDistanceDescription copied from class:LightUsed internally to compute the last distance value.- Specified by:
- computeLastDistancein class- Light
- Parameters:
- owner- the Spatial whose distance is to be determined
 
- 
getDirectionReturns the direction vector of the light.- Returns:
- The direction vector of the light.
- See Also:
 
- 
setDirectionSets the direction of the light.Represents the direction the light is shining. (1, 0, 0) would represent light shining in the +X direction. - Parameters:
- dir- the direction of the light.
 
- 
intersectsBoxDescription copied from class:LightDetermines if the light intersects with the given bounding box.For non-local lights, such as directional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsBoxin class- Light
- Parameters:
- box- The box to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the box, false otherwise.
 
- 
intersectsSphereDescription copied from class:LightDetermines if the light intersects with the given bounding sphere.For non-local lights, such as directional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsSpherein class- Light
- Parameters:
- sphere- The sphere to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the sphere, false otherwise.
 
- 
intersectsFrustumDescription copied from class:LightDetermines if the light intersects with the given camera frustum. For non-local lights, such asdirectional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsFrustumin class- Light
- Parameters:
- camera- The camera frustum to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the frustum, false otherwise.
 
- 
getTypeDescription copied from class:LightReturns the light type
- 
toString
- 
write- Specified by:
- writein interface- Savable
- Overrides:
- writein class- Light
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Overrides:
- readin class- Light
- Throws:
- IOException
 
- 
clone
 
-