Camera hide / show draw mask

Return to Scripting Issues

Camera hide / show draw mask

Postby kurohyou » Sun May 13, 2012 9:19 am

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:


Code: Select all
myCamera.node().setCameraMask( BitMask32.allOn() )


I get:

Code: Select all
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!
kurohyou
 
Posts: 234
Joined: Tue Jun 29, 2010 9:59 pm

Postby teedee » Mon May 14, 2012 3:37 pm

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?
teedee
 
Posts: 849
Joined: Tue May 12, 2009 11:33 pm
Location: Kepler-22b

Postby kurohyou » Mon May 14, 2012 8:58 pm

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. :)
kurohyou
 
Posts: 234
Joined: Tue Jun 29, 2010 9:59 pm


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 1 guest