fix: clipping plane intersections

This commit is contained in:
TrèsAbhi committed 2024-07-31 14:18:58 -05:00
1 parent abc8acb6ed
commit f73426df6a
3 files changed
+22 -1

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { Material, Mesh, Object3D, Vector3 } from 'three';
export function discardClippingPlane(object: Object3D, point: Vector3) {
if (
object instanceof Mesh &&
object.material instanceof Material &&
object.material.clippingPlanes !== null
) {
return object.material.clippingPlanes.every(
(plane) => plane.distanceToPoint(point) < 0,
);
}
return false;
}