Camera hide / show draw mask


#1

Hi all,

I would like to create a node path which is invisible to all cameras except one - a custom camera which can see everything.

The default camera mask seems to be:

0111 1111 1111 1111 1111 1111 1111 1111

So if I want to create a camera that can see absolutely everything I would use the mask:

1111 1111 1111 1111 1111 1111 1111 1111

and the node path that will be invisible except to this camera would use the mask:

1000 0000 0000 0000 0000 0000 0000 0000

However when I run this:

myCamera.node().setCameraMask( BitMask32.allOn() )

I get:

AssertionError: (mask & PandaNode::get_overall_bit()).is_zero() at line 108 of c:\buildslave\release_sdk_win32\build\panda3d\panda\src\pgraph\camera.I

Is this right or am I misunderstanding how this is meant to work?

Thanks!


#2

I think the first bit (bit 0) has a special purpose, that is what the “get_overall_bit” is referring to. Maybe try with a different bit instead?


#3

Thanks for the reply, Teedee. You’re right, using any of the other bits seems to work as expected. I just figured that the default camera might have an off bit so you can hide something without having to edit the default camera mask. :slight_smile: