Avoid a pointless matrix copy and multiply in Entity_GetTransform

This commit is contained in:
UnknownShadow200 2019-10-10 19:55:05 +11:00
parent 2465b488d4
commit 3798a2d6e2
2 changed files with 2 additions and 4 deletions

View file

@ -87,10 +87,8 @@ float Entity_GetEyeHeight(struct Entity* e) {
void Entity_GetTransform(struct Entity* e, Vec3 pos, Vec3 scale, struct Matrix* m) {
struct Matrix tmp;
*m = Matrix_Identity;
Matrix_Scale(m, scale.X, scale.Y, scale.Z);
Matrix_Scale(&tmp, scale.X, scale.Y, scale.Z);
Matrix_MulBy(m, &tmp);
Matrix_RotateZ(&tmp, -e->RotZ * MATH_DEG2RAD);
Matrix_MulBy(m, &tmp);
Matrix_RotateX(&tmp, -e->RotX * MATH_DEG2RAD);

View file

@ -938,7 +938,7 @@ static void EnvRenderer_Reset(void) {
Mem_Free(Weather_Heightmap);
Weather_Heightmap = NULL;
lastPos = IVec3_MaxValue();
lastPos = IVec3_MaxValue();
}
static void EnvRenderer_OnNewMapLoaded(void) {