mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 01:21:57 -05:00
Avoid a pointless matrix copy and multiply in Entity_GetTransform
This commit is contained in:
parent
2465b488d4
commit
3798a2d6e2
2 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue