I worked with a osg::Constraint and found strange part of code:
class OSGMANIPULATOR_EXPORT Constraint : public osg::Referenced
{
public:
...
virtual bool constrain(ScaleUniformCommand& command) const { return constrain((MotionCommand&)command); }
virtual bool constrain(const Rotate3DCommand& command) { return constrain((MotionCommand&)command); }
...
If i use osgManipulator::Rotate3DCommand then method Rotate3DCommand::accept(const Constraint& constraint) calls Constraint::constrain(MotionCommand&) instead Constraint:: constrain(const Rotate3DCommand&).
If you replace
virtual bool constrain(const Rotate3DCommand& command) { return constrain((MotionCommand&)command); }
on to
virtual bool constrain(Rotate3DCommand& command) const { return constrain((MotionCommand&)command); }
then all works correctly.
"
to ensure the correct methods on constraints and callbaks are called for each Command. Also fixed the handling of
Constraints when applied to composite Draggers.
Vivek's email to osg-submissions:
"I'm happy to release the osgdragger nodekit to the OSG community. I
implemented the nodekit for my company, Fugro-Jason Inc., and they
have kindly agreed to open source it.
The nodekit contains a few draggers but it should be easy to build new
draggers on top of it. The design of the nodekit is based on a
SIGGRAPH 2002 course - "Design and Implementation of Direct
Manipulation in 3D". You can find the course notes at
http://www.pauliface.com/Sigg02/index.html. Reading pages 20 - 29 of
the course notes should give you a fair understanding of how the
nodekit works.
The source code also contains an example of how to use the draggers."