collision with named node

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
pez
Posts: 4
Joined: Sun Jun 07, 2009 10:44 am

collision with named node

Post by pez »

hello again guys, another quick question,

ive noticed that you can test scene nodes bounding boxes against one another quite easily, i need to do something like this with the camera. i have an animator attached to it to automate the collision with the level, but id like to be able to tell or be notified when the camera collides with a named animated mesh

my program is built on the *.irr loader example, so i thought about maybe using different meta selectors for the camera, but i couldnt figure out how to test for collisions manually

i tried the cameras 'get translated bounding box' function, but that seems no different from the 'view frustrum' bounding box

again sorry in advance if theres a really obvious solution to this :P
METOOOOOOOOOOOOOOOOAAAAAAAAAHL!
pez
Posts: 4
Joined: Sun Jun 07, 2009 10:44 am

Post by pez »

hail all, got it figured out now after a bit of forum trawling

in the end i created a seperate triangle selector for each traps bounding box (a 'trap' is supposed to kill you on contact)

i have a bounding ellipsoid sphere mesh created seperate from the camera to test against the traps, each iteration of the loop i set its position to match that of the camera

i then use ISceneManager::ISceneCollisionManager::getCollisionResultPosition with the traps selector and position, and constantly supply a 'delta' velocity of (0, 0.1, 0) (the numbers arnt really important, its just if theyre set to zero i found the result position is always the same, of course)

after calling getCollisionResultPosition, i check if result == camera position + delta, if it doesnt then there is a collision with the trap
METOOOOOOOOOOOOOOOOAAAAAAAAAHL!
Post Reply