package basics.math.algebra;

public class Ray {

    private Vector origin;
    private Vector direction;
    private double near;
    private double far;

    public Ray(Vector origin, Vector direction, double near, double far) {
        this.origin = origin;
        this.direction = direction;
        this.near = near;
        this.far = far;
    }

    public Vector getOrigin() {
        return origin;
    }

    public void setOrigin(Vector origin) {
        this.origin = origin;
    }

    public Vector getDirection() {
        return direction;
    }

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

    public double getNear() {
        return near;
    }

    public double getFar() {
        return far;
    }

    public Vector travel(double distance) {
        return this.origin.add(this.direction.scale(distance));
    }
}
