mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 07:23:26 +00:00
fixed projection matrix
This commit is contained in:
@@ -25,18 +25,20 @@ namespace omath::projection
|
||||
class Camera
|
||||
{
|
||||
public:
|
||||
Camera(const Vector3& position, const Vector3& viewAngles, const ViewPort& viewPort, float fov, float near, float far);
|
||||
Camera(const Vector3& position, const Vector3& viewAngles, const ViewPort& viewPort,
|
||||
float fov, float near, float far, float lensZoom);
|
||||
void SetViewAngles(const Vector3& viewAngles);
|
||||
|
||||
[[nodiscard]] Mat<4, 4> GetViewMatrix() const;
|
||||
|
||||
[[nodiscard]] std::expected<Vector2, Error> WorldToScreen(const Vector3& worldPosition) const;
|
||||
[[nodiscard]] std::expected<Vector2, Error> WorldToScreen(Vector3 worldPosition) const;
|
||||
|
||||
ViewPort m_viewPort{};
|
||||
float m_fieldOfView;
|
||||
|
||||
float m_farPlaneDistance;
|
||||
float m_nearPlaneDistance;
|
||||
float m_lensZoom;
|
||||
|
||||
private:
|
||||
Vector3 m_viewAngles;
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace omath::projection
|
||||
{
|
||||
enum class Error : uint16_t
|
||||
{
|
||||
WORLD_POSITION_IS_BEHIND_CAMERA = 0,
|
||||
WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user