Add IntersectP trait
Like Intersect, but the intersect() function only returns a bool, not a Optional<IntersectionInfo>.
This commit is contained in:
parent
6639ed813b
commit
5c8903107a
|
|
@ -49,9 +49,14 @@ pub struct IntersectionInfo<T: RealField> {
|
|||
}
|
||||
|
||||
pub trait Intersect<T: RealField>: Send + Sync {
|
||||
/// Test if the ray intersects the object, and return information about the object and intersection.
|
||||
fn intersect<'a>(&'a self, ray: &Ray<T>) -> Option<IntersectionInfo<T>>;
|
||||
}
|
||||
|
||||
pub trait IntersectP<T: RealField>: Send + Sync {
|
||||
/// Test if the ray intersects the object, without calculating any extra information.
|
||||
fn intersect(&self, ray: &Ray<T>) -> bool;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
|
|||
Loading…
Reference in New Issue