How to Check Collision between two Animated Models

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.

Postby Toovy » Wed May 30, 2007 5:30 pm

hi!

if you are creating a Beat'm Up game just one idea comes to my mind. I think you could create invisible boxes and append them to a fix point on the mesh, for example the hand. (like when attaching a weapon to a mesh, maybe as a subnode of the node) Then, because the box always moves with the mesh's hand, you could check for the collision between the invisible box and the invisible boxes on the other mesh (e.g. the head box).

The same principle is used in some shooters to check with part of the body is hit by the bullet.

I don't know how to attach something in irrlicht, but maybe it helps ;).

good luck!
Toovy
 
Posts: 4
Joined: Wed May 30, 2007 1:23 pm

Postby Dorth » Wed May 30, 2007 5:44 pm

Actually, depending of the details required, Dances' idea is likely the best. But again, nothing beats a physic engine. Now, would anyone know how to split the faces of a model in different collision group based on their vertex color, or some other trick you might know? (actually, I can assign the vertice/triangle to the physic engine just fine I just need the way to split the model parts based on in-model info ^^)
Dorth
 
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Postby smartwhiz » Wed May 30, 2007 9:02 pm

u mean... a ray with a distance in front would be a better one..(that means only in the angle which the ray is projected will be detected???) i don't think so... well everyone has their own opinion...

@Toovy: thats wht i meant which every mesh u want hav a bounding box to it... will giv u an accurate collision detection...

afterall how much ever the argument goes on ... its the final runnin code that wins... kiran show us which is gud enough!!! and thats a challenge for u... hehehehe :D
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby kiranmaya » Sun Jun 17, 2007 8:21 pm

problem is solved by

Attaching invisible boxes to joints of animeted meshes,
smgr->addAnimatedMeshSceneNode(smgr->getMesh("media/box.x"), jointName);

and checking if boxes are in collision by
Code: Select all
bool intersectsWithBox (const aabbox3d< T > &other) const
kiranmaya
 
Posts: 31
Joined: Tue Jan 30, 2007 9:10 am

Postby Dorth » Sun Jun 17, 2007 9:13 pm

Or better yet, to make a non aabb box (so a simple box) in-between 2 oints, since often this is closer to the effect looked for.

Code: Select all
         |----------------------------------|
Joint A *|  Box that will detect collision  |* B Joint
         |----------------------------------|



thus you get whichever part was in-between collided ^^
Dorth
 
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Previous

Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest