Page 1 of 1

How can I detect which model give/got the collision?

Posted: Wed Mar 14, 2007 12:42 pm
by CuecaX
I want to know which model is colliding with the other model and the point that it hits.

how can i do this?

thanks in advance :D

Posted: Wed Mar 14, 2007 4:33 pm
by roxaz
if you use newton physics engine then object whitch collide calls a newton callback, in the callback you can also write what to do for a model when it collide. about geting a point of collision i dont know, havent tried ;)

Posted: Thu Mar 15, 2007 4:10 am
by kburkhart84
Yup, Irrlicht's collision detection is very basic and doesn't support collision between scene nodes in this manner, at least that I know of. I mentioned in another post. Here is a linky. http://irrlicht.sourceforge.net/phpBB2/ ... highlight=

:(

Posted: Thu Mar 15, 2007 8:27 pm
by CuecaX
kburkhart84 wrote:Yup, Irrlicht's collision detection is very basic and doesn't support collision between scene nodes in this manner, at least that I know of. I mentioned in another post. Here is a linky. http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
doesnt irrlicht has at last some function to return the name of scene node is coliding with the other? the exact point doesnt matter to much...


i need to check if the player is hitting a cube from underneath (its a "?" mario-like block)
and what block is the player hitting (the bricks block or the yellow "?" block for example)

Posted: Thu Mar 15, 2007 9:57 pm
by roxaz
it would be lots of programming if its possible with irrlicht, but i think its not. better use newton ;)

Posted: Thu Mar 15, 2007 11:03 pm
by Phant0m51
You could cast a short ray straight up from your character, and use it to select the bounding box of a node (use a bitmask for bounding box selection).

This is assuming you're doing a 3d project. I don't know how to do it in 2d, although it may be something similar.

Check the collision tutorial on using a Ray, and then search the forums for ID Bitmasks.

Posted: Fri Mar 16, 2007 5:24 am
by kburkhart84
Phant0m51 wrote:You could cast a short ray straight up from your character, and use it to select the bounding box of a node (use a bitmask for bounding box selection).

This is assuming you're doing a 3d project. I don't know how to do it in 2d, although it may be something similar.

Check the collision tutorial on using a Ray, and then search the forums for ID Bitmasks.
That seems like it would work as well. Also, if world is 3d but gameplay 2d, then there wouldn't be a difference, but if you are using sprites, as in fully 2d, then collision detection suddenlky gets big changes...

Posted: Fri Mar 16, 2007 8:43 pm
by CuecaX
Phant0m51 wrote:You could cast a short ray straight up from your character, and use it to select the bounding box of a node (use a bitmask for bounding box selection).

This is assuming you're doing a 3d project. I don't know how to do it in 2d, although it may be something similar.

Check the collision tutorial on using a Ray, and then search the forums for ID Bitmasks.
good idea... i will try this :)

but i thought that irrlicht has a easier way to detect collided scenenodeĀ“s name, id, pointer or whatever...

and if i write my own code i will post it on Code snipets