OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Passing input to viewer/camera (using osg with custom input handler)


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
antiro42
User


Joined: 01 Sep 2017
Posts: 46

PostPosted: Sat Sep 16, 2017 11:07 am    Post subject:
Passing input to viewer/camera (using osg with custom input handler)
Reply with quote

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
Back to top
View user's profile Send private message
antiro42
User


Joined: 01 Sep 2017
Posts: 46

PostPosted: Sat Sep 16, 2017 11:43 am    Post subject:
Passing input to viewer/camera (using osg with custom input handler)
Reply with quote

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

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12348

PostPosted: Tue Sep 19, 2017 6:06 am    Post subject:
Passing input to viewer/camera (using osg with custom input handler)
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Custom cursor problem? tom General 7 Wed Sep 18, 2019 4:44 pm View latest post
No new posts embedding osg::viewer NoeMurr General 2 Tue Aug 27, 2019 5:38 pm View latest post
No new posts Projection matrix with camera looking... AlexSavo General 0 Thu Jul 25, 2019 2:34 am View latest post
No new posts osgVIEWER problem camera skehal General 1 Tue Jul 23, 2019 9:17 am View latest post
No new posts Order Independent Transparency and os... beingbad@163.com General 3 Fri Jun 14, 2019 7:56 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP