mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
fix
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
class ImVec2;
|
#include <imgui.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -159,17 +159,6 @@ namespace omath
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class type>
|
|
||||||
[[nodiscard]] constexpr const type& As() const
|
|
||||||
{
|
|
||||||
return *reinterpret_cast<const type*>(this);
|
|
||||||
}
|
|
||||||
template<class type>
|
|
||||||
[[nodiscard]] constexpr type& As()
|
|
||||||
{
|
|
||||||
return *reinterpret_cast<type*>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] constexpr Vector2 operator-() const
|
[[nodiscard]] constexpr Vector2 operator-() const
|
||||||
{
|
{
|
||||||
return {-x, -y};
|
return {-x, -y};
|
||||||
@@ -210,15 +199,9 @@ namespace omath
|
|||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
const ImVec2& ToImVec2() const
|
ImVec2 ToImVec2() const
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<const ImVec2*>(this);
|
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
ImVec2& ToImVec2()
|
|
||||||
{
|
|
||||||
return *reinterpret_cast<ImVec2*>(this);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,9 +6,6 @@
|
|||||||
#include <omath/Vector3.hpp>
|
#include <omath/Vector3.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
|
||||||
class ImVec4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -161,15 +158,15 @@ namespace omath
|
|||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr ImVec4& ToImVec4() const
|
ImVec4 ToImVec4() const
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<const ImVec4*>(this);
|
return
|
||||||
}
|
{
|
||||||
|
static_cast<float>(this->x),
|
||||||
[[nodiscard]]
|
static_cast<float>(this->y),
|
||||||
constexpr ImVec2& ToImVec2()
|
static_cast<float>(this->z),
|
||||||
{
|
static_cast<float>(w),
|
||||||
return *reinterpret_cast<ImVec4*>(this);
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user