package renderer.mesh;

import basics.math.algebra.Ray;
import basics.math.algebra.Vector;
import raytracing.BasicMaterial;
import renderer.primitive.Primitive;
import shading.Material;

public class BasicMesh extends Mesh {

    private Material material;

    private Primitive shape;

    public BasicMesh(Material material, Primitive shape) {
        this.material = material;
        this.shape = shape;
    }

    @Override
    public Material getMaterial() {
        return (Material) material;
    }

    @Override
    public double intersect(Ray ray) {
        return shape.intersect(ray);
    }

    @Override
    public Vector normalAt(Vector surfacePoint, Vector incoming) {
        return shape.normalAt(surfacePoint, incoming);
    }
}
