mirror of
https://github.com/thunderbrewhq/typhoon.git
synced 2025-12-12 02:22:30 +00:00
feat(matrix): add C44Matrix::Translate
This commit is contained in:
parent
3dd32515fe
commit
b0a37c4e5e
2 changed files with 7 additions and 0 deletions
|
|
@ -93,6 +93,12 @@ void C44Matrix::Scale(float scale) {
|
||||||
this->c2 *= 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) {
|
C44Matrix operator*(const C44Matrix& l, float a) {
|
||||||
float a0 = l.a0 * a;
|
float a0 = l.a0 * a;
|
||||||
float a1 = l.a1 * a;
|
float a1 = l.a1 * a;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ class C44Matrix {
|
||||||
void RotateAroundZ(float angle);
|
void RotateAroundZ(float angle);
|
||||||
void Scale(const C3Vector& scale);
|
void Scale(const C3Vector& scale);
|
||||||
void Scale(float scale);
|
void Scale(float scale);
|
||||||
|
void Translate(const C3Vector& move);
|
||||||
};
|
};
|
||||||
|
|
||||||
C44Matrix operator*(const C44Matrix& l, float a);
|
C44Matrix operator*(const C44Matrix& l, float a);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue