package electrosphere.renderer.light;

import org.joml.Vector3f;

/**
 * A directional light source (global)
 */
public class DirectionalLight {

    //the direction of the light as a uniform vector
    Vector3f direction;

    //the color
    Vector3f color;

    public void setDirection(Vector3f direction) {
        this.direction = direction;
    }

    public void setColor(Vector3f color) {
        this.color = color;
    }

    public Vector3f getDirection() {
        return direction;
    }

    public Vector3f getColor() {
        return color;
    }

    public DirectionalLight(Vector3f direction){
        this.direction = direction;
        color = new Vector3f(1.0f);
        this.direction.normalize();
    }

    public DirectionalLight(Vector3f direction, Vector3f color){
        this.direction = direction;
        this.color = new Vector3f(color);
        this.direction.normalize();
    }
}