Trying to move a bone. But in code...
Posted: Thu Aug 26, 2010 6:37 am
Hey everyone, i'm having trouble moving a bone using code in the game i am making...
I am using sgmotion to animate a charictor and that all works fine.
I can place hit boxes (ragdoll parts) and things at the positions of the bones by just going.
BoneDebug.World = Matrix.Invert(skinnedModel.SkeletonBones.InverseBindPoseTransform) * animationController.SkinnedBoneTransforms;
This makes BoneDebug.World contain a matrix that is the position of the bone and the rotation of the bone in the world.
The thing is however i want to now set the animationController.SkinnedBoneTransforms with something else that comes from the ragdoll
In other words i want to go in the other direction, so that i am moving the bone using code, to another position and rotation that come from the ragdoll parts.
How can i invert the code above so that i can do this?
Anyone have any ideas?
I am using sgmotion to animate a charictor and that all works fine.
I can place hit boxes (ragdoll parts) and things at the positions of the bones by just going.
BoneDebug.World = Matrix.Invert(skinnedModel.SkeletonBones.InverseBindPoseTransform) * animationController.SkinnedBoneTransforms;
This makes BoneDebug.World contain a matrix that is the position of the bone and the rotation of the bone in the world.
The thing is however i want to now set the animationController.SkinnedBoneTransforms with something else that comes from the ragdoll
In other words i want to go in the other direction, so that i am moving the bone using code, to another position and rotation that come from the ragdoll parts.
How can i invert the code above so that i can do this?
Anyone have any ideas?