mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added sphere collider
This commit is contained in:
38
Editor/src/ComponentsPanel/SphereColliderPanel.h
Normal file
38
Editor/src/ComponentsPanel/SphereColliderPanel.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "ComponentPanel.h"
|
||||
#include <src/Scene/Components/SphereCollider.h>
|
||||
#include <src/Core/FileSystem.h>
|
||||
#include <src/Scene/Entities/ImGuiHelper.h>
|
||||
|
||||
class SphereColliderPanel : ComponentPanel {
|
||||
public:
|
||||
SphereColliderPanel() {}
|
||||
|
||||
void Draw(Nuake::Entity entity) override
|
||||
{
|
||||
if (!entity.HasComponent<Nuake::SphereColliderComponent>())
|
||||
return;
|
||||
|
||||
auto& component = entity.GetComponent<Nuake::SphereColliderComponent>();
|
||||
BeginComponentTable(SPHERE COLLIDER, Nuake::SphereColliderComponent);
|
||||
{
|
||||
{
|
||||
ImGui::Text("Size");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##Radius", &component.Radius);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.Radius, 0.5f);
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Is Trigger");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::Checkbox("##isTrigger", &component.IsTrigger);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.IsTrigger, false);
|
||||
}
|
||||
}
|
||||
EndComponentTable();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user