diff options
author | aap <aap@papnet.eu> | 2020-05-10 17:09:57 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-10 17:09:57 +0200 |
commit | 5b605c127144ab805581f62015ef3742c1d4a64e (patch) | |
tree | f86a422d080f58afcaa5eac7cf2b378bdf306142 /src/peds/PedIK.cpp | |
parent | Small unification (diff) | |
download | re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar.gz re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar.bz2 re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar.lz re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar.xz re3-5b605c127144ab805581f62015ef3742c1d4a64e.tar.zst re3-5b605c127144ab805581f62015ef3742c1d4a64e.zip |
Diffstat (limited to '')
-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..c9428cb3 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 = *GetBoneMatrix(m_ped, BONE_torso); ExtractYawAndPitchWorld(&worldMat, &yaw, &pitch); LimbMoveStatus headStatus = MoveLimb(m_headOrient, CGeneral::LimitRadianAngle(phi - yaw), |