aboutsummaryrefslogtreecommitdiff
path: root/src/scene/shapes/mod.rs
blob: 9b6bdfdf804daab21097b617c02eba08e9e26234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mod sphere;

pub use sphere::Sphere;

use crate::core::{Vector3f, Ray};
use crate::Float;

pub trait Shape {
    fn intersect(&self, ray: &Ray) -> Option<Float>;

    /// Calculates the normal at point
    ///
    /// Point is assumed to be on the circle.
    /// The resulting vector is assumed to be normalized.
    fn norm_at(&self, point: &Vector3f) -> Vector3f;
}