fix: tests for PlaneIntersectionMode
This commit is contained in:
parent
d26bd57ea7
commit
12be5be377
@ -252,21 +252,20 @@ mod tests {
|
||||
let ray = Ray3d::new(Vec3::ZERO, Dir3::Z);
|
||||
|
||||
// Orthogonal, and test that ray intersects only the front face
|
||||
assert_eq!(
|
||||
assert!(
|
||||
ray.intersect_plane(
|
||||
Vec3::Z,
|
||||
InfinitePlane3d::new(Vec3::Z),
|
||||
PlaneIntersectionMode::FrontFaceOnly
|
||||
),
|
||||
Some(1.0)
|
||||
);
|
||||
assert!(ray
|
||||
)
|
||||
.is_none());
|
||||
assert_eq!(ray
|
||||
.intersect_plane(
|
||||
Vec3::Z,
|
||||
InfinitePlane3d::new(Vec3::NEG_Z),
|
||||
PlaneIntersectionMode::FrontFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
),
|
||||
Some(1.0));
|
||||
assert!(ray
|
||||
.intersect_plane(
|
||||
Vec3::NEG_Z,
|
||||
@ -277,7 +276,7 @@ mod tests {
|
||||
assert!(ray
|
||||
.intersect_plane(
|
||||
Vec3::NEG_Z,
|
||||
InfinitePlane3d::new(Vec3::Z),
|
||||
InfinitePlane3d::new(Vec3::NEG_Z),
|
||||
PlaneIntersectionMode::FrontFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
@ -288,13 +287,6 @@ mod tests {
|
||||
let ray = Ray3d::new(Vec3::ZERO, Dir3::Z);
|
||||
|
||||
// Orthogonal, and test that ray intersects only the back face
|
||||
assert!(ray
|
||||
.intersect_plane(
|
||||
Vec3::Z,
|
||||
InfinitePlane3d::new(Vec3::Z),
|
||||
PlaneIntersectionMode::BackFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
assert_eq!(
|
||||
ray.intersect_plane(
|
||||
Vec3::Z,
|
||||
@ -305,8 +297,8 @@ mod tests {
|
||||
);
|
||||
assert!(ray
|
||||
.intersect_plane(
|
||||
Vec3::NEG_Z,
|
||||
InfinitePlane3d::new(Vec3::Z),
|
||||
Vec3::Z,
|
||||
InfinitePlane3d::new(Vec3::NEG_Z),
|
||||
PlaneIntersectionMode::BackFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
@ -317,5 +309,12 @@ mod tests {
|
||||
PlaneIntersectionMode::BackFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
assert!(ray
|
||||
.intersect_plane(
|
||||
Vec3::NEG_Z,
|
||||
InfinitePlane3d::new(Vec3::NEG_Z),
|
||||
PlaneIntersectionMode::BackFaceOnly
|
||||
)
|
||||
.is_none());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user