Hello, I am experimenting around a ClipNodeBox and selection by picking of Nodes inside this box. Is there a elegant way to limit the "computeIntersections(ea.getX(), ea.getY(), intersections, 0xffffffff)" method to take my ClipNodeBox into account? I try to do it by my own by using "boundingBox.contains(intersectionPoint)". But here I have the problem that the BoundingBox has always it's initial values after a modification by using a TabBoxDragger. I suppose it's somewhere hidden in a TransformMatrix. So my questions are: 1. Can I limit computeIntersections(ea.getX(), ea.getY(), intersections, 0xffffffff)" to a given ClipNodeBox? 2. If not, where can I get the modified values from the TabBoxDragger after interactively use it? Here are my code for the setup of the Draggers.
Many thanks for a help. Karl ... // clipBoxGeode created with a Box and BoundingBox before ... // Draggers // First a BoxDragger, as the Parent Dragger boxDragger = new osgManipulator::TabBoxDragger(); boxDragger->setupDefaultGeometry(); osg::Vec3d scaleVec = osg::Vec3d(bb.xMax() - bb.xMin(), bb.yMax() - bb.yMin(), bb.zMax() - bb.zMin()); scaleVec.normalize(); scaleVec *= clipBoxGeode->getBound().radius() * 2.01; boxDragger->setMatrix(osg::Matrix::scale(scaleVec.x(), scaleVec.y(), scaleVec.z()) * osg::Matrix::translate(clipBoxGeode->getBound().center())); boxDragger->setNodeMask(0x00000000); // dragger invisible at start // Then an AxisDragger, as a Child of BoxDragger axisDragger = new osgManipulator::TranslateAxisDragger(); axisDragger->setupDefaultGeometry(); axisDragger->setMatrix(osg::Matrix::scale(3, 3, 3) * osg::Matrix::translate(osg::Vec3f( clipBoxGeode->getBound().center().x(), clipBoxGeode->getBound().center().y(), clipBoxGeode->getBound().center().z() + (bb.zMax() - bb.zMin())/2))); axisDragger->setNodeMask(0x00000000); // dragger invisible at start // Set in relation, box- and axisDragger boxDragger->addDragger(axisDragger); axisDragger->setParentDragger(boxDragger); // The set of elements to drag osgManipulator::Selection * selection = new osgManipulator::Selection; selection->addChild(clipBoxGeode); selection->addChild(clipNode); selection->addChild(axisDragger); // A container for the two main elements osg::Group * group = new osg::Group; group->addChild(boxDragger); group->addChild(selection); // Connect both with the commandManager cmdMgr->connect(*boxDragger, *selection); osg::ref_ptr<osg::MatrixTransform> transform = new osg::MatrixTransform; // Integration into the osg tree transform.get()->addChild(group); clipNodeContainer->addChild(transform.get()); // ... _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org