Hi I need to create events in the game,
like if i get near a door , i need to show some message in some case
maybe something like "Door locked"
and i was thinking how to do that.
I thought about creating a inviseble object and when my
charcter collide this invisible object something happen
but how can Icheck if i collide the invisible object?
is there anyone that has been already made a action rpg game ?
Collsion Manger
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Collsion Manger
That sounds reasonable.nannolo wrote:I thought about creating a inviseble object and when my charcter collide this invisible object something happen
Oh so many ways. ISceneNode::getTransformedBoundingBox() will introduce you to your new best friend, aabbox3df. I suggest you spend some quality time together.nannolo wrote:but how can Icheck if i collide the invisible object?
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
-
- Posts: 59
- Joined: Thu May 01, 2008 1:20 am
- Location: New Caledonia (France - Pacific)
- Contact:
What you can also do is:
First, give a radius to your main character or to your camera or to whatever gets close to the door.
Then, place an invisible object where the door is.
Finally, each time the player moves, check the distance to the invisible object. If the distance is smaller than the player radius, call the method that will display your text "Door locked".
This is a basic technique for triggering event such as playing sounds, showing text or moving objects, based on the position of the player.
Be sure to somehow find a way not to test the distance from the player to all event triggers in the world, but only to those that the player is likely to get close to.
First, give a radius to your main character or to your camera or to whatever gets close to the door.
Then, place an invisible object where the door is.
Finally, each time the player moves, check the distance to the invisible object. If the distance is smaller than the player radius, call the method that will display your text "Door locked".
This is a basic technique for triggering event such as playing sounds, showing text or moving objects, based on the position of the player.
Be sure to somehow find a way not to test the distance from the player to all event triggers in the world, but only to those that the player is likely to get close to.
These are great suggestions but the real question is how to identify meshbuffers (sub-meshes) to test for these collisions? This is assuming you are trying to use standard meshes that aren't "scenes" like scenes made from irrEdit.
I had to add my own code to the engine to do it for DirectX meshes so that I could identify specific meshbuffers by name. What would you all suggest?
Some threads of interest:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=28990
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=28912
I had to add my own code to the engine to do it for DirectX meshes so that I could identify specific meshbuffers by name. What would you all suggest?
Some threads of interest:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=28990
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=28912
Re: Collsion Manger
rogerborg wrote: I suggest you spend some quality time together.