[osg-users] about node mask

1 view
Skip to first unread message

Gianluca Natale

unread,
Mar 17, 2010, 12:02:42 PM3/17/10
to Osg Users

Hi All.

I’m setting node masks so that I can use different node visitors with different traversal masks
to exclude some node from traversal.


But I’m a bit confusing for the description of the tutorial NodeMaskDemo
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/NodeMaskDemo

and the real implementation.

 

I mean that in the tutorial I read this:

During the pre-render traversal of the scene graph a logical OR comparison of the current node mask and camera's node mask is made.

If the comparison is non-zero, the traversal will continue and if there is geometry associated with the node it will be sent to the render graph for rendering.

If the logical OR is zero, traversal will not continue further down the scene. Any associated geometry will not be rendered.”

 

While in the implementation of the nodeVisitor I see:

 

inline bool validNodeMask(const osg::Node& node) const

{

    return (getTraversalMask() & (getNodeMaskOverride() | node.getNodeMask()))!=0;

}

 

So, I guess that the tutorial meant AND comparison and not OR comparison.

Am I wrong?

 

Thanks in advance

Gianluca

 

Jason Daly

unread,
Mar 17, 2010, 12:14:47 PM3/17/10
to OpenSceneGraph Users
Gianluca Natale wrote:

So, I guess that the tutorial meant AND comparison and not OR comparison.

Am I wrong?


No, you're correct� :-)

It's actually doubly wrong, it should say "bitwise AND", not "logical OR"

--"J"

Reply all
Reply to author
Forward
0 new messages