mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-09 16:54:35 +00:00
now template
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
namespace omath::source
|
||||
{
|
||||
[[nodiscard]]
|
||||
inline Vector3 ForwardVector(const ViewAngles& angles)
|
||||
inline Vector3<float> ForwardVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsForward);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace omath::source
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline Vector3 RightVector(const ViewAngles& angles)
|
||||
inline Vector3<float> RightVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsRight);
|
||||
|
||||
@@ -23,14 +23,14 @@ namespace omath::source
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
inline Vector3 UpVector(const ViewAngles& angles)
|
||||
inline Vector3<float> UpVector(const ViewAngles& angles)
|
||||
{
|
||||
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsUp);
|
||||
|
||||
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3& cam_origin)
|
||||
[[nodiscard]] inline Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin)
|
||||
{
|
||||
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user