Add Editor Features - Transform Gizmo #105

Merged
srishamharan merged 14 commits from SP3-4-editor_fix into main 2022-10-21 20:58:48 +08:00
2 changed files with 37 additions and 0 deletions
Showing only changes of commit 3a3f7efb29 - Show all commits

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};
};
}