implement heightmap overlay for navigation
This commit is contained in:
@@ -14,6 +14,23 @@
|
||||
#define NANORT_ENABLE_PARALLEL_BUILD
|
||||
#include "nanort.h"
|
||||
|
||||
class NodeHeightmapOverlay : public NodeBorder
|
||||
{
|
||||
NodeBorder* m_picker{ nullptr };
|
||||
bool dragging = false;
|
||||
public:
|
||||
glm::vec2 m_value{ 0.5f, 0.5f };
|
||||
glm::vec2 m_old_value{ 0.f };
|
||||
std::function<void(Node* target, glm::vec2 value)> on_value_changed;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void clone_finalize(Node* dest) const override;
|
||||
virtual void init() override;
|
||||
void set_value(float x, float y);
|
||||
virtual kEventResult handle_event(Event* e) override;
|
||||
virtual void draw() override;
|
||||
virtual void handle_resize(glm::vec2 old_size, glm::vec2 new_size) override;
|
||||
};
|
||||
|
||||
class NodePanelGrid : public Node
|
||||
{
|
||||
public:
|
||||
@@ -35,6 +52,7 @@ public:
|
||||
NodeButton* m_render;
|
||||
NodeButton* m_commit;
|
||||
HeightmapPlane m_hm_plane;
|
||||
NodeHeightmapOverlay* m_hm_preview_nav;
|
||||
Sphere m_sphere;
|
||||
Image m_hm_image;
|
||||
Texture2D m_texture;
|
||||
|
||||
Reference in New Issue
Block a user