MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateAimingBone

Method UpdateAimingBone

trinity/Tr2GrannyAnimation.cpp:1535–1551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1533
1534#if WITH_GRANNY
1535void 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
1553void Tr2GrannyAnimation::UpdateDebugRenderer( const Matrix& modelTransform )
1554{

Callers

nothing calls this directly

Calls 6

TransposeFunction · 0.85
TriQuaternionRotationArcFunction · 0.85
sizeMethod · 0.80
Vector3Class · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected