[WIP] Transform Gizmo

This commit is contained in:
Sri Sham Haran 2022-10-19 01:31:48 +08:00
parent ec6772657f
commit 3a3f7efb29
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include "SHpch.h"
#include "SHTransformGizmo.h"
#include "ECS_Base/Managers/SHComponentManager.h"
#include "ECS_Base/Managers/SHSystemManager.h"
#include "Editor/SHEditor.hpp"
namespace SHADE
{
void SHTransformGizmo::Draw()
{
if(selectedEntityTranformComponent == nullptr)
{
SHEditor* editor = SHSystemManager::GetSystem<SHEditor>();
if(editor->selectedEntities.empty())
return;
EntityID eid = editor->selectedEntities.back();
selectedEntityTranformComponent = SHComponentManager::GetComponent_s<SHTransformComponent>(eid);
}
}
}

View File

@ -0,0 +1,13 @@
#pragma once
#include "Math/Transform/SHTransformComponent.h"
namespace SHADE
{
class SHTransformGizmo
{
public:
void Draw();
private:
SHTransformComponent* selectedEntityTranformComponent{nullptr};
};
}