summaryrefslogtreecommitdiffstats
path: root/src/peds/PedIK.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/PedIK.cpp')
-rw-r--r--src/peds/PedIK.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/peds/PedIK.cpp b/src/peds/PedIK.cpp
index 3db3dc0f..0c7509eb 100644
--- a/src/peds/PedIK.cpp
+++ b/src/peds/PedIK.cpp
@@ -33,13 +33,18 @@ CPedIK::CPedIK(CPed *ped)
#ifdef PED_SKIN
inline RwMatrix*
-GetComponentMatrix(CPed *ped, int32 node)
+GetBoneMatrix(CPed *ped, int32 bone)
{
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(ped->GetClump());
- int idx = RpHAnimIDGetIndex(hier, ped->m_pFrames[node]->nodeID);
+ int idx = RpHAnimIDGetIndex(hier, bone);
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
return &mats[idx];
}
+inline RwMatrix*
+GetComponentMatrix(CPed *ped, int32 node)
+{
+ return GetBoneMatrix(ped, ped->m_pFrames[node]->nodeID);
+}
#endif
void
@@ -245,7 +250,7 @@ CPedIK::LookInDirection(float phi, float theta)
}
// parent of head is torso
- RwMatrix worldMat = *GetComponentMatrix(m_ped, BONE_torso);
+ RwMatrix worldMat = *GetComponentMatrix(m_ped, PED_NECK);
ExtractYawAndPitchWorld(&worldMat, &yaw, &pitch);
LimbMoveStatus headStatus = MoveLimb(m_headOrient, CGeneral::LimitRadianAngle(phi - yaw),