Fixed an issue where filtered objects were incorrectly ignored by the section planes

This commit is contained in:
AlexandruPopovici
2022-08-12 17:15:08 +03:00
parent 28989a622c
commit 7ebd96fe44
@@ -210,10 +210,16 @@ export default class SpeckleRenderer {
public updateClippingPlanes(planes: Plane[]) {
if (!this.allObjects) return
/** This will be done via the batches in the near future */
this.allObjects.traverse((object) => {
const material = (object as unknown as { material }).material
if (material) {
if (!material) return
if (!Array.isArray(material)) {
material.clippingPlanes = planes
} else {
for (let k = 0; k < material.length; k++) {
material[k].clippingPlanes = planes
}
}
})
}