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.

How to Check Collision between two Animated Models

Postby kiranmaya » Tue May 29, 2007 7:21 pm

Actually i want to check if collision occur between two Animated Mesh's are not,if collision occurs i have to increment the integer values "i" for first one.X and "j" for two.X.
is Irrlicht have such kind of classes, like collision responce Animator ,
or i have to use external physics systems.
How can i do that ?

I have searched in Irrlicht fourms ,but i can't find any
Last edited by kiranmaya on Tue May 29, 2007 8:06 pm, edited 1 time in total.
kiranmaya
 
Posts: 31
Joined: Tue Jan 30, 2007 9:10 am

Postby smartwhiz » Tue May 29, 2007 7:26 pm

irrlicht has its own boundin box collision identifiers...
two animated mesh collision can be chked by chkin their bounding boxs are in collision or not...
so there's the hint for u.. now chk the documentations and write a code..
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby kiranmaya » Tue May 29, 2007 7:32 pm

Actually here two Mesh's r fighting,
bounding box ,means two box's r colliding

here one arm of one.x has beat two.x face.with bounding box is it possible
kiranmaya
 
Posts: 31
Joined: Tue Jan 30, 2007 9:10 am

Postby smartwhiz » Tue May 29, 2007 7:39 pm

bounding box means a box that actually is preset with the mesh for it animations too... every animated mesh can be set to hav a bounding box... so when u hav two characters with there bounding boxs xomin close to each other... their collisions can be identified by these boxs...
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby kiranmaya » Tue May 29, 2007 7:48 pm

Thanks for helping...i will try in u r way
kiranmaya
 
Posts: 31
Joined: Tue Jan 30, 2007 9:10 am

Postby Dances » Tue May 29, 2007 7:51 pm

Bounding box collision wouldn't work for punching, though, because I don't think it will let you determine which node triggered the collision. I think the appropriate way to do it would be using scene node picking like in the collision tutorial...
User avatar
Dances
 
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada

Postby smartwhiz » Tue May 29, 2007 8:04 pm

frm the documentation...
each aabbox3d has a function as
bool intersectsWithBox (const aabbox3d< T > &other) const


if ur two animated meshes are A and B...
then both of their meshes hav a bounding box rit...
A.box and B.box...

call the A box function with the argument as B... and u can understand whether the bounding box of A is in collision with B or not by its return boolean value..
Like
chkvar=A.box.intersectsWithBox (B.box);

BUT... u will hav to write specific code if u want A mesh to be Facing B...
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby kiranmaya » Tue May 29, 2007 8:30 pm

im thinking in this way

By creating two collision Responce animators for both one.x,two.x,
like anim1 to two.x and anim2 to one.x
here collision works
but again
same question how to get collision occurs or not?
kiranmaya
 
Posts: 31
Joined: Tue Jan 30, 2007 9:10 am

Postby smartwhiz » Tue May 29, 2007 8:40 pm

hey buddy... thats wht i said in my last post... the function gives a true value if both the boundin boxs collide else a false value...
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby Robert Y. » Wed May 30, 2007 6:39 am

@smartwhiz:

kiranmaya is looking for a way more sophisticated collision detection than is possible with bounding boxes. The solution mentioned by Dances is better, or indeed a physics engine should be used.
Robert Y.
 
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Postby BlindSide » Wed May 30, 2007 7:46 am

Actually in a fighting game using general collision techniques is super silly. You will be better off coding your own movement and testing using maybe rays (getRayCollideWithBB or something, please check the API docs) from the model to see if the punch collided. You should only apply the selector for the ray to the model recieving the punch, and vice-versa.
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby smartwhiz » Wed May 30, 2007 7:57 am

it depends ... suppose u r goin for a Third person game then box to box is best....
and if its a first person too... box of the hand to the character would be better...
but if its first person shooter then as Dances said... a ray frm the screen and findin the collision of that ray in the world would be good (like in collision tut)...

since kiranmaya hasn't mentioned wht is actually tryin to do...
can't really giv a solution..
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby Robert Y. » Wed May 30, 2007 9:55 am

since kiranmaya hasn't mentioned wht is actually tryin to do...


Yes he did:
Actually here two Mesh's r fighting,
bounding box ,means two box's r colliding

here one arm of one.x has beat two.x face.with bounding box is it possible


If you have a bounding box for the whole character, your solution won't work (standing next to eachother already will give a collision). If bounding boxes for the hand and face are used, it may work.
Robert Y.
 
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Postby smartwhiz » Wed May 30, 2007 10:11 am

ONLY BOUNDING BOX WOULD WORK...(of course a complex framework)
how do u expect ray collision to work here..??? if the character is far away and a ray is send still its gettin collided rit... but are u (ur character) in collision??
@Robert Y: i still can't understand the method u said to use???
in the collision tut it explains the way how a ray frm the screen is send to the 3d space and gets an object frm there and the location of hit...
well accordin to Kiranmaya... assumin that its a fightin game... if needs to get accurate collision for that... either he will hav to set up a physics collision model(separate for each part of the body) or a ragdoll with the help of a physics SDK....
basically in a physics SDK also the same procedure is maintained... the term assignin a collision model means addin a bounding model (a invisible boundary for collision)... so the basic of all collisions is the bounding box (or collision model)...
hence he needs to understand it!!!

the statement i hav made here is purly on the assumption that kiran is tryin on a streetfighter kind of a fightin game..
Thanks and With Regards
Smartwhiz
smartwhiz
 
Posts: 120
Joined: Wed Jan 14, 2004 6:03 pm
Location: India

Postby Dances » Wed May 30, 2007 4:09 pm

smartwhiz wrote:ONLY BOUNDING BOX WOULD WORK...(of course a complex framework)
how do u expect ray collision to work here..??? if the character is far away and a ray is send still its gettin collided rit... but are u (ur character) in collision??
@Robert Y: i still can't understand the method u said to use???
in the collision tut it explains the way how a ray frm the screen is send to the 3d space and gets an object frm there and the location of hit...
well accordin to Kiranmaya... assumin that its a fightin game... if needs to get accurate collision for that...


After you get the node from the ray you use your nodes' position to test the distance OR you limit the distance your ray/line can go.
User avatar
Dances
 
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada

Next

Return to Beginners Help

Who is online

Users browsing this forum: rcalvin and 0 guests