From 3dd32515fe3405536be53e677c24775c1ee87752 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 24 Dec 2022 17:20:03 -0600 Subject: [PATCH] feat(matrix): add C44Matrix::Scale for float --- tempest/matrix/C44Matrix.cpp | 14 ++++++++++++++ tempest/matrix/C44Matrix.hpp | 1 + 2 files changed, 15 insertions(+) diff --git a/tempest/matrix/C44Matrix.cpp b/tempest/matrix/C44Matrix.cpp index 16f96cf..ce637a4 100644 --- a/tempest/matrix/C44Matrix.cpp +++ b/tempest/matrix/C44Matrix.cpp @@ -79,6 +79,20 @@ void C44Matrix::Scale(const C3Vector& scale) { this->c2 *= scale.z; } +void C44Matrix::Scale(float scale) { + this->a0 *= scale; + this->a1 *= scale; + this->a2 *= scale; + + this->b0 *= scale; + this->b1 *= scale; + this->b2 *= scale; + + this->c0 *= scale; + this->c1 *= scale; + this->c2 *= scale; +} + C44Matrix operator*(const C44Matrix& l, float a) { float a0 = l.a0 * a; float a1 = l.a1 * a; diff --git a/tempest/matrix/C44Matrix.hpp b/tempest/matrix/C44Matrix.hpp index 9474166..fb92df1 100644 --- a/tempest/matrix/C44Matrix.hpp +++ b/tempest/matrix/C44Matrix.hpp @@ -50,6 +50,7 @@ class C44Matrix { C44Matrix Inverse(float det) const; void RotateAroundZ(float angle); void Scale(const C3Vector& scale); + void Scale(float scale); }; C44Matrix operator*(const C44Matrix& l, float a);