Hi all,
i'm looking tutorials that show me how to manage a collision between maps and 3 objects.
Collision between map and player is easy to manage, but i have other 2 problems:
1) Collision between Player1 and Player2
Now when Player1 touch Player2, there is a mix of meshes, i don't want it.
2) Collision between Player1 bullet and Player2
How to make bullet hidden and decrement Player2 energy when there is a collision between Player2 and bullet?
I'have found some posts about ITriangleMetaSelector, but i have no idea how to use it, can someone help me with a short snippet, a short example?
Thank You
Tony.
Multi collision management
create triangle selectors to all your meshes.
create meta triangle selector.
use metaTriangleSelector->addSelector() to add all your triangle selectors.
then add meta triangle selector to camera collision response animator.
create meta triangle selector.
use metaTriangleSelector->addSelector() to add all your triangle selectors.
then add meta triangle selector to camera collision response animator.
Last edited by n00b on Wed Nov 22, 2006 12:39 pm, edited 1 time in total.
Tonyx,
If you go through the collision tutorial (I think tutorial 7 from memory), it shows how to do a ray/scenenode collision. Your ray is your bullet path, your scenenode is your player 2. You get out of it a coordinate position which is the intersection point.
Cheers,
Pinks
If you go through the collision tutorial (I think tutorial 7 from memory), it shows how to do a ray/scenenode collision. Your ray is your bullet path, your scenenode is your player 2. You get out of it a coordinate position which is the intersection point.
Cheers,
Pinks
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
#irrlicht on irc.freenode.net
sgt_pinky Thank you for your answer, but i have a problem with your solution.
My bullet has a speed, so if i shoot from large distance (using ray for collision) is possible that when the bullet arrive to target (player2), the target is not still in this position.
n00b thank you for your answer, i think is the best solution!!
Tnx guys, i'll try both solutions.
p.s. i'm sorry for my english, i hope you undestand.
My bullet has a speed, so if i shoot from large distance (using ray for collision) is possible that when the bullet arrive to target (player2), the target is not still in this position.
n00b thank you for your answer, i think is the best solution!!
Tnx guys, i'll try both solutions.
p.s. i'm sorry for my english, i hope you undestand.
Code: Select all
core::aabbox3d<f32> boxbullet = bullet->getTransformedBoundingBox();
core::aabbox3d<f32> boxplayer2 = player2->getTransformedBoundingBox ();
if(boxbullet.intersectsWithBox(boxplayer2) == true) {
sound_hit->play();
.........
etc. etc.
}
Thank you guys.