Pushing, Hitting, Kicking Objects

KATO2

21-08-2011 03:02:23

Hello peoples.

I have an character what has three skeletal animations (Pushing, Hitting, Kicking). I was created an ogre application and i was agregated physical simulation with ogrenewt, but i need determinate the contact point between punch or foot and object and aplicate the force to the object.

Does anyone know how to do that? or anyone know how to make that a primitive follow a bone without using ragdoll?

I appreciate any help you can provide me.

SFCBias

21-08-2011 13:22:32

The best way i can think of off the top of my head is, in your contact callback (if your using them) find out which OgreBone is making the contact, you can do this by setting the userData on the object to something that will allow you to retrieve the bones. Then just find out the position of the bone and its contact point and apply force there.

KATO2

21-08-2011 18:18:37

i don't hava using a contact callback function, because i don't know how to do for add a collision primitive to a bone.

SFCBias

22-08-2011 00:56:01

Well, you have 2 options i think. 1) You could take the OgreBones used for animations, and use the information provided from them (length,width, etc) and create a capsule or other collision primitive around each one, or each group. Then use joints to connect them. (This is essentially a ragdoll).

2) You could create a convex collision around your object.

Basically to achieve your goal, you must locate the point of contact (This is easiest if you set up Collision Callbacks) and apply force there. However you create the collision for the player is up to you.

KATO2

22-08-2011 03:32:59

Thank you SFCBias i will try the first option.