Class PointLight

java.lang.Object
org.apache.batik.ext.awt.image.AbstractLight
org.apache.batik.ext.awt.image.PointLight
All Implemented Interfaces:
Light

public class PointLight extends AbstractLight
A light source which emits a light of constant intensity in all directions.
Version:
$Id: PointLight.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Details

    • lightX

      private double lightX
      The light position, in user space
    • lightY

      private double lightY
      The light position, in user space
    • lightZ

      private double lightZ
      The light position, in user space
  • Constructor Details

    • PointLight

      public PointLight(double lightX, double lightY, double lightZ, Color lightColor)
  • Method Details

    • getLightX

      public double getLightX()
      Returns:
      the light's x position
    • getLightY

      public double getLightY()
      Returns:
      the light's y position
    • getLightZ

      public double getLightZ()
      Returns:
      the light's z position
    • isConstant

      public boolean isConstant()
      Specified by:
      isConstant in interface Light
      Overrides:
      isConstant in class AbstractLight
      Returns:
      true if the light is constant over the whole surface
    • getLight

      public final void getLight(double x, double y, double z, double[] L)
      Computes the light vector in (x, y, z)
      Parameters:
      x - x-axis coordinate where the light should be computed
      y - y-axis coordinate where the light should be computed
      z - z-axis coordinate where the light should be computed
      L - array of length 3 where the result is stored