Collision question

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
hzsyber
Posts: 52
Joined: Tue Apr 01, 2008 2:21 pm
Location: Canton,China.

Collision question

Post by hzsyber »

I load some meshs, one like a stick, other like ball.

i want take a stick to touch balls.

question:

how can i know which one ball is touch?

Code: Select all

if (smgr->getSceneCollisionManager()->getCollisionPoint(line, meta, intersection, tri)
i have a collision.
but i don't know stick touch ball is.....
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Presuming meta is a Meta Triangle Selector, you may as well just not put all your selectors into a meta selector and instead keep them in an array or something, ie:

Code: Select all

if (smgr->getSceneCollisionManager()->getCollisionPoint(line, selector[0], intersection, tri)
doSomething();
...
if (smgr->getSceneCollisionManager()->getCollisionPoint(line, selector[1], intersection, tri)
doSomethingElse();
Because all a Meta Triangle Selector does anyways is group your triangle selectors into an array behind the scenes.
Post Reply