Skip to content

Commit bef346a

Browse files
committed
SOH
#41
1 parent 9e9a3f0 commit bef346a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/DotRecast.Detour/DtNavMeshQuery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ public DtStatus Raycast(long startRef, RcVec3f startPos, RcVec3f endPos,
22452245
hit.path.Clear();
22462246
hit.pathCost = 0;
22472247

2248-
RcVec3f[] verts = new RcVec3f[m_nav.GetMaxVertsPerPoly() + 1];
2248+
Span<RcVec3f> verts = stackalloc RcVec3f[m_nav.GetMaxVertsPerPoly() + 1];
22492249

22502250
RcVec3f curPos = RcVec3f.Zero;
22512251
RcVec3f lastPos = RcVec3f.Zero;

src/DotRecast.Detour/DtUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public static float DistancePtSegSqr2D(RcVec3f pt, RcVec3f p, RcVec3f q, out flo
342342
}
343343

344344
public static bool IntersectSegmentPoly2D(RcVec3f p0, RcVec3f p1,
345-
RcVec3f[] verts, int nverts,
345+
Span<RcVec3f> verts, int nverts,
346346
out float tmin, out float tmax,
347347
out int segMin, out int segMax)
348348
{

src/DotRecast.Recast/RcFilledVolumeRasterization.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ private static float[] IntersectCylinder(float[] rectangle, RcVec3f start, RcVec
296296

297297
if (axis.Y * axis.Y > EPSILON)
298298
{
299-
RcVec3f[] rectangleOnStartPlane = new RcVec3f[4];
300-
RcVec3f[] rectangleOnEndPlane = new RcVec3f[4];
299+
Span<RcVec3f> rectangleOnStartPlane = stackalloc RcVec3f[4];
300+
Span<RcVec3f> rectangleOnEndPlane = stackalloc RcVec3f[4];
301301
float ds = RcVec3f.Dot(axis, start);
302302
float de = RcVec3f.Dot(axis, end);
303303
for (int i = 0; i < 4; i++)
@@ -326,7 +326,7 @@ private static float[] IntersectCylinder(float[] rectangle, RcVec3f start, RcVec
326326
return s;
327327
}
328328

329-
private static float[] CylinderCapIntersection(RcVec3f start, float radiusSqr, float[] s, int i, RcVec3f[] rectangleOnPlane)
329+
private static float[] CylinderCapIntersection(RcVec3f start, float radiusSqr, float[] s, int i, Span<RcVec3f> rectangleOnPlane)
330330
{
331331
int j = (i + 1) % 4;
332332
// Ray against sphere intersection

0 commit comments

Comments
 (0)