Hi,

Currently I'm getting comfortable with the OpenSG traversal
infrastructure.
As a first example I tried the new intersection action. Howerver, I got
different
result when using the IntersectAction. Actually, I didn't get
any intersection with the new IntersectActor class.

Below my simple example program:

                using namespace osg;
                Line line = viewer->at(0)->calcViewRay(x, y);

                NodePtr root   = viewer->at(0)->getRoot();
                NodePtr result1 = NullFC;
                NodePtr result2 = NullFC;

                {
                    IntersectActor*   actor  = IntersectActor::create();
                    DepthFirstAction* action =
DepthFirstAction::create();

                    action->addActor(actor);
                    actor->setRay(line);

                    action->apply(root);

                    if (actor->getHit()) {
                        result2 = actor->getHitObject()->getParent();
                    }

                    delete action;
                    delete actor;
                }

                {
                    IntersectAction* action = IntersectAction::create();
                    action->setLine(line);
                    action->apply(root);

                    if (action->didHit()) {
                        result1 = action->getHitObject();
                    }
                    delete action;
                }
                
                assert(result1 == result2);

Any mistakes I did in my code?

Best regards,
Johannes Brunen

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to