Page 1 of 1

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

Posted: Wed Oct 29, 2008 1:43 pm
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.

Posted: Wed Oct 29, 2008 2:01 pm
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.

Posted: Wed Oct 29, 2008 2:07 pm
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

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

Posted: Wed Oct 29, 2008 2:17 pm
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... ;)

Nahhh

Posted: Thu Oct 30, 2008 10:36 pm
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.

Posted: Thu Oct 30, 2008 10:54 pm
by jddevnet
The mouse events are defined separate from the keyboard events.

http://irrlicht.sourceforge.net/docu/na ... .html#a181

Posted: Thu Oct 30, 2008 11:44 pm
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 !!! ;)