mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 23:13:26 +00:00
added camera
This commit is contained in:
@@ -51,6 +51,8 @@ namespace omath
|
||||
|
||||
Matrix operator*(const Matrix &other) const;
|
||||
|
||||
Matrix& operator*=(const Matrix &other);
|
||||
|
||||
Matrix operator*(float f) const;
|
||||
|
||||
Matrix operator*(const Vector3 &vec3) const;
|
||||
|
||||
38
include/omath/projection/Camera.h
Normal file
38
include/omath/projection/Camera.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Created by Vlad on 27.08.2024.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <expected>
|
||||
#include <omath/Vector3.h>
|
||||
#include <omath/Matrix.h>
|
||||
#include <string_view>
|
||||
|
||||
|
||||
namespace omath::projection
|
||||
{
|
||||
class Camera
|
||||
{
|
||||
public:
|
||||
void SetViewAngles(const Vector3& viewAngles);
|
||||
[[nodiscard]] const Vector3& GetViewAngles() const;
|
||||
|
||||
[[nodiscard]] Matrix GetViewMatrix() const;
|
||||
[[nodiscard]] Matrix GetProjectionMatrix() const;
|
||||
[[nodiscard]] Matrix GetTranslationMatrix() const;
|
||||
[[nodiscard]] Matrix GetOrientationMatrix() const;
|
||||
|
||||
[[nodiscard]] std::expected<Vector3, std::string_view> WorldToScreen(const Vector3& worldPosition) const;
|
||||
|
||||
Vector3 m_viewPort;
|
||||
float m_fieldOfView;
|
||||
|
||||
float m_farPlaneDistance;
|
||||
float m_nearPlaneDistance;
|
||||
|
||||
private:
|
||||
Vector3 m_viewAngles;
|
||||
Vector3 m_origin;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user