From ba89398253bc30f0a8fd1ac0de59c54ac59cae42 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 31 May 2023 00:46:12 +0900 Subject: [PATCH] remove Tuple --- src/DotRecast.Detour.Crowd/Crowd.cs | 6 ++---- src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs | 9 +++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/DotRecast.Detour.Crowd/Crowd.cs b/src/DotRecast.Detour.Crowd/Crowd.cs index 88a2a11..a93afd4 100644 --- a/src/DotRecast.Detour.Crowd/Crowd.cs +++ b/src/DotRecast.Detour.Crowd/Crowd.cs @@ -1183,10 +1183,8 @@ namespace DotRecast.Detour.Crowd if (adaptive) { - var nsnvel = _obstacleQuery.SampleVelocityAdaptive(ag.npos, ag.option.radius, - ag.desiredSpeed, ag.vel, ag.dvel, option, vod); - ns = nsnvel.Item1; - ag.nvel = nsnvel.Item2; + ns = _obstacleQuery.SampleVelocityAdaptive(ag.npos, ag.option.radius, ag.desiredSpeed, + ag.vel, ag.dvel, out ag.nvel, option, vod); } else { diff --git a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs index bb2c28d..d22b824 100644 --- a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs +++ b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs @@ -383,8 +383,9 @@ namespace DotRecast.Detour.Crowd static readonly float DT_PI = 3.14159265f; - public Tuple SampleVelocityAdaptive(Vector3f pos, float rad, float vmax, Vector3f vel, - Vector3f dvel, ObstacleAvoidanceParams option, ObstacleAvoidanceDebugData debug) + public int SampleVelocityAdaptive(Vector3f pos, float rad, float vmax, Vector3f vel, Vector3f dvel, out Vector3f nvel, + ObstacleAvoidanceParams option, + ObstacleAvoidanceDebugData debug) { Prepare(pos, dvel); m_params = option; @@ -392,7 +393,7 @@ namespace DotRecast.Detour.Crowd m_vmax = vmax; m_invVmax = vmax > 0 ? 1.0f / vmax : float.MaxValue; - Vector3f nvel = Vector3f.Zero; + nvel = Vector3f.Zero; if (debug != null) debug.Reset(); @@ -490,7 +491,7 @@ namespace DotRecast.Detour.Crowd nvel = res; - return Tuple.Create(ns, nvel); + return ns; } } } \ No newline at end of file