29 lines
747 B
C++
29 lines
747 B
C++
#ifndef EDITOR_RECTGIZMO_H
|
|
#define EDITOR_RECTGIZMO_H
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
class GameObject;
|
|
|
|
class RectGizmo final {
|
|
public:
|
|
[[nodiscard]] static bool CanManipulate(GameObject& object);
|
|
|
|
bool Manipulate(GameObject& object, const glm::vec2& drawImageSize, const glm::vec2& viewMin, const glm::vec2& viewSize);
|
|
|
|
[[nodiscard]] bool IsUsing() const { return m_ActiveHandle >= 0; }
|
|
[[nodiscard]] bool IsInteracting() const { return m_ActiveHandle >= 0 || m_Hovered; }
|
|
|
|
bool snap{false};
|
|
float snapStep{5.0f};
|
|
|
|
private:
|
|
int m_ActiveHandle{-1};
|
|
bool m_Hovered{false};
|
|
glm::vec2 m_DragStartMouse{0.0f};
|
|
glm::vec2 m_DragStartPosition{0.0f};
|
|
glm::vec2 m_DragStartSize{0.0f};
|
|
};
|
|
|
|
#endif // EDITOR_RECTGIZMO_H
|