How to Check Collision between two Animated Models
How to Check Collision between two Animated Models
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
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.
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
frm the documentation...
each aabbox3d has a function as
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...
each aabbox3d has a function as
if ur two animated meshes are A and B...bool intersectsWithBox (const aabbox3d< T > &other) const
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
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.
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..
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
Yes he did:since kiranmaya hasn't mentioned wht is actually tryin to do...
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.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
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..
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
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.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...