[osg-users] Passing input to viewer/camera (using osg with custom input handler)

Robert Osfield robert.osfield at gmail.com
Mon Sep 18 00:57:05 PDT 2017


Hi Antiro,

All you need to do is create a GUIEventAdapter on the heap using new, the
set the values as required.

FYI, GUIEventAdapter does not have any proptected constructors, they are
all public.  It does, however, have a protected destructor, this is done to
create a compile error when developers attempt to create a GUIEventAdapter
on the stack, this is something that is important for avoiding dangling
pointers when sharing objects using ref counting as is done with
GUIEventAdapter and the most of the rest of the OSG classes (have a look at
the source.)

Robert.

On 16 September 2017 at 12:26, antiro black <antiro42 at gmail.com> wrote:

> Hi,
>
> I am trying to incorporate OSG into a system that has its own input
> handling and abstraction layers. Most of the input is handled by the
> different components of the system, but I want OSG to handle the camera
> input.
> As such I need forward a part of my input to the OSG viewer (or perhaps
> directly to its camera?).
>
> I couldn't find any information about this online so I started browsing
> through the code and I think that I need to create a class that inherits
> from osgGA::Device which would then be able to add events to its queue to
> be handled by whatever its attached to.
> I do not know how to create such events however, I looked at the
> osgGA::GUIEventAdaptor, but that has a protected constructor so I guess its
> not meant to be used directly.
>
> Any advice would be most welcome!
>
> Thank you!
>
> Cheers,
> antiro
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170918/605d9428/attachment.htm>


More information about the osg-users mailing list