mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 15:33:26 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69b9049fb0 | |||
| 2734b58bdd | |||
| d7f1f49165 | |||
| 94b1453cae | |||
| 3e67d8a99c |
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/uml.iml" filepath="$PROJECT_DIR$/.idea/uml.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
2
.idea/uml.iml
generated
2
.idea/uml.iml
generated
@@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
|
||||||
7
.idea/vcs.xml
generated
7
.idea/vcs.xml
generated
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/extlibs/googletest" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
11
CREDITS.md
Normal file
11
CREDITS.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# OMATH CREDITS
|
||||||
|
|
||||||
|
Thanks to everyone who made this possible, including:
|
||||||
|
|
||||||
|
- Saikari aka luadebug for VCPKG port.
|
||||||
|
|
||||||
|
And a big hand to everyone else who has contributed over the past!
|
||||||
|
|
||||||
|
THANKS! <3
|
||||||
|
|
||||||
|
-- Orange++ <orange-cpp@yandex.ru>
|
||||||
@@ -294,7 +294,7 @@ namespace omath
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr std::array<Type, Rows * Columns>& RawArray()
|
constexpr std::array<Type, Rows * Columns>& RawArray()
|
||||||
{
|
{
|
||||||
return const_cast<std::array<Type, Rows * Columns>>(std::as_const(*this).RawArray());
|
return m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
|
|||||||
@@ -62,31 +62,37 @@ namespace omath::projection
|
|||||||
void SetFieldOfView(const FieldOfView& fov)
|
void SetFieldOfView(const FieldOfView& fov)
|
||||||
{
|
{
|
||||||
m_fieldOfView = fov;
|
m_fieldOfView = fov;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetNearPlane(const float near)
|
void SetNearPlane(const float near)
|
||||||
{
|
{
|
||||||
m_nearPlaneDistance = near;
|
m_nearPlaneDistance = near;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetFarPlane(const float far)
|
void SetFarPlane(const float far)
|
||||||
{
|
{
|
||||||
m_farPlaneDistance = far;
|
m_farPlaneDistance = far;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetViewAngles(const ViewAnglesType& viewAngles)
|
void SetViewAngles(const ViewAnglesType& viewAngles)
|
||||||
{
|
{
|
||||||
m_viewAngles = viewAngles;
|
m_viewAngles = viewAngles;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetOrigin(const Vector3<float>& origin)
|
void SetOrigin(const Vector3<float>& origin)
|
||||||
{
|
{
|
||||||
m_origin = origin;
|
m_origin = origin;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetViewPort(const ViewPort& viewPort)
|
void SetViewPort(const ViewPort& viewPort)
|
||||||
{
|
{
|
||||||
m_viewPort = viewPort;
|
m_viewPort = viewPort;
|
||||||
|
m_viewProjectionMatrix = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] const FieldOfView& GetFieldOfView() const
|
[[nodiscard]] const FieldOfView& GetFieldOfView() const
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace omath::opengl_engine
|
|||||||
}
|
}
|
||||||
Mat4x4 RotationMatrix(const ViewAngles& angles)
|
Mat4x4 RotationMatrix(const ViewAngles& angles)
|
||||||
{
|
{
|
||||||
return MatRotationAxisZ<float, MatStoreType::COLUMN_MAJOR>(angles.roll) *
|
return MatRotationAxisX<float, MatStoreType::COLUMN_MAJOR>(-angles.pitch) *
|
||||||
MatRotationAxisY<float, MatStoreType::COLUMN_MAJOR>(-angles.yaw) *
|
MatRotationAxisY<float, MatStoreType::COLUMN_MAJOR>(-angles.yaw) *
|
||||||
MatRotationAxisX<float, MatStoreType::COLUMN_MAJOR>(-angles.pitch);
|
MatRotationAxisZ<float, MatStoreType::COLUMN_MAJOR>(angles.roll);
|
||||||
}
|
}
|
||||||
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
const float far)
|
const float far)
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace omath::unity_engine
|
|||||||
}
|
}
|
||||||
Mat4x4 RotationMatrix(const ViewAngles& angles)
|
Mat4x4 RotationMatrix(const ViewAngles& angles)
|
||||||
{
|
{
|
||||||
return MatRotationAxisZ(angles.roll) *
|
return MatRotationAxisX<float, MatStoreType::ROW_MAJOR>(angles.pitch) *
|
||||||
MatRotationAxisY(angles.yaw) *
|
MatRotationAxisY<float, MatStoreType::ROW_MAJOR>(angles.yaw) *
|
||||||
MatRotationAxisX(angles.pitch);
|
MatRotationAxisZ<float, MatStoreType::ROW_MAJOR>(angles.roll);
|
||||||
}
|
}
|
||||||
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
const float far)
|
const float far)
|
||||||
|
|||||||
Reference in New Issue
Block a user