Collision Detection and Game Logic

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
LunarEffect
Posts: 4
Joined: Thu Feb 26, 2009 6:43 pm

Collision Detection and Game Logic

Post by LunarEffect »

Hey guys! I'm sorry if you've answered this question before, but I couldn't find anything of the likes on the forum. =)

My problem is the following:
The class "ISceneCollisionManager" gives me functions to return an ISceneNode that something has collided with (examples "getSceneNodeFromCameraBB" "getSceneNodeFromRayBB" ..etc).

Now if, say, I wanted to check the collision with a certain box, that then causes the game to display "Yay, you hit the box", what would be the best approach?

Let the game react to the ISceneNode's name I gave it when I created it?
Create my own Scene node, that also has a method like... "void drawText(string bla)"?

Would you change your advice if this was on a larger scale...like a wall of thousands of boxes that each say something different?

Thank you very much in advance! =)

LunarEffect
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

When it collides, have a function that says something like this:

stringw str = "";
str += node->getName(); // After you set the name of the sceneNode!

cout << "You have collided with: " << str.c_str() << endl;


Something similar to do. Also, when it does that, do something such as device->sleep(40); to pause the game. :)

Hope that helps at all. If you need anything else, just tell.
Josiah Hartzell
Image
Post Reply