remove Tuple.Create

This commit is contained in:
ikpil 2023-06-30 21:56:30 +09:00
parent 601526e053
commit 9d29d1f6c0
2 changed files with 6 additions and 8 deletions

View File

@ -1178,10 +1178,8 @@ namespace DotRecast.Detour.Crowd
}
else
{
var nsnvel = _obstacleQuery.SampleVelocityGrid(ag.npos, ag.option.radius,
ag.desiredSpeed, ag.vel, ag.dvel, option, vod);
ns = nsnvel.Item1;
ag.nvel = nsnvel.Item2;
ns = _obstacleQuery.SampleVelocityGrid(ag.npos, ag.option.radius,
ag.desiredSpeed, ag.vel, ag.dvel, out ag.nvel, option, vod);
}
_velocitySampleCount += ns;

View File

@ -319,7 +319,7 @@ namespace DotRecast.Detour.Crowd
return penalty;
}
public Tuple<int, RcVec3f> SampleVelocityGrid(RcVec3f pos, float rad, float vmax, RcVec3f vel, RcVec3f dvel,
public int SampleVelocityGrid(RcVec3f pos, float rad, float vmax, RcVec3f vel, RcVec3f dvel, out RcVec3f nvel,
DtObstacleAvoidanceParams option, DtObstacleAvoidanceDebugData debug)
{
Prepare(pos, dvel);
@ -328,7 +328,7 @@ namespace DotRecast.Detour.Crowd
m_vmax = vmax;
m_invVmax = vmax > 0 ? 1.0f / vmax : float.MaxValue;
RcVec3f nvel = RcVec3f.Zero;
nvel = RcVec3f.Zero;
if (debug != null)
debug.Reset();
@ -359,7 +359,7 @@ namespace DotRecast.Detour.Crowd
}
}
return Tuple.Create(ns, nvel);
return ns;
}
// vector normalization that ignores the y-component.