14 lines
350 B
Rust
14 lines
350 B
Rust
use std::fmt::Debug;
|
|
|
|
use crate::objects::hit::Hit;
|
|
use crate::Ray;
|
|
use crate::Vec3;
|
|
|
|
pub trait Hittable: Debug {
|
|
fn hit(&self, r: &Ray) -> Option<Hit>;
|
|
fn normal_at(&self, p: &Vec3) -> Vec3;
|
|
// fn intersect<H: Hittable>(&self, o: &H) -> bool;
|
|
fn inside(&self, p: &Vec3) -> bool;
|
|
fn closest_on_surface(&self, p: &Vec3) -> Vec3;
|
|
}
|