From Chuck Seberino, "Attached are modified versions of RotateCylinderDragger and Projector files that clean up the use of _onCylinder / isProjectionOnCylinder().

I have also made changes to the RotateCylinderDragger to provide a cylinder ring with a thickness.   It is totally optional, but IMHO makes the default behavior work better than a solid cylinder (which typically obscures the geometry you are trying to drag).  Gives it a bit more to grab, especially in the case where eyepoint and cylinder axis are near parallel.
"
This commit is contained in:
Robert Osfield
2012-03-09 10:20:23 +00:00
parent fc6fdeaa2c
commit 5e105d2fc4
5 changed files with 95 additions and 15 deletions

View File

@@ -560,7 +560,7 @@ CylinderPlaneProjector::CylinderPlaneProjector()
{
}
CylinderPlaneProjector::CylinderPlaneProjector(osg::Cylinder* cylinder) : CylinderProjector(cylinder)
CylinderPlaneProjector::CylinderPlaneProjector(osg::Cylinder* cylinder) : CylinderProjector(cylinder), _parallelPlane(false)
{
}
@@ -597,7 +597,7 @@ bool CylinderPlaneProjector::project(const PointerInfo& pi, osg::Vec3d& projecte
return true;
}
osg::Quat CylinderPlaneProjector::getRotation(const osg::Vec3d& p1, bool p1OnCyl, const osg::Vec3d& p2, bool p2OnCyl) const
osg::Quat CylinderPlaneProjector::getRotation(const osg::Vec3d& p1, const osg::Vec3d& p2) const
{
if(_parallelPlane)
{