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

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
CuecaX
Posts: 13
Joined: Mon Mar 05, 2007 8:54 pm
Location: Brazil

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

Post 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
loading singature...
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post 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 ;)
kburkhart84
Posts: 277
Joined: Thu Dec 15, 2005 6:11 pm

Post 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=
CuecaX
Posts: 13
Joined: Mon Mar 05, 2007 8:54 pm
Location: Brazil

:(

Post 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)
loading singature...
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

it would be lots of programming if its possible with irrlicht, but i think its not. better use newton ;)
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post 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.
kburkhart84
Posts: 277
Joined: Thu Dec 15, 2005 6:11 pm

Post 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...
CuecaX
Posts: 13
Joined: Mon Mar 05, 2007 8:54 pm
Location: Brazil

Post 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
loading singature...
Post Reply