diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-09 19:21:36 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-09 19:21:36 +0200 |
commit | 609caad7a4e61a391e6306996a75d82562283803 (patch) | |
tree | b2e70c4692ec2e04e744863f352265c898267786 /src/peds/PedIK.cpp | |
parent | ccarctrl big fix (diff) | |
parent | accidentally swapped reft and light (diff) | |
download | re3-609caad7a4e61a391e6306996a75d82562283803.tar re3-609caad7a4e61a391e6306996a75d82562283803.tar.gz re3-609caad7a4e61a391e6306996a75d82562283803.tar.bz2 re3-609caad7a4e61a391e6306996a75d82562283803.tar.lz re3-609caad7a4e61a391e6306996a75d82562283803.tar.xz re3-609caad7a4e61a391e6306996a75d82562283803.tar.zst re3-609caad7a4e61a391e6306996a75d82562283803.zip |
Diffstat (limited to 'src/peds/PedIK.cpp')
-rw-r--r-- | src/peds/PedIK.cpp | 11 |
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), |