Mouse picking system for rendering side is in #87

Merged
Xenosas1337 merged 7 commits from SP3-1-Rendering into main 2022-10-14 12:19:56 +08:00
2 changed files with 21 additions and 7 deletions
Showing only changes of commit b153ccd1e3 - Show all commits

View File

@ -18,6 +18,8 @@
#include "ECS_Base/Managers/SHSystemManager.h"
#include "AudioSystem/SHAudioSystem.h"
#include "Physics/Components/SHRigidBodyComponent.h"
#include "Physics/Components/SHColliderComponent.h"
namespace SHADE
{
@ -70,23 +72,28 @@ namespace SHADE
{
DrawComponent(renderableComponent);
}
if(auto testComponent = SHComponentManager::GetComponent_s<SHComponent_ENUM>(eid))
if(auto colliderComponent = SHComponentManager::GetComponent_s<SHColliderComponent>(eid))
{
DrawComponent(testComponent);
DrawComponent(colliderComponent);
}
if(auto rigidbodyComponent = SHComponentManager::GetComponent_s<SHRigidBodyComponent>(eid))
{
DrawComponent(rigidbodyComponent);
}
ImGui::Separator();
// Render Scripts
SHScriptEngine* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
scriptEngine->RenderScriptsInInspector(eid);
ImGui::Separator();
if(ImGui::BeginMenu(std::format("{} Add Component", ICON_MD_LIBRARY_ADD).data()))
{
DrawAddComponentButton<SHTransformComponent>(eid);
DrawAddComponentButton<SHRenderable>(eid);
DrawAddComponentButton<SHComponent_ENUM>(eid);
DrawAddComponentButton<SHColliderComponent>(eid);
DrawAddComponentButton<SHRigidBodyComponent>(eid);
ImGui::EndMenu();
}
// Render Scripts
SHScriptEngine* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
scriptEngine->RenderScriptsInInspector(eid);
}
ImGui::End();
}

View File

@ -390,6 +390,13 @@ RTTR_REGISTRATION
using namespace SHADE;
using namespace rttr;
registration::enumeration<SHRigidBodyComponent::Type>("RigidBody Type")
(
value("Static", SHRigidBodyComponent::Type::STATIC),
value("Dynamic", SHRigidBodyComponent::Type::DYNAMIC),
value("Kinematic", SHRigidBodyComponent::Type::KINEMATIC)
);
registration::class_<SHRigidBodyComponent>("RigidBody Component")
.property("Type" , &SHRigidBodyComponent::GetType , &SHRigidBodyComponent::SetType )
.property("Mass" , &SHRigidBodyComponent::GetMass , &SHRigidBodyComponent::SetMass )