
class Light {
    public static final int AMBIENT = 0;
    public static final int DIRECTIONAL = 1;
    public static final int POINT = 2;

    protected int lightType;
    /** the position of a point light or the direction to a directional
	light intensity of the light source */
    protected Vector3D direction;
    protected Point3D ptPos;
    protected float[] rgbFac;


    /////////////   CONSTRUCTORS ////////////////
    public Light(int type, float xval, float yval , float zval, float r, float g, float b)  {
        lightType = type;
	rgbFac = new float[3];
	rgbFac[0]=r; 	rgbFac[1]=g;	rgbFac[2]=b;
        if (lightType == DIRECTIONAL) {
	    direction = new Vector3D( xval, yval, zval );
	    direction.normalize();
        }
        if (lightType == POINT) {
	    ptPos = new Point3D( xval, yval, zval, 1 );
        }
    }


    //////////////// METHODS ///////////////////////////

    public int getLtType() { return lightType; }

    public float getIFac(int i) { return rgbFac[i] ; }

    public Vector3D getDirection() {  return direction; }


  public void print() {
      System.out.println(" PRINTING LIGHT" );    
      System.out.println(" lttype= " + lightType); 
      System.out.println(" r= " + rgbFac[0]+ " g= " + rgbFac[1] +  " b= " + rgbFac[2] );
      if (lightType == DIRECTIONAL) {
	direction.print();
      }
  }
} //LIGHT
