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
Can't find something
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.
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.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way