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>
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
class ImVec2;
|
||||
#include <imgui.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -159,17 +159,6 @@ namespace omath
|
||||
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
|
||||
{
|
||||
return {-x, -y};
|
||||
@@ -210,15 +199,9 @@ namespace omath
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
[[nodiscard]]
|
||||
const ImVec2& ToImVec2() const
|
||||
ImVec2 ToImVec2() const
|
||||
{
|
||||
return *reinterpret_cast<const ImVec2*>(this);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
ImVec2& ToImVec2()
|
||||
{
|
||||
return *reinterpret_cast<ImVec2*>(this);
|
||||
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#include <omath/Vector3.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
class ImVec4;
|
||||
#endif
|
||||
|
||||
namespace omath
|
||||
{
|
||||
@@ -161,15 +158,15 @@ namespace omath
|
||||
|
||||
#ifdef OMATH_IMGUI_INTEGRATION
|
||||
[[nodiscard]]
|
||||
constexpr ImVec4& ToImVec4() const
|
||||
ImVec4 ToImVec4() const
|
||||
{
|
||||
return *reinterpret_cast<const ImVec4*>(this);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr ImVec2& ToImVec2()
|
||||
{
|
||||
return *reinterpret_cast<ImVec4*>(this);
|
||||
return
|
||||
{
|
||||
static_cast<float>(this->x),
|
||||
static_cast<float>(this->y),
|
||||
static_cast<float>(this->z),
|
||||
static_cast<float>(w),
|
||||
};
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user