Implement Matrix4x4::Scale
This commit is contained in:
@@ -128,6 +128,7 @@ namespace J3ML::LinearAlgebra {
|
||||
{
|
||||
|
||||
}
|
||||
Matrix4x4 Scale(const Vector3&);
|
||||
|
||||
float &At(int row, int col);
|
||||
float At(int x, int y) const;
|
||||
|
@@ -420,6 +420,16 @@ namespace J3ML::LinearAlgebra {
|
||||
return GetColumn3(3);
|
||||
}
|
||||
|
||||
Matrix4x4 Matrix4x4::Scale(const Vector3& scale)
|
||||
{
|
||||
auto mat = *this;
|
||||
|
||||
mat.At(3, 0) *= scale.x;
|
||||
mat.At(3, 1) *= scale.y;
|
||||
mat.At(3, 2) *= scale.z;
|
||||
return mat;
|
||||
}
|
||||
|
||||
Matrix4x4
|
||||
Matrix4x4::LookAt(const Vector3 &localFwd, const Vector3 &targetDir, const Vector3 &localUp, const Vector3 &worldUp) {
|
||||
Matrix4x4 m;
|
||||
|
Reference in New Issue
Block a user