lianlab / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Manual Bone Transition #265

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now the animation in Ogrekit will override any manual transform state, 
such as using gkBone_object-> applyChannelTransform method.

This patch includes latest patches from Issue 263 
http://code.google.com/p/gamekit/issues/detail?id=263. Thanks to 
underd...@gmail.com.

So right now one can used the following code:
    gkBone * lBone = m_skeleton ->getBone("humerus.R");
    // Set the bone as a manual control bone
        lBone ->setManualControl(true);

        // Create a new transform state
    lState = gkTransformState();
    lState.rot = gkQuaternion(-gkDegree(90), gkVector3::UNIT_X) * gkQuaternion(-gkDegree(m_playerData.m_HeadXScalar), gkVector3::UNIT_Z) * gkQuaternion(gkDegree(45), gkVector3::UNIT_Y);

        // Set the new transform state
        lHandBone ->applyChannelTransform(lState, 1.0);

       // Applying animation and notice that the bone's transform state will not be overrode by animation. However, it will only apply to the particular bone and not to its children. 

Or maybe there is already a better way to handle it? Hope it helps.

Sincerely,
Danil

Original issue reported on code.google.com by CHRISTYH...@gmail.com on 31 Aug 2012 at 5:47

Attachments:

GoogleCodeExporter commented 9 years ago
Nice. I think this can be very useful. 

Original comment by thomas.t...@googlemail.com on 31 Aug 2012 at 10:05

GoogleCodeExporter commented 9 years ago
Thanks for accepting the patch.

I forget to mention the environment specification.
Program Version:
Revision 1168.

Operation System
Windows 7 Professional SP1

Sincerely,
Danil

Original comment by CHRISTYH...@gmail.com on 1 Sep 2012 at 3:23

GoogleCodeExporter commented 9 years ago
Ok, just commited some new stuff including your patch. Also added some lua 
function to set bones to manually controlled (to set the bone-translation will 
follow)

Thx for the patch...

Original comment by thomas.t...@googlemail.com on 6 Sep 2012 at 2:35