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;