Class AmbientLight

java.lang.Object
com.jme3.light.Light
com.jme3.light.AmbientLight
All Implemented Interfaces:
Savable, Cloneable

public class AmbientLight extends Light
An ambient light adds a constant color to the scene.

Ambient lights are unaffected by the surface normal, and are constant regardless of the model's location. The material's ambient color is multiplied by the ambient light color to get the final ambient color of an object.

  • Constructor Details

    • AmbientLight

      public AmbientLight()
    • AmbientLight

      public AmbientLight(ColorRGBA color)
  • Method Details

    • intersectsBox

      public boolean intersectsBox(BoundingBox box, TempVars vars)
      Description copied from class: Light
      Determines if the light intersects with the given bounding box.

      For non-local lights, such as directional lights, ambient lights, or point lights without influence radius, this method should always return true.

      Specified by:
      intersectsBox in 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.
    • intersectsSphere

      public boolean intersectsSphere(BoundingSphere sphere, TempVars vars)
      Description copied from class: Light
      Determines if the light intersects with the given bounding sphere.

      For non-local lights, such as directional lights, ambient lights, or point lights without influence radius, this method should always return true.

      Specified by:
      intersectsSphere in 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.
    • intersectsFrustum

      public boolean intersectsFrustum(Camera camera, TempVars vars)
      Description copied from class: Light
      Determines if the light intersects with the given camera frustum. For non-local lights, such as directional lights, ambient lights, or point lights without influence radius, this method should always return true.
      Specified by:
      intersectsFrustum in 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.
    • computeLastDistance

      public void computeLastDistance(Spatial owner)
      Description copied from class: Light
      Used internally to compute the last distance value.
      Specified by:
      computeLastDistance in class Light
      Parameters:
      owner - the Spatial whose distance is to be determined
    • getType

      public Light.Type getType()
      Description copied from class: Light
      Returns the light type
      Specified by:
      getType in class Light
      Returns:
      the light type
      See Also: