diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2021-01-13 21:15:33 +0100 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2021-01-13 21:15:33 +0100 |
commit | 97c9a4a02c9f801d35fbcf47658756a89a33f6d9 (patch) | |
tree | 232709023f42a318c0588b61f4de2c91b724a5b1 /src/animation | |
parent | Merge branch 'lcs' of https://github.com/GTAmodding/re3 into lcs (diff) | |
download | re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar.gz re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar.bz2 re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar.lz re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar.xz re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.tar.zst re3-97c9a4a02c9f801d35fbcf47658756a89a33f6d9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/animation/AnimBlendClumpData.cpp | 2 | ||||
-rw-r--r-- | src/animation/AnimBlendClumpData.h | 6 | ||||
-rw-r--r-- | src/animation/FrameUpdate.cpp | 42 | ||||
-rw-r--r-- | src/animation/RpAnimBlend.cpp | 2 |
4 files changed, 25 insertions, 27 deletions
diff --git a/src/animation/AnimBlendClumpData.cpp b/src/animation/AnimBlendClumpData.cpp index 620c2229..4e8f3153 100644 --- a/src/animation/AnimBlendClumpData.cpp +++ b/src/animation/AnimBlendClumpData.cpp @@ -8,7 +8,7 @@ CAnimBlendClumpData::CAnimBlendClumpData(void) { numFrames = 0; - velocity2d = nil; + velocity = nil; frames = nil; link.Init(); } diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h index bb711b28..633fc7b9 100644 --- a/src/animation/AnimBlendClumpData.h +++ b/src/animation/AnimBlendClumpData.h @@ -3,6 +3,7 @@ #include "AnimBlendList.h" +// TODO: put somewhere else struct AnimBlendFrameData { enum { @@ -30,10 +31,7 @@ class CAnimBlendClumpData public: CAnimBlendLink link; int32 numFrames; - union { - CVector2D *velocity2d; - CVector *velocity3d; - }; + CVector *velocity; // order of frames is determined by RW hierarchy AnimBlendFrameData *frames; diff --git a/src/animation/FrameUpdate.cpp b/src/animation/FrameUpdate.cpp index e35bd4c8..a085fd4b 100644 --- a/src/animation/FrameUpdate.cpp +++ b/src/animation/FrameUpdate.cpp @@ -33,7 +33,7 @@ FrameUpdateCallBackNonSkinned(AnimBlendFrameData *frame, void *arg) AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg; if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && - gpAnimBlendClump->velocity2d){ + gpAnimBlendClump->velocity){ if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION_3D) FrameUpdateCallBackWith3dVelocityExtractionNonSkinned(frame, arg); else @@ -142,11 +142,11 @@ FrameUpdateCallBackWithVelocityExtractionNonSkinned(AnimBlendFrameData *frame, v } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - gpAnimBlendClump->velocity2d->x = transx - curx; - gpAnimBlendClump->velocity2d->y = transy - cury; + gpAnimBlendClump->velocity->x = transx - curx; + gpAnimBlendClump->velocity->y = transy - cury; if(looped){ - gpAnimBlendClump->velocity2d->x += endx; - gpAnimBlendClump->velocity2d->y += endy; + gpAnimBlendClump->velocity->x += endx; + gpAnimBlendClump->velocity->y += endy; } mat->pos.x = pos.x - transx; mat->pos.y = pos.y - transy; @@ -222,9 +222,9 @@ FrameUpdateCallBackWith3dVelocityExtractionNonSkinned(AnimBlendFrameData *frame, } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - *gpAnimBlendClump->velocity3d = trans - cur; + *gpAnimBlendClump->velocity = trans - cur; if(looped) - *gpAnimBlendClump->velocity3d += end; + *gpAnimBlendClump->velocity += end; mat->pos.x = (pos - trans).x + frame->resetPos.x; mat->pos.y = (pos - trans).y + frame->resetPos.y; mat->pos.z = (pos - trans).z + frame->resetPos.z; @@ -244,7 +244,7 @@ FrameUpdateCallBackSkinned(AnimBlendFrameData *frame, void *arg) AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg; if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && - gpAnimBlendClump->velocity2d){ + gpAnimBlendClump->velocity){ if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION_3D) FrameUpdateCallBackWith3dVelocityExtractionSkinned(frame, arg); else @@ -354,11 +354,11 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - gpAnimBlendClump->velocity2d->x = transx - curx; - gpAnimBlendClump->velocity2d->y = transy - cury; + gpAnimBlendClump->velocity->x = transx - curx; + gpAnimBlendClump->velocity->y = transy - cury; if(looped){ - gpAnimBlendClump->velocity2d->x += endx; - gpAnimBlendClump->velocity2d->y += endy; + gpAnimBlendClump->velocity->x += endx; + gpAnimBlendClump->velocity->y += endy; } xform->t.x = pos.x - transx; xform->t.y = pos.y - transy; @@ -434,9 +434,9 @@ FrameUpdateCallBackWith3dVelocityExtractionSkinned(AnimBlendFrameData *frame, vo } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - *gpAnimBlendClump->velocity3d = trans - cur; + *gpAnimBlendClump->velocity = trans - cur; if(looped) - *gpAnimBlendClump->velocity3d += end; + *gpAnimBlendClump->velocity += end; xform->t.x = (pos - trans).x + frame->resetPos.x; xform->t.y = (pos - trans).y + frame->resetPos.y; xform->t.z = (pos - trans).z + frame->resetPos.z; @@ -446,7 +446,7 @@ FrameUpdateCallBackWith3dVelocityExtractionSkinned(AnimBlendFrameData *frame, vo void FrameUpdateCallBackOffscreen(AnimBlendFrameData *frame, void *arg) { - if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && gpAnimBlendClump->velocity2d) + if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && gpAnimBlendClump->velocity) FrameUpdateCallBackWithVelocityExtractionSkinned(frame, arg); } @@ -466,7 +466,7 @@ FrameUpdateCallBackNonSkinnedCompressed(AnimBlendFrameData *frame, void *arg) AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg; if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && - gpAnimBlendClump->velocity2d){ + gpAnimBlendClump->velocity){ if(updateData->foobar) for(node = updateData->nodes; *node; node++) if((*node)->sequence && (*node)->association->IsPartial()) @@ -511,9 +511,9 @@ FrameUpdateCallBackNonSkinnedCompressed(AnimBlendFrameData *frame, void *arg) } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - *gpAnimBlendClump->velocity3d = trans - cur; + *gpAnimBlendClump->velocity = trans - cur; if(looped) - *gpAnimBlendClump->velocity3d += end; + *gpAnimBlendClump->velocity += end; mat->pos.x = (pos - trans).x + frame->resetPos.x; mat->pos.y = (pos - trans).y + frame->resetPos.y; mat->pos.z = (pos - trans).z + frame->resetPos.z; @@ -573,7 +573,7 @@ FrameUpdateCallBackSkinnedCompressed(AnimBlendFrameData *frame, void *arg) AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg; if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION && - gpAnimBlendClump->velocity2d){ + gpAnimBlendClump->velocity){ if(updateData->foobar) for(node = updateData->nodes; *node; node++) if((*node)->sequence && (*node)->association->IsPartial()) @@ -620,9 +620,9 @@ FrameUpdateCallBackSkinnedCompressed(AnimBlendFrameData *frame, void *arg) } if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){ - *gpAnimBlendClump->velocity3d = trans - cur; + *gpAnimBlendClump->velocity = trans - cur; if(looped) - *gpAnimBlendClump->velocity3d += end; + *gpAnimBlendClump->velocity += end; xform->t.x = (pos - trans).x + frame->resetPos.x; xform->t.y = (pos - trans).y + frame->resetPos.y; xform->t.z = (pos - trans).z + frame->resetPos.z; diff --git a/src/animation/RpAnimBlend.cpp b/src/animation/RpAnimBlend.cpp index 9223d198..c4103dbf 100644 --- a/src/animation/RpAnimBlend.cpp +++ b/src/animation/RpAnimBlend.cpp @@ -437,7 +437,7 @@ RpAnimBlendNodeUpdateKeyframes(AnimBlendFrameData *frames, AnimBlendFrameUpdateD CAnimBlendAssociation *a = (*node)->association; for(i = 0; i < numNodes; i++) if((frames[i].flag & AnimBlendFrameData::VELOCITY_EXTRACTION) == 0 || - gpAnimBlendClump->velocity2d == nil){ + gpAnimBlendClump->velocity == nil){ if((*node)[i].sequence) (*node)[i].FindKeyFrame(a->currentTime - a->timeStep); } |