move const float s

This commit is contained in:
ikpil 2023-06-20 23:23:13 +09:00
parent d38cddfbc6
commit 120c946a34
1 changed files with 2 additions and 2 deletions

View File

@ -1255,7 +1255,6 @@ namespace DotRecast.Detour
} }
// update move cost // update move cost
if (!foundShortCut) if (!foundShortCut)
{ {
@ -2129,7 +2128,6 @@ namespace DotRecast.Detour
return DtStatus.DT_SUCCSESS; return DtStatus.DT_SUCCSESS;
} }
private const float s = 1.0f / 255.0f;
/// @par /// @par
/// ///
@ -2317,6 +2315,7 @@ namespace DotRecast.Detour
if (link.side == 0 || link.side == 4) if (link.side == 0 || link.side == 4)
{ {
// Calculate link size. // Calculate link size.
const float s = 1.0f / 255.0f;
float lmin = tile.data.verts[left + 2] float lmin = tile.data.verts[left + 2]
+ (tile.data.verts[right + 2] - tile.data.verts[left + 2]) * (link.bmin * s); + (tile.data.verts[right + 2] - tile.data.verts[left + 2]) * (link.bmin * s);
float lmax = tile.data.verts[left + 2] float lmax = tile.data.verts[left + 2]
@ -2337,6 +2336,7 @@ namespace DotRecast.Detour
else if (link.side == 2 || link.side == 6) else if (link.side == 2 || link.side == 6)
{ {
// Calculate link size. // Calculate link size.
const float s = 1.0f / 255.0f;
float lmin = tile.data.verts[left] float lmin = tile.data.verts[left]
+ (tile.data.verts[right] - tile.data.verts[left]) * (link.bmin * s); + (tile.data.verts[right] - tile.data.verts[left]) * (link.bmin * s);
float lmax = tile.data.verts[left] float lmax = tile.data.verts[left]