[osg-users] moving camera from FirstPersonManipulator/StandardManipulator without mouse button

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Mon May 11 09:40:35 PDT 2020


Found out!

Just needed to change the performMovement() function of the derived class, 
and add an extra else in the end:

    if( buttonMask == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
    {
        return performMovementLeftMouseButton( eventTimeDelta, dx, dy );
    }
    else if( ( buttonMask == osgGA::GUIEventAdapter::MIDDLE_MOUSE_BUTTON ) 
||
             ( buttonMask == osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON && 
modKeyMask & osgGA::GUIEventAdapter::MODKEY_CTRL ) ||
             ( buttonMask == (osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON | 
osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON) ) )
    {
        return performMovementMiddleMouseButton( eventTimeDelta, dx, dy );
    }
    else if( buttonMask == osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON )
    {
        return performMovementRightMouseButton( eventTimeDelta, dx, dy );
    }
    else
    {
        return performMovementLeftMouseButton( eventTimeDelta, dx, dy ); // 
<-- HERE
    }


On Monday, May 11, 2020 at 4:39:28 AM UTC-3, Rodrigo Dias wrote:
>
> I'm trying to adapt camera movement from FirstPersonManipulator or 
> StandardManipulator. I've found an example here 
> <https://github.com/SunilRao01/OSGFirstPersonController> and was able to 
> compile it.
>
> However, I can't seem to find how to move the camera when there's no mouse 
> button pressed. How do I do that?
>

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/1baaf973-7699-4b8c-92b6-ec8ec3bee6c2%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200511/a0c70282/attachment.html>


More information about the osg-users mailing list