improved projection class

This commit is contained in:
2024-09-30 11:54:47 -07:00
parent 4fb06d70fc
commit ac79326da8
3 changed files with 14 additions and 8 deletions

View File

@@ -121,6 +121,12 @@ namespace omath
At(i, j) *= f;
return *this;
}
template <size_t OtherColumns>
constexpr Mat<Rows, OtherColumns> operator*=(const Mat<Columns, OtherColumns>& other)
{
return *this = *this * other;
}
constexpr Mat operator*(float f) const
{

View File

@@ -6,7 +6,7 @@
#include <expected>
#include <omath/Vector3.h>
#include <omath/Matrix.h>
#include <omath/Mat.h>
#include <string_view>
#include "ErrorCodes.h"
@@ -28,7 +28,7 @@ namespace omath::projection
Camera(const Vector3& position, const Vector3& viewAngles, const ViewPort& viewPort, float fov, float near, float far);
void SetViewAngles(const Vector3& viewAngles);
[[nodiscard]] Matrix GetViewMatrix() const;
[[nodiscard]] Mat<4, 4> GetViewMatrix() const;
[[nodiscard]] std::expected<Vector2, Error> WorldToScreen(const Vector3& worldPosition) const;