(C++) Simple to use Event Receiver class for Irrlicht 1.3

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

Disappointed by the comments in general

Post by Ulf »

I am disappointed that noone questioned the validity and purpose of the code.
Rather, they just help fix the syntax of the code! Why waste time helping someone with syntax when the objective is wrong or misunderstood?

After all this time, noone has developed a proper input handler for a game?
Guess I better stop gas bagging and do it..
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
Jake-GR
Posts: 41
Joined: Wed Jan 07, 2009 12:32 am
Location: Colorado
Contact:

Post by Jake-GR »

It may not be the best code, but I see it fairly useful for a quick input handler. I also see the use for pressed and release situations...

example:
hit KEY to toggle variable
handling just down (which you can check with a basic event receiver in tutorial 04)
it will toggle every frame rendered unless you add in another variable to make sure it only toggles once per keystroke
- so having pressed/release does that for you

I agree this is not a proper input handler for a game, but it is a decent handler for quick and easy (test/demo/etc)
(C++) Simple to use Event Receiver class for Irrlicht 1.3
I am going to be using this code for now, has the basic functionality I need right now. But I also look forward to seeing yours Ulf (might have to switch later :) )
JuicyLobster
Posts: 25
Joined: Sat Jun 07, 2008 8:55 pm

Post by JuicyLobster »

edit: opfh, there we go, forgot to do device->setEventReceiver()...

had to add a mouseHasMoved() method too, but all in all thanks.
--
Juicy, hot, and full of butter!
Ulf
Posts: 281
Joined: Mon Jun 15, 2009 8:53 am
Location: Australia

starting a game engine event handler..

Post by Ulf »

If anyones interested, I've started my game engine event handler project..

Here is the link to the forum page:

http://irrlicht.sourceforge.net/phpBB2 ... p?t=34071
I can hear birds chirping
:twisted:

I live in the Eye of Insanity.
joqus
Posts: 2
Joined: Thu Apr 16, 2009 5:22 pm

Post by joqus »

nice post, I enjoy your code
and its very helpfull for me!!
thanks!
M4UNOT
Posts: 39
Joined: Sat Jun 26, 2010 3:06 pm
Location: Germany

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by M4UNOT »

Hello,

Nice class, thanks!

i have changed

Code: Select all

virtual bool OnEvent(SEvent event)
To:

Code: Select all

virtual bool OnEvent(const SEvent& event)
everything works, but the first person shooter style user controlled camera stopped working..

Code: Select all

smgr->addCameraSceneNodeFPS();
it get ignored...
erandros
Posts: 1
Joined: Tue Feb 04, 2014 7:26 pm

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by erandros »

I also have that problem
M4UNOT wrote: everything works, but the first person shooter style user controlled camera stopped working..

Code: Select all

smgr->addCameraSceneNodeFPS();
it get ignored...
I have that problem too. Anyone have any ideas how to keep the camera working?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by mongoose7 »

Are you sure the problem isn't in fact that you are not passing the events on for the FPS camera to see?
M4UNOT
Posts: 39
Joined: Sat Jun 26, 2010 3:06 pm
Location: Germany

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by M4UNOT »

mongoose7 wrote:Are you sure the problem isn't in fact that you are not passing the events on for the FPS camera to see?
I just started again to use it, can you please explain what you mean and show how to fix it??
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by mongoose7 »

If you return true from the event receiver, the event is not passed on. Return false and the event will be passed on.
M4UNOT
Posts: 39
Joined: Sat Jun 26, 2010 3:06 pm
Location: Germany

Re: (C++) Simple to use Event Receiver class for Irrlicht 1.

Post by M4UNOT »

Still the same problem..
Post Reply