summaryrefslogtreecommitdiffstats
path: root/src/animation
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-01-13 14:54:45 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-01-13 14:54:45 +0100
commit011a9cc775bb37313af2ee6b7af2b84eb00df058 (patch)
treed310b443e28f48b9b39a539bf18d93311a9d58b8 /src/animation
parentfix save loading, hopefully (diff)
parentremove scriptspath from premake (diff)
downloadre3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar.gz
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar.bz2
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar.lz
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar.xz
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.tar.zst
re3-011a9cc775bb37313af2ee6b7af2b84eb00df058.zip
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/AnimBlendClumpData.cpp2
-rw-r--r--src/animation/AnimBlendClumpData.h6
-rw-r--r--src/animation/FrameUpdate.cpp28
3 files changed, 19 insertions, 17 deletions
diff --git a/src/animation/AnimBlendClumpData.cpp b/src/animation/AnimBlendClumpData.cpp
index 92515427..702ee811 100644
--- a/src/animation/AnimBlendClumpData.cpp
+++ b/src/animation/AnimBlendClumpData.cpp
@@ -7,7 +7,7 @@
CAnimBlendClumpData::CAnimBlendClumpData(void)
{
numFrames = 0;
- velocity = nil;
+ velocity2d = nil;
frames = nil;
link.Init();
}
diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h
index fc74b42d..acfd006f 100644
--- a/src/animation/AnimBlendClumpData.h
+++ b/src/animation/AnimBlendClumpData.h
@@ -3,7 +3,6 @@
#include "AnimBlendList.h"
-// TODO: put somewhere else
struct AnimBlendFrameData
{
enum {
@@ -38,7 +37,10 @@ public:
#ifdef PED_SKIN
int32 modelNumber; // doesn't seem to be used
#endif
- CVector *velocity;
+ union {
+ CVector2D *velocity2d;
+ CVector *velocity3d;
+ };
// order of frames is determined by RW hierarchy
AnimBlendFrameData *frames;
diff --git a/src/animation/FrameUpdate.cpp b/src/animation/FrameUpdate.cpp
index 6e5501cb..c7d347b3 100644
--- a/src/animation/FrameUpdate.cpp
+++ b/src/animation/FrameUpdate.cpp
@@ -29,7 +29,7 @@ FrameUpdateCallBackNonSkinned(AnimBlendFrameData *frame, void *arg)
AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg;
if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION &&
- gpAnimBlendClump->velocity){
+ gpAnimBlendClump->velocity2d){
if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION_3D)
FrameUpdateCallBackWith3dVelocityExtractionNonSkinned(frame, arg);
else
@@ -138,11 +138,11 @@ FrameUpdateCallBackWithVelocityExtractionNonSkinned(AnimBlendFrameData *frame, v
}
if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){
- gpAnimBlendClump->velocity->x = transx - curx;
- gpAnimBlendClump->velocity->y = transy - cury;
+ gpAnimBlendClump->velocity2d->x = transx - curx;
+ gpAnimBlendClump->velocity2d->y = transy - cury;
if(looped){
- gpAnimBlendClump->velocity->x += endx;
- gpAnimBlendClump->velocity->y += endy;
+ gpAnimBlendClump->velocity2d->x += endx;
+ gpAnimBlendClump->velocity2d->y += endy;
}
mat->pos.x = pos.x - transx;
mat->pos.y = pos.y - transy;
@@ -218,9 +218,9 @@ FrameUpdateCallBackWith3dVelocityExtractionNonSkinned(AnimBlendFrameData *frame,
}
if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){
- *gpAnimBlendClump->velocity = trans - cur;
+ *gpAnimBlendClump->velocity3d = trans - cur;
if(looped)
- *gpAnimBlendClump->velocity += end;
+ *gpAnimBlendClump->velocity3d += 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;
@@ -241,7 +241,7 @@ FrameUpdateCallBackSkinned(AnimBlendFrameData *frame, void *arg)
AnimBlendFrameUpdateData *updateData = (AnimBlendFrameUpdateData*)arg;
if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION &&
- gpAnimBlendClump->velocity){
+ gpAnimBlendClump->velocity2d){
if(frame->flag & AnimBlendFrameData::VELOCITY_EXTRACTION_3D)
FrameUpdateCallBackWith3dVelocityExtractionSkinned(frame, arg);
else
@@ -353,11 +353,11 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void
}
if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){
- gpAnimBlendClump->velocity->x = transx - curx;
- gpAnimBlendClump->velocity->y = transy - cury;
+ gpAnimBlendClump->velocity2d->x = transx - curx;
+ gpAnimBlendClump->velocity2d->y = transy - cury;
if(looped){
- gpAnimBlendClump->velocity->x += endx;
- gpAnimBlendClump->velocity->y += endy;
+ gpAnimBlendClump->velocity2d->x += endx;
+ gpAnimBlendClump->velocity2d->y += endy;
}
xform->t.x = pos.x - transx;
xform->t.y = pos.y - transy;
@@ -433,9 +433,9 @@ FrameUpdateCallBackWith3dVelocityExtractionSkinned(AnimBlendFrameData *frame, vo
}
if((frame->flag & AnimBlendFrameData::IGNORE_TRANSLATION) == 0){
- *gpAnimBlendClump->velocity = trans - cur;
+ *gpAnimBlendClump->velocity3d = trans - cur;
if(looped)
- *gpAnimBlendClump->velocity += end;
+ *gpAnimBlendClump->velocity3d += 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;