[osg-users] Is it possible to cull/visit based on the negative result instead of the positive one?
Robert Osfield
robert.osfield at gmail.com
Mon Jun 15 03:30:05 PDT 2015
HI Michael,
The OSG doesn't support changing the node mask test as it's a inline method
in NodeVisitor.
/** Method to called by Node and its subclass' Node::accept()
method, if the result is true
* it is used to cull operations of nodes and their subgraphs.
* Return true if the result of a bit wise and of the
NodeVisitor::_traversalMask
* with the bit or between NodeVistor::_nodeMaskOverride and the
Node::_nodeMask.
* default values for _traversalMask is 0xffffffff,
_nodeMaskOverride is 0x0,
* and osg::Node::_nodeMask is 0xffffffff. */
inline bool validNodeMask(const osg::Node& node) const
{
return (getTraversalMask() & (getNodeMaskOverride() |
node.getNodeMask()))!=0;
}
Robert.
On 15 June 2015 at 11:24, michael kapelko <kornerr at gmail.com> wrote:
> Hi.
> I'm implementing node picking.
>
> As I understood, the usual approach is:
> 1) go through all nodes and set their node masks to some custom value like
> 0x1
> 2) set pickable/selectable node masks to some custom value like 0x2
> 3) set osgUtil::IntersectionVisitor's traversal mask to 0x2
> 4) IntersectionVisitor visits only those nodes that have 0x2 mask
>
> I think the following approach is easier:
> 1) set pickable/selectable node masks to some custom value like
> current_node_mask MINUS 0x2
> 2) set IntersectionVisitor's traversal mask to default_node_mask MINUS 0x2
> 3) IntersectionVisitor visits only those nodes that have 0x2 mask EXCLUDED
>
> Am I correct with my assumption? Can OSG do that? Or why doesn't it do
> that?
> Thanks.
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150615/2472e897/attachment-0003.htm>
More information about the osg-users
mailing list