Class 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 Summary

      Fields 
      Modifier and Type Field Description
      private double lightX
      The light position, in user space
      private double lightY
      The light position, in user space
      private double lightZ
      The light position, in user space
    • Constructor Summary

      Constructors 
      Constructor Description
      PointLight​(double lightX, double lightY, double lightZ, java.awt.Color lightColor)  
    • Field Detail

      • 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 Detail

      • PointLight

        public PointLight​(double lightX,
                          double lightY,
                          double lightZ,
                          java.awt.Color lightColor)
    • Method Detail

      • 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