1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-14 09:04:31 +02:00
This commit is contained in:
XProger
2018-08-25 09:21:03 +03:00
2 changed files with 7 additions and 6 deletions

View File

@@ -33,11 +33,6 @@ struct Animation {
}
void setModel(const TR::Model *model) {
if (this->model == model)
return;
this->model = model;
anims = model ? &level->anims[model->animation] : NULL;
time = 0;
delta = 0;
dir = 1.0f;
@@ -46,6 +41,12 @@ struct Animation {
next = 0;
overrideMask = 0;
if (this->model == model)
return;
this->model = model;
anims = model ? &level->anims[model->animation] : NULL;
if (overrides) {
delete[] overrides;
overrides = NULL;

View File

@@ -1204,7 +1204,7 @@ struct Controller {
if (!lockMatrix) {
matrix.identity();
matrix.translate(pos);
if (angle.y != 0.0f) matrix.rotateY(angle.y - animation.rot * animation.delta);
if (angle.y != 0.0f) matrix.rotateY(angle.y - (animation.anims != NULL ? (animation.rot * animation.delta) : 0.0f));
if (angle.x != 0.0f) matrix.rotateX(angle.x);
if (angle.z != 0.0f) matrix.rotateZ(angle.z);
}