Class DirectionalLight

java.lang.Object
com.ijurnove.cpu3d.Light
com.ijurnove.cpu3d.DirectionalLight
All Implemented Interfaces:
Rotatable

public class DirectionalLight extends Light implements Rotatable
DirectionalLight is a Light with a direction but no specific position. A DirectionalLight casts light over the entire scene in the direction of the specified Vector3d.
  • Constructor Details

    • DirectionalLight

      public DirectionalLight(Vector3d direction, PhongComponents components)
      Constructs a DirectionalLight with the specified direction and PhongComponents.
      Parameters:
      direction - the direction of the light
      components - the PhongComponents to set, which detail the color and intensity of each type of light
  • Method Details

    • init

      protected void init()
    • getCamera

      protected Camera getCamera()
    • updateShadowMap

      protected void updateShadowMap()
    • shadowValue

      protected double shadowValue(Point3d point)
    • lightVec

      protected Vector3d lightVec(Point3d point)
    • distance

      protected double distance(Vector3d vec)
    • rotate

      public void rotate(int axis, double theta, Point3d point)
      Description copied from interface: Rotatable
      Rotates this object about a given point on a specified axis. 0 corresponds to the X axis, 1 corresponds to the Y axis, and 2 corresponds to the Z axis.
      Specified by:
      rotate in interface Rotatable
      Parameters:
      axis - the axis to rotate around
      theta - the radians to rotate by
      point - the center point to rotate around