mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-14 09:04:31 +02:00
Merge branch 'master' of https://github.com/XProger/OpenLara
This commit is contained in:
@@ -33,11 +33,6 @@ struct Animation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setModel(const TR::Model *model) {
|
void setModel(const TR::Model *model) {
|
||||||
if (this->model == model)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this->model = model;
|
|
||||||
anims = model ? &level->anims[model->animation] : NULL;
|
|
||||||
time = 0;
|
time = 0;
|
||||||
delta = 0;
|
delta = 0;
|
||||||
dir = 1.0f;
|
dir = 1.0f;
|
||||||
@@ -46,6 +41,12 @@ struct Animation {
|
|||||||
next = 0;
|
next = 0;
|
||||||
overrideMask = 0;
|
overrideMask = 0;
|
||||||
|
|
||||||
|
if (this->model == model)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this->model = model;
|
||||||
|
anims = model ? &level->anims[model->animation] : NULL;
|
||||||
|
|
||||||
if (overrides) {
|
if (overrides) {
|
||||||
delete[] overrides;
|
delete[] overrides;
|
||||||
overrides = NULL;
|
overrides = NULL;
|
||||||
|
@@ -1204,7 +1204,7 @@ struct Controller {
|
|||||||
if (!lockMatrix) {
|
if (!lockMatrix) {
|
||||||
matrix.identity();
|
matrix.identity();
|
||||||
matrix.translate(pos);
|
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.x != 0.0f) matrix.rotateX(angle.x);
|
||||||
if (angle.z != 0.0f) matrix.rotateZ(angle.z);
|
if (angle.z != 0.0f) matrix.rotateZ(angle.z);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user