Re: [osg-users] Adding Constraints to Draggers
bam098 wrote: > However, I don't quite understand it unfortunately. All constrain methods of > the class are set to true here and I don't get why this was done. I don't see anywhere in the entire osg project where the return from constrain is used. I don't think it serves any purpose at this point. Constraints manipulate the command to accomplish their task. Code: grep -IrnF -- ".constrain" * include/osgManipulator/Command:61:virtual void accept(const Constraint& constraint) { constraint.constrain(*this); } include/osgManipulator/Command:112:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } include/osgManipulator/Command:149:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } include/osgManipulator/Command:188:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } include/osgManipulator/Command:233:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } include/osgManipulator/Command:278:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } include/osgManipulator/Command:314:virtual void accept(const Constraint& constraint) {constraint.constrain(*this); } grep -IrnF -- "->constrain" * //returns nothing. bam098 wrote: > But how is the situation currently? Are osgmanipulator and especially the > dragger classes are still used today? I have been using osgmanipulator library and have been happy it is available. https://gitlab.com/blobfish/cadseer/tree/master/library[/url][/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75142#75142 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Adding Constraints to Draggers
Hi Max?? Robert is right,add constraint to dragger. You can find the constraint work on command in dispatch method of class Dragger. As for the example,you can see the class GridConstraint inherited from class Contraint. Just add breakpoint,and follow the code,you can know how it work clearly. -- Original -- From: "Max Power"; Date: Fri, Oct 26, 2018 00:14 AM To: "osg-users"; Subject: Re: [osg-users] Adding Constraints to Draggers Hi Robert, ah okay, I understand. Thank you for your fast reply. I saw OpenSceneGraph/examples/osgmanipulator/osgmanipulator.cpp and I noticed, that it also uses the Constraint class. However, I don't quite understand it unfortunately. All constrain methods of the class are set to true here and I don't get why this was done. Okay, but then I will try to take a deeper look into the code. But how is the situation currently? Are osgmanipulator and especially the dragger classes are still used today? Or do most people rather write everything from scratch instead of using osgmanipulator? Thank you for your help! :) Cheers, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75133#75133 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Adding Constraints to Draggers
Hi Max, On Thu, 25 Oct 2018 at 17:20, Max Power wrote: > But how is the situation currently? Are osgmanipulator and especially the > dragger classes are still used today? Or do most people rather write > everything from scratch instead of using osgmanipulator? > As far as I'm aware osgManipulator is used, it's extensible so it should be able to extend. I just can't personally guide your extension of it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Adding Constraints to Draggers
Hi Robert, ah okay, I understand. Thank you for your fast reply. I saw OpenSceneGraph/examples/osgmanipulator/osgmanipulator.cpp and I noticed, that it also uses the Constraint class. However, I don't quite understand it unfortunately. All constrain methods of the class are set to true here and I don't get why this was done. Okay, but then I will try to take a deeper look into the code. But how is the situation currently? Are osgmanipulator and especially the dragger classes are still used today? Or do most people rather write everything from scratch instead of using osgmanipulator? Thank you for your help! :) Cheers, Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75133#75133 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Adding Constraints to Draggers
Hi Max, I'm afraid the original author of osgManipulator has moved company, where he developed it, over a decade ago so to know exactly how to use it we all just have to look at the code an figure it out. I haven't personally use osgManipulator in the way you are wanting to use it so can't provide any guidance myself. The only public example I'm familiar with is OpenSceneGraph/examples/osgmaipulator/osgmanipulator.cpp. Cheers, Robert. On Thu, 25 Oct 2018 at 15:50, Max Power wrote: > Hi, > > I'm quite new to OpenSceneGraph. I actually just finished to read the book > "OpenSceneGraph 3.0 Beginner's Guide" and now I want to go a bit further. > > Currently, I try to move objects via the mouse. I already saw, that I can > use the class osgManipulator::Dragger for this. Here I wrote my own > CompositeDragger, which is basically a combination of a > RotateCylinderDragger and a Translate1DDrager. This means I can move the > object forwards and backwards and I can rotate it via mouse. I already got > this working. > > However, I don't want to translate the object infinitely forwards or > backwards. I just want to translate it e.g. 10 units back or 5 units > forward at max. Or I want to translate it only within a certain area of the > world coordinate system. > > How could I do this? I assume the osgManipulator::Contraint is helpful > here. However, I haven't found any examples and I don't know how to apply > it. > > I hope this wasn't asked before. At least I couldn't find anything > similar. Are there any examples somewhere online, which you can recommend > to look at? > > Thank you! > > Cheers, > Max > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=75125#75125 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org