Hello Josef,
Josef Grunig wrote:
> Hi all,
>
> I've noticed a strange behaviour playing with nodes and updateVolume();
>
> The situation is:
>
> RootNode (TransformCore)
> |
> ChildNode (GeometryCore)
>
> Then I call successfully
> RootNode->getVolume(true).getBounds( min, max );
>
> afterwards I remove the child node and recall
> RootNode->getVolume(true).getBounds( min, max );
>
> At this point I would expect a min and max of (0,0,0) but I get the
> previous value. Probably the update volume is ignoring the node as it
> has no child.
>
> Any ideas? as workaround I'm destroying the RootNode too, rebuilding
> it from scratch.
I think I have this figured out now. The problem is that
Volume::setEmpty() only sets the empty flag of the volume and
BoxVolume::getBounds does not look at the flags, but always returns the
min/max corners of the box. I'm not sure what the best way to fix this
is -- CC'ing the core list.
As a workaround you can protect uses of the volume's bounds with
if(!rootNoe->getVolume(true).isEmpty())
Hope it helps,
Carsten
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core