Implement Mat4x4::LookAt
This commit is contained in:
@@ -419,4 +419,13 @@ namespace LinearAlgebra {
|
||||
Vector3 Matrix4x4::GetTranslatePart() const {
|
||||
return GetColumn3(3);
|
||||
}
|
||||
|
||||
Matrix4x4
|
||||
Matrix4x4::LookAt(const Vector3 &localFwd, const Vector3 &targetDir, const Vector3 &localUp, const Vector3 &worldUp) {
|
||||
Matrix4x4 m;
|
||||
m.Set3x3Part(Matrix3x3::LookAt(localFwd, targetDir, localUp, worldUp));
|
||||
m.SetTranslatePart(0,0,0);
|
||||
m.SetRow(3, 0,0,0,1);
|
||||
return m;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user