mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added better character auto stepping and component settings
This commit is contained in:
@@ -12,6 +12,7 @@ public:
|
||||
{
|
||||
if (!entity.HasComponent<Nuake::CharacterControllerComponent>())
|
||||
return;
|
||||
using namespace Nuake;
|
||||
|
||||
auto& component = entity.GetComponent<Nuake::CharacterControllerComponent>();
|
||||
BeginComponentTable(CHARACTER CONTROLLER, Nuake::CharacterControllerComponent);
|
||||
@@ -33,6 +34,59 @@ public:
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.MaxSlopeAngle, 0.45f)
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Auto stepping");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::Checkbox("##AutoStepping", &component.AutoStepping);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.AutoStepping, true)
|
||||
}
|
||||
|
||||
if (component.AutoStepping)
|
||||
{
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Stick to floor step down");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##StickToFloorStepDown", &component.StickToFloorStepDown.y, -10.0f, 0.01, 0.0f);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.StickToFloorStepDown.y, -0.5f);
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Step down extra");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##StepDownExtra", &component.StepDownExtra.y, -10.0f, 0.01, 0.0f);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.StepDownExtra.y, 0.0f);
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Step up");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##StepUp", &component.SteppingStepUp.y, 0.0f, 0.01, 10.0f);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.SteppingStepUp.y, 0.4f);
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Step distance");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##StepDistance", &component.SteppingForwardDistance, 0.0f, 0.01f, 10.0f);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.SteppingForwardDistance, 0.250f)
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
{
|
||||
ImGui::Text("Step min distance");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::DragFloat("##StepMinDistance", &component.SteppingMinDistance, 0.0f, 0.01f, component.SteppingForwardDistance);
|
||||
ImGui::TableNextColumn();
|
||||
ComponentTableReset(component.SteppingMinDistance, 0.125f)
|
||||
}
|
||||
}
|
||||
}
|
||||
EndComponentTable()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user