Events... I Can't get them right! :{

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jhend60
Posts: 44
Joined: Mon Oct 27, 2008 10:11 am
Location: behind you
Contact:

Events... I Can't get them right! :{

Post by jhend60 »

I can't seem to get the right code for a simple left mouse click event... I have looked far and wide too. i always seem to get some kind of abstract error. Please put here the EXACT code that I need to make a simple event. Also, on the collision front, I have decided to switch back to Newton (bullet WAYYYYY TOO HARD) and am trying to make a shooting function. I will ask help for that soon, but if anyone knows a good method of firing rapidly please share. Would it be possible to make a huge array of the same 3d mesh? Please tell.

Thanks.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

How are you proposing to shoot? Are you considering shooting a 3D mesh as a bullet? If you're going to have a lot of bullets i wouldn't advise this, rather you should look at raycasting.

The abstract error you're getting is to do with the OnEvent function. The parameter should be const SEvent& event, not SEvent event.
Image Image Image
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

I can't seem to get the right code for a simple left mouse click event... I have looked far and wide too. i always seem to get some kind of abstract error. Please put here the EXACT code that I need to make a simple event.
It would be better if YOU post YOUR code so we can see whats wrong with it. Post the exact error message aswell.


It seems you've looked about as far as that shiny "new topic" button and as wide as a japanese girl's ........


As for "firing rapidly", drawing and updating a mesh for every projectile would be very cpu intensive - a better option is to cast rays and detect collision with geometry in your scene - if you'd like a visual representation of the path of the projectile, use the same vector that you cast the ray along to orientate and size a textured quad.

AGAIN, there's plently of info already on this forum, and across the rest of the tinterweb on these things. You've made like a thousand new topics in the last 24 hours.


[edit]
I second JP's post :P
Last edited by SwitchCase on Wed Oct 29, 2008 2:19 pm, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Events... I Can't get them right! :{

Post by Acki »

jhend60 wrote:Please put here the EXACT code that I need to make a simple event.
the tutorials are showing this pretty well...
for example the movement tutorial... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
knicholes
Posts: 14
Joined: Sat Aug 30, 2008 8:21 pm

Nahhh

Post by knicholes »

It gives a great example on how to handle a keyboard event, but there's nothing about mouse events (lclick, rclick, wheel) in the examples that I could find.
jddevnet
Posts: 17
Joined: Mon Oct 06, 2008 8:27 pm

Post by jddevnet »

The mouse events are defined separate from the keyboard events.

http://irrlicht.sourceforge.net/docu/na ... .html#a181
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

knicholes wrote:It gives a great example on how to handle a keyboard event, but there's nothing about mouse events (lclick, rclick, wheel) in the examples that I could find.
the usage is the same though... :roll:
and jddevnet pointed you in the right direction... :lol:

and you always can search the forum...
ohh, no, you always should search the forum !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply