feat(matrix): add C44Matrix::Translate

This commit is contained in:
fallenoak 2022-12-24 17:22:29 -06:00
parent 3dd32515fe
commit b0a37c4e5e
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
2 changed files with 7 additions and 0 deletions

View file

@ -93,6 +93,12 @@ void C44Matrix::Scale(float scale) {
this->c2 *= scale;
}
void C44Matrix::Translate(const C3Vector& move) {
this->d0 = this->a0 * move.x + this->b0 * move.y + this->c0 * move.z + this->d0;
this->d1 = this->a1 * move.x + this->b1 * move.y + this->c1 * move.z + this->d1;
this->d2 = this->a2 * move.x + this->b2 * move.y + this->c2 * move.z + this->d2;
}
C44Matrix operator*(const C44Matrix& l, float a) {
float a0 = l.a0 * a;
float a1 = l.a1 * a;