| 1533 | |
| 1534 | #if WITH_GRANNY |
| 1535 | void Tr2GrannyAnimation::UpdateAimingBone() |
| 1536 | { |
| 1537 | if( m_aimingBone ) |
| 1538 | { |
| 1539 | granny_int32x boneIndex; |
| 1540 | granny_real32 orientAxis[3] = { m_aimAxis[0], m_aimAxis[1], m_aimAxis[2] }; |
| 1541 | granny_real32 target[3] = { m_aimBoneOrientation[0], m_aimBoneOrientation[1], m_aimBoneOrientation[2] }; |
| 1542 | granny_real32 offset_matrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; |
| 1543 | |
| 1544 | if( GrannyFindBoneByNameLowercase( m_skeleton, m_aimBone.c_str(), &boneIndex ) ) |
| 1545 | { |
| 1546 | auto id = IdentityMatrix(); |
| 1547 | GrannyBuildWorldPose( m_skeleton, 0, m_skeleton->BoneCount, m_localPose, &id.m[0][0], m_worldPose ); |
| 1548 | GrannyIKOrientTowards( boneIndex, orientAxis, target, m_skeleton, m_localPose, offset_matrix, m_worldPose ); |
| 1549 | } |
| 1550 | } |
| 1551 | } |
| 1552 | |
| 1553 | void Tr2GrannyAnimation::UpdateDebugRenderer( const Matrix& modelTransform ) |
| 1554 | { |