Can't find something

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
Pakje
Posts: 11
Joined: Sun Sep 07, 2008 11:42 am

Can't find something

Post by Pakje »

I 've tried searching but i can't seem to find a class that controls the character using a point/click interface.
If some1 got a code snippet where an unit is moves to the place where the user clicks with the mouse, could you share it pls :)

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

Post by JP »

Basically you've got two requirements. Know where the user has clicked in the 3D world and know how to move your character from its current position to that clicked position.

Knowing where the user has clicked is pretty easy using functions from ISceneCollisionManager which has some of that shown in the Collision tutorial.

Moving the character could be done as simply as a fly straight animator from the current point to the clicked point but you'll probably require some pathfinding around objects in your scene and maybe over terrain so you'll have to decide on a way of doing that.
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply