From f11d5945a50d042a3583d4c6fc210b5d76510731 Mon Sep 17 00:00:00 2001 From: jgkim Date: Thu, 22 Jun 2023 06:44:09 +0000 Subject: [PATCH] =?UTF-8?q?CrowdAgent=20MaxAcceleration,=20MaxSpeed=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DotRecast.Recast.Demo/Tools/CrowdTool.cs | 4 ++-- src/DotRecast.Recast.Demo/UI/RcSettingsView.cs | 3 +++ src/DotRecast.Recast.DemoTool/SampleSettings.cs | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs index 7f6ac5d..b27e3af 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs @@ -214,8 +214,8 @@ public class CrowdTool : IRcTool DtCrowdAgentParams ap = new DtCrowdAgentParams(); ap.radius = _impl.GetSample().GetSettings().agentRadius; ap.height = _impl.GetSample().GetSettings().agentHeight; - ap.maxAcceleration = 8.0f; - ap.maxSpeed = 3.5f; + ap.maxAcceleration = _impl.GetSample().GetSettings().agentMaxAcceleration; + ap.maxSpeed = _impl.GetSample().GetSettings().agentMaxSpeed; ap.collisionQueryRange = ap.radius * 12.0f; ap.pathOptimizationRange = ap.radius * 30.0f; ap.updateFlags = GetUpdateFlags(); diff --git a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs index 83569a4..e27ebb5 100644 --- a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs @@ -127,6 +127,9 @@ public class RcSettingsView : IRcView ImGui.SliderFloat("Radius", ref settings.agentRadius, 0.1f, 5f, "%.1f"); ImGui.SliderFloat("Max Climb", ref settings.agentMaxClimb, 0.1f, 5f, "%.1f"); ImGui.SliderFloat("Max Slope", ref settings.agentMaxSlope, 1f, 90f, "%.0f"); + ImGui.SliderFloat("Max Acceleration", ref settings.agentMaxAcceleration, 8f, 999f, "%.1f"); + ImGui.SliderFloat("Max Speed", ref settings.agentMaxSpeed, 1f, 10f, "%.1f"); + ImGui.NewLine(); ImGui.Text("Region"); diff --git a/src/DotRecast.Recast.DemoTool/SampleSettings.cs b/src/DotRecast.Recast.DemoTool/SampleSettings.cs index 0f103f5..bda647a 100644 --- a/src/DotRecast.Recast.DemoTool/SampleSettings.cs +++ b/src/DotRecast.Recast.DemoTool/SampleSettings.cs @@ -10,6 +10,9 @@ public float agentMaxClimb = 0.9f; public float agentMaxSlope = 45f; + public float agentMaxAcceleration = 8.0f; + public float agentMaxSpeed = 3.5f; + public int minRegionSize = 8; public int mergedRegionSize = 20;