I am working with large terrains, and each tile is a separate point cloud system or solid particle system, it is working nicely apart from the in frustum calculation. This is a simple playground that highlights the issue
Box doesn’t have a “mesh” property, it is a mesh
...
console.log(box.mesh)
if (!box.mesh?.isInFrustum(planes)) {
console.log('Box is not in frustum');
}
...
undefined
Box is not in frustum
...
What happend here?
!box.mesh?.isInFrustum(planes)
If mesh is undefined, suddenly the if statement looks like so:
(!box.mesh) === true
...
if (!box?.isInFrustum(planes)) {
console.log('Box is not in frustum');
}
else {
console.log('Box is in frustum')
}
...
Box is in frustum
Thank you, I was using a box to save a bit of time in the example with the playground, that was a mistake by me, I am still quite new to this. Turns out there are multiple cameras in the scene and I was using the wrong one to do a frustum test. Sorry for the noise.