Lanowen
15-01-2011 06:34:47
I want to create a more complicated hit detection body for my character, that moves when the character also moves. I don't need any sort of rag doll effect that where collisions and physics also effect the position of the bones. I just need the body to follow the bones like hit-boxes would in a game like Super Smash Bros.
Is there a way that I can attach a OgreNewt::Body to an Ogre::Bone from the skeleton of my character, so that it moves as the bone moves in an efficient manner?
The only way I really had any success was to attach a body to a new node and create a listener for the bone, and have it update the position and orientation of the body when the bone position/orientation updates. But I am thinking there has to be some other way to do it better?
I was trying to read up on joints and whatnot but I didn't get too far.
I tried to search the forums some people were trying to do the same thing but no solutions were really posted. Or maybe I am going about my problem wrong.
I just want to create hit bodies for things like enemies and projectiles and lava or whatever that is more accurate than just doing bounding box detection.
Is there a way that I can attach a OgreNewt::Body to an Ogre::Bone from the skeleton of my character, so that it moves as the bone moves in an efficient manner?
The only way I really had any success was to attach a body to a new node and create a listener for the bone, and have it update the position and orientation of the body when the bone position/orientation updates. But I am thinking there has to be some other way to do it better?
I was trying to read up on joints and whatnot but I didn't get too far.
I tried to search the forums some people were trying to do the same thing but no solutions were really posted. Or maybe I am going about my problem wrong.
I just want to create hit bodies for things like enemies and projectiles and lava or whatever that is more accurate than just doing bounding box detection.