BoundingBox and layerMask

Is it possible to set the layerMask for all boundingBoxes so that it is not visible by all cameras ?

I didn’t find anything in the documentation either in boundingBox and boundingBoxRenderer classes.

Thanks for you help :wink:

A boundingbox is not a visible object so I am not sure I follow what you are trying to achieve ?

When showBoundingBox is set to true, you can see a cube around your Mesh. That cube is called boundingBox I guess ?

And I need that cube to be visible by one camera and not the other so I am trying to set the layerMask of this cube but I didn’t find a way to do that.

Hope this is more clear @sebavan :wink:

Oh yes definitely clearer :slight_smile: I do not think we support that as both renders are pretty tight, would you be willing to contribute it ?

Yes of course.

I already went through the BoundingBoxRenderer Class

But for now to be honest I don’t understand how the cube is rendered exactly. This is not the classic Mesh! :wink:

Thinking more about it it is not a small change and It is really specific to one use case and I am not sure it is generic enough to be leaving in engine cause size and perf :slight_smile:

Could you not rather enable disable bounding box of a per camera render basis relying on the observable ?

I think I found a more clever way on when I show and hide the boundingBox so that it works eventually.

Your idea is to keep the boundingBox visible when the first camera render and then hide it before the second camera render that is right ?

yes exactly :slight_smile:

1 Like