diff --git a/src/DotRecast.Core/RecastMath.cs b/src/DotRecast.Core/RecastMath.cs index 6079494..a7d719f 100644 --- a/src/DotRecast.Core/RecastMath.cs +++ b/src/DotRecast.Core/RecastMath.cs @@ -222,13 +222,6 @@ namespace DotRecast.Core @out.z = @in[2]; } - public static void vCopy(ref Vector3f @out, Vector3f @in) - { - @out.x = @in[0]; - @out.y = @in[1]; - @out.z = @in[2]; - } - public static void vCopy(ref Vector3f @out, float[] @in, int i) { @out.x = @in[i]; diff --git a/src/DotRecast.Detour.Crowd/Crowd.cs b/src/DotRecast.Detour.Crowd/Crowd.cs index 59af4ce..3bf7349 100644 --- a/src/DotRecast.Detour.Crowd/Crowd.cs +++ b/src/DotRecast.Detour.Crowd/Crowd.cs @@ -257,7 +257,7 @@ namespace DotRecast.Detour.Crowd ag.dvel = Vector3f.Zero; ag.nvel = Vector3f.Zero; ag.vel = Vector3f.Zero; - vCopy(ref ag.npos, nearest); + ag.npos = nearest; ag.desiredSpeed = 0; @@ -325,7 +325,7 @@ namespace DotRecast.Detour.Crowd { // Initialize request. agent.targetRef = 0; - vCopy(ref agent.targetPos, vel); + agent.targetPos = vel; agent.targetPathQueryResult = null; agent.targetReplan = false; agent.targetState = CrowdAgent.MoveRequestState.DT_CROWDAGENT_TARGET_VELOCITY; @@ -455,7 +455,7 @@ namespace DotRecast.Detour.Crowd // First check that the current location is valid. Vector3f agentPos = new Vector3f(); long agentRef = ag.corridor.getFirstPoly(); - vCopy(ref agentPos, ag.npos); + agentPos = ag.npos; if (!navQuery.isValidPolyRef(agentRef, m_filters[ag.option.queryFilterType])) { // Current location is not valid, try to reposition. @@ -465,7 +465,7 @@ namespace DotRecast.Detour.Crowd agentRef = nearestPoly.succeeded() ? nearestPoly.result.getNearestRef() : 0L; if (nearestPoly.succeeded()) { - vCopy(ref agentPos, nearestPoly.result.getNearestPos()); + agentPos = nearestPoly.result.getNearestPos(); } if (agentRef == 0) @@ -485,7 +485,7 @@ namespace DotRecast.Detour.Crowd // ag.corridor.trimInvalidPath(agentRef, agentPos, m_navquery, // &m_filter); ag.boundary.reset(); - vCopy(ref ag.npos, agentPos); + ag.npos = agentPos; replan = true; } @@ -510,7 +510,7 @@ namespace DotRecast.Detour.Crowd ag.targetRef = fnp.succeeded() ? fnp.result.getNearestRef() : 0L; if (fnp.succeeded()) { - vCopy(ref ag.targetPos, fnp.result.getNearestPos()); + ag.targetPos = fnp.result.getNearestPos(); } replan = true; @@ -626,14 +626,14 @@ namespace DotRecast.Detour.Crowd } else { - vCopy(ref reqPos, ag.targetPos); + reqPos = ag.targetPos; } } else { // Could not find path, start the request from current // location. - vCopy(ref reqPos, ag.npos); + reqPos = ag.npos; reqPath = new List(); reqPath.Add(path[0]); } @@ -965,8 +965,8 @@ namespace DotRecast.Detour.Crowd // Copy data for debug purposes. if (debugAgent == ag) { - vCopy(ref debug.optStart, ag.corridor.getPos()); - vCopy(ref debug.optEnd, target); + debug.optStart = ag.corridor.getPos(); + debug.optEnd = target; } } else @@ -1011,7 +1011,7 @@ namespace DotRecast.Detour.Crowd if (ag.corridor.moveOverOffmeshConnection(ag.corners[ag.corners.Count - 1].getRef(), refs, ref anim.startPos, ref anim.endPos, navQuery)) { - vCopy(ref anim.initPos, ag.npos); + anim.initPos = ag.npos; anim.polyRef = refs[1]; anim.active = true; anim.t = 0.0f; @@ -1051,7 +1051,7 @@ namespace DotRecast.Detour.Crowd if (ag.targetState == CrowdAgent.MoveRequestState.DT_CROWDAGENT_TARGET_VELOCITY) { - vCopy(ref dvel, ag.targetPos); + dvel = ag.targetPos; ag.desiredSpeed = vLen(ag.targetPos); } else @@ -1124,7 +1124,7 @@ namespace DotRecast.Detour.Crowd } // Set the desired velocity. - vCopy(ref ag.dvel, dvel); + ag.dvel = dvel; } _telemetry.stop("calculateSteering"); @@ -1198,7 +1198,7 @@ namespace DotRecast.Detour.Crowd else { // If not using velocity planning, new velocity is directly the desired velocity. - vCopy(ref ag.nvel, ag.dvel); + ag.nvel = ag.dvel; } } @@ -1311,7 +1311,7 @@ namespace DotRecast.Detour.Crowd // Move along navmesh. ag.corridor.movePosition(ag.npos, navQuery, m_filters[ag.option.queryFilterType]); // Get valid constrained position back. - vCopy(ref ag.npos, ag.corridor.getPos()); + ag.npos = ag.corridor.getPos(); // If not using path, truncate the corridor to just one poly. if (ag.targetState == CrowdAgent.MoveRequestState.DT_CROWDAGENT_TARGET_NONE diff --git a/src/DotRecast.Detour.Crowd/CrowdAgent.cs b/src/DotRecast.Detour.Crowd/CrowdAgent.cs index 7f3326d..ca06bbb 100644 --- a/src/DotRecast.Detour.Crowd/CrowdAgent.cs +++ b/src/DotRecast.Detour.Crowd/CrowdAgent.cs @@ -229,7 +229,7 @@ namespace DotRecast.Detour.Crowd public void setTarget(long refs, Vector3f pos) { targetRef = refs; - vCopy(ref targetPos, pos); + targetPos = pos; targetPathQueryResult = null; if (targetRef != 0) { diff --git a/src/DotRecast.Detour.Crowd/LocalBoundary.cs b/src/DotRecast.Detour.Crowd/LocalBoundary.cs index 7ec847b..d58e37a 100644 --- a/src/DotRecast.Detour.Crowd/LocalBoundary.cs +++ b/src/DotRecast.Detour.Crowd/LocalBoundary.cs @@ -109,7 +109,7 @@ namespace DotRecast.Detour.Crowd return; } - vCopy(ref m_center, pos); + m_center = pos; // First query non-overlapping polygons. Result res = navquery.findLocalNeighbourhood(refs, pos, collisionQueryRange, filter); diff --git a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs index 937916e..4487a89 100644 --- a/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs +++ b/src/DotRecast.Detour.Crowd/ObstacleAvoidanceQuery.cs @@ -159,10 +159,10 @@ namespace DotRecast.Detour.Crowd return; ObstacleCircle cir = m_circles[m_ncircles++]; - vCopy(ref cir.p, pos); + cir.p = pos; cir.rad = rad; - vCopy(ref cir.vel, vel); - vCopy(ref cir.dvel, dvel); + cir.vel = vel; + cir.dvel = dvel; } public void addSegment(Vector3f p, Vector3f q) @@ -171,8 +171,8 @@ namespace DotRecast.Detour.Crowd return; ObstacleSegment seg = m_segments[m_nsegments++]; - vCopy(ref seg.p, p); - vCopy(ref seg.q, q); + seg.p = p; + seg.q = q; } public int getObstacleCircleCount() @@ -208,7 +208,7 @@ namespace DotRecast.Detour.Crowd Vector3f orig = new Vector3f(); Vector3f dv = new Vector3f(); - vCopy(ref cir.dp, vSub(pb, pa)); + cir.dp = vSub(pb, pa); vNormalize(ref cir.dp); dv = vSub(cir.dvel, dvel); @@ -429,7 +429,7 @@ namespace DotRecast.Detour.Crowd if (penalty < minPenalty) { minPenalty = penalty; - vCopy(ref nvel, vcand); + nvel = vcand; } } } @@ -558,16 +558,16 @@ namespace DotRecast.Detour.Crowd if (penalty < minPenalty) { minPenalty = penalty; - vCopy(ref bvel, vcand); + bvel = vcand; } } - vCopy(ref res, bvel); + res = bvel; cr *= 0.5f; } - vCopy(ref nvel, res); + nvel = res; return Tuple.Create(ns, nvel); } diff --git a/src/DotRecast.Detour.Crowd/PathCorridor.cs b/src/DotRecast.Detour.Crowd/PathCorridor.cs index a8259f0..14876d3 100644 --- a/src/DotRecast.Detour.Crowd/PathCorridor.cs +++ b/src/DotRecast.Detour.Crowd/PathCorridor.cs @@ -210,8 +210,8 @@ namespace DotRecast.Detour.Crowd { m_path.Clear(); m_path.Add(refs); - vCopy(ref m_pos, pos); - vCopy(ref m_target, pos); + m_pos = pos; + m_target = pos; } private static readonly float MIN_TARGET_DIST = sqr(0.01f); @@ -390,9 +390,9 @@ namespace DotRecast.Detour.Crowd var startEnd = nav.getOffMeshConnectionPolyEndPoints(refs[0], refs[1]); if (startEnd.succeeded()) { - vCopy(ref m_pos, startEnd.result.Item2); - vCopy(ref start, startEnd.result.Item1); - vCopy(ref end, startEnd.result.Item2); + m_pos = startEnd.result.Item2; + start = startEnd.result.Item1; + end = startEnd.result.Item2; return true; } @@ -430,7 +430,7 @@ namespace DotRecast.Detour.Crowd { m_path = mergeCorridorStartMoved(m_path, masResult.result.getVisited()); // Adjust the position to stay on top of the navmesh. - vCopy(ref m_pos, masResult.result.getResultPos()); + m_pos = masResult.result.getResultPos(); Result hr = navquery.getPolyHeight(m_path[0], masResult.result.getResultPos()); if (hr.succeeded()) { @@ -473,7 +473,7 @@ namespace DotRecast.Detour.Crowd * float h = m_target[1]; navquery->getPolyHeight(m_path[m_npath-1], * result, &h); result[1] = h; */ - vCopy(ref m_target, masResult.result.getResultPos()); + m_target = masResult.result.getResultPos(); return true; } @@ -492,13 +492,13 @@ namespace DotRecast.Detour.Crowd */ public void setCorridor(Vector3f target, List path) { - vCopy(ref m_target, target); + m_target = target; m_path = new List(path); } public void fixPathStart(long safeRef, Vector3f safePos) { - vCopy(ref m_pos, safePos); + m_pos = safePos; if (m_path.Count < 3 && m_path.Count > 0) { long p = m_path[m_path.Count - 1]; @@ -541,7 +541,7 @@ namespace DotRecast.Detour.Crowd var result = navquery.closestPointOnPolyBoundary(m_path[m_path.Count - 1], m_target); if (result.succeeded()) { - vCopy(ref m_target, result.result); + m_target = result.result; } } diff --git a/src/DotRecast.Detour.Crowd/PathQueue.cs b/src/DotRecast.Detour.Crowd/PathQueue.cs index 2b6f44d..381b4b3 100644 --- a/src/DotRecast.Detour.Crowd/PathQueue.cs +++ b/src/DotRecast.Detour.Crowd/PathQueue.cs @@ -85,9 +85,9 @@ namespace DotRecast.Detour.Crowd } PathQuery q = new PathQuery(); - vCopy(ref q.startPos, startPos); + q.startPos = startPos; q.startRef = startRef; - vCopy(ref q.endPos, endPos); + q.endPos = endPos; q.endRef = endRef; q.result.status = null; q.filter = filter; diff --git a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs index dcce58a..4ec0875 100644 --- a/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs +++ b/src/DotRecast.Detour.Extras/Jumplink/EdgeSampler.cs @@ -17,7 +17,7 @@ namespace DotRecast.Detour.Extras.Jumplink public EdgeSampler(Edge edge, Trajectory trajectory) { this.trajectory = trajectory; - vCopy(ref ax, vSub(edge.sq, edge.sp)); + ax = vSub(edge.sq, edge.sp); vNormalize(ref ax); vSet(ref az, ax[2], 0, -ax[0]); vNormalize(ref az); diff --git a/src/DotRecast.Detour.TileCache/TileCache.cs b/src/DotRecast.Detour.TileCache/TileCache.cs index 3a18853..d917aa6 100644 --- a/src/DotRecast.Detour.TileCache/TileCache.cs +++ b/src/DotRecast.Detour.TileCache/TileCache.cs @@ -363,7 +363,7 @@ namespace DotRecast.Detour.TileCache TileCacheObstacle ob = allocObstacle(); ob.type = TileCacheObstacle.TileCacheObstacleType.CYLINDER; - vCopy(ref ob.pos, pos); + ob.pos = pos; ob.radius = radius; ob.height = height; @@ -387,8 +387,8 @@ namespace DotRecast.Detour.TileCache { TileCacheObstacle ob = allocObstacle(); ob.type = TileCacheObstacle.TileCacheObstacleType.ORIENTED_BOX; - vCopy(ref ob.center, center); - vCopy(ref ob.extents, extents); + ob.center = center; + ob.extents = extents; float coshalf = (float)Math.Cos(0.5f * yRadians); float sinhalf = (float)Math.Sin(-0.5f * yRadians); ob.rotAux[0] = coshalf * sinhalf; @@ -706,8 +706,8 @@ namespace DotRecast.Detour.TileCache } else if (ob.type == TileCacheObstacle.TileCacheObstacleType.BOX) { - vCopy(ref bmin, ob.bmin); - vCopy(ref bmax, ob.bmax); + bmin = ob.bmin; + bmax = ob.bmax; } else if (ob.type == TileCacheObstacle.TileCacheObstacleType.ORIENTED_BOX) { diff --git a/src/DotRecast.Detour/ConvexConvexIntersection.cs b/src/DotRecast.Detour/ConvexConvexIntersection.cs index b375ab6..2ad4497 100644 --- a/src/DotRecast.Detour/ConvexConvexIntersection.cs +++ b/src/DotRecast.Detour/ConvexConvexIntersection.cs @@ -270,43 +270,43 @@ namespace DotRecast.Detour { if (between(a, b, c) && between(a, b, d)) { - vCopy(ref p, c); - vCopy(ref q, d); + p = c; + q = d; return Intersection.Overlap; } if (between(c, d, a) && between(c, d, b)) { - vCopy(ref p, a); - vCopy(ref q, b); + p = a; + q = b; return Intersection.Overlap; } if (between(a, b, c) && between(c, d, b)) { - vCopy(ref p, c); - vCopy(ref q, b); + p = c; + q = b; return Intersection.Overlap; } if (between(a, b, c) && between(c, d, a)) { - vCopy(ref p, c); - vCopy(ref q, a); + p = c; + q = a; return Intersection.Overlap; } if (between(a, b, d) && between(c, d, b)) { - vCopy(ref p, d); - vCopy(ref q, b); + p = d; + q = b; return Intersection.Overlap; } if (between(a, b, d) && between(c, d, a)) { - vCopy(ref p, d); - vCopy(ref q, a); + p = d; + q = a; return Intersection.Overlap; } diff --git a/src/DotRecast.Detour/LegacyNavMeshQuery.cs b/src/DotRecast.Detour/LegacyNavMeshQuery.cs index a7011ff..0160ad1 100644 --- a/src/DotRecast.Detour/LegacyNavMeshQuery.cs +++ b/src/DotRecast.Detour/LegacyNavMeshQuery.cs @@ -58,7 +58,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, startPos); + startNode.pos = startPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = vDist(startPos, endPos) * H_SCALE; @@ -657,7 +657,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, centerPos); + startNode.pos = centerPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = 0; diff --git a/src/DotRecast.Detour/NavMesh.cs b/src/DotRecast.Detour/NavMesh.cs index 64306bd..92b64ea 100644 --- a/src/DotRecast.Detour/NavMesh.cs +++ b/src/DotRecast.Detour/NavMesh.cs @@ -325,7 +325,7 @@ namespace DotRecast.Detour private static NavMeshParams getNavMeshParams(MeshData data) { NavMeshParams option = new NavMeshParams(); - vCopy(ref option.orig, data.header.bmin); + option.orig = data.header.bmin; option.tileWidth = data.header.bmax[0] - data.header.bmin[0]; option.tileHeight = data.header.bmax[2] - data.header.bmin[2]; option.maxTiles = 1; @@ -1325,7 +1325,7 @@ namespace DotRecast.Detour MeshTile tile = tileAndPoly.Item1; Poly poly = tileAndPoly.Item2; Vector3f closest = new Vector3f(); - vCopy(ref closest, pos); + closest = pos; float? h = getPolyHeight(tile, poly, pos); if (null != h) { diff --git a/src/DotRecast.Detour/NavMeshBuilder.cs b/src/DotRecast.Detour/NavMeshBuilder.cs index f8227c0..418603c 100644 --- a/src/DotRecast.Detour/NavMeshBuilder.cs +++ b/src/DotRecast.Detour/NavMeshBuilder.cs @@ -343,8 +343,8 @@ namespace DotRecast.Detour hmax += option.walkableClimb; Vector3f bmin = new Vector3f(); Vector3f bmax = new Vector3f(); - vCopy(ref bmin, option.bmin); - vCopy(ref bmax, option.bmax); + bmin = option.bmin; + bmax = option.bmax; bmin[1] = hmin; bmax[1] = hmax; @@ -467,8 +467,8 @@ namespace DotRecast.Detour header.polyCount = totPolyCount; header.vertCount = totVertCount; header.maxLinkCount = maxLinkCount; - vCopy(ref header.bmin, option.bmin); - vCopy(ref header.bmax, option.bmax); + header.bmin = option.bmin; + header.bmax = option.bmax; header.detailMeshCount = option.polyCount; header.detailVertCount = uniqueDetailVertCount; header.detailTriCount = detailTriCount; diff --git a/src/DotRecast.Detour/NavMeshQuery.cs b/src/DotRecast.Detour/NavMeshQuery.cs index 43a89c0..69307df 100644 --- a/src/DotRecast.Detour/NavMeshQuery.cs +++ b/src/DotRecast.Detour/NavMeshQuery.cs @@ -264,7 +264,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, centerPos); + startNode.pos = centerPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = 0; @@ -812,7 +812,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, startPos); + startNode.pos = startPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = heuristic.getCost(startPos, endPos); @@ -1061,8 +1061,8 @@ namespace DotRecast.Detour m_query.status = Status.FAILURE; m_query.startRef = startRef; m_query.endRef = endRef; - vCopy(ref m_query.startPos, startPos); - vCopy(ref m_query.endPos, endPos); + m_query.startPos = startPos; + m_query.endPos = endPos; m_query.filter = filter; m_query.options = options; m_query.heuristic = heuristic; @@ -1094,7 +1094,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, startPos); + startNode.pos = startPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = heuristic.getCost(startPos, endPos); @@ -1842,7 +1842,7 @@ namespace DotRecast.Detour Vector3f bestPos = new Vector3f(); float bestDist = float.MaxValue; Node bestNode = null; - vCopy(ref bestPos, startPos); + bestPos = startPos; // Search constraints var searchPos = vLerp(startPos, endPos, 0.5f); @@ -1874,7 +1874,7 @@ namespace DotRecast.Detour if (pointInPolygon(endPos, verts, nverts)) { bestNode = curNode; - vCopy(ref bestPos, endPos); + bestPos = endPos; break; } @@ -2243,7 +2243,7 @@ namespace DotRecast.Detour Vector3f curPos = new Vector3f(), lastPos = new Vector3f(); - vCopy(ref curPos, startPos); + curPos = startPos; var dir = vSub(endPos, startPos); MeshTile prevTile, tile, nextTile; @@ -2411,7 +2411,7 @@ namespace DotRecast.Detour { // compute the intersection point at the furthest end of the polygon // and correct the height (since the raycast moves in 2d) - vCopy(ref lastPos, curPos); + lastPos = curPos; curPos = vMad(startPos, dir, hit.t); VectorPtr e1 = new VectorPtr(verts, iresult.segMax * 3); VectorPtr e2 = new VectorPtr(verts, ((iresult.segMax + 1) % nv) * 3); @@ -2516,7 +2516,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, centerPos); + startNode.pos = centerPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = 0; @@ -3243,7 +3243,7 @@ namespace DotRecast.Detour m_openList.clear(); Node startNode = m_nodePool.getNode(startRef); - vCopy(ref startNode.pos, centerPos); + startNode.pos = centerPos; startNode.pidx = 0; startNode.cost = 0; startNode.total = 0; diff --git a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs index 24f716e..9a3d564 100644 --- a/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/CrowdTool.cs @@ -435,7 +435,7 @@ public class CrowdTool : Tool dd.begin(LINES, 3.0f); Vector3f prev = new Vector3f(); float preva = 1; - vCopy(ref prev, pos); + prev = pos; for (int j = 0; j < AGENT_MAX_TRAIL - 1; ++j) { int idx = (trail.htrail + AGENT_MAX_TRAIL - j) % AGENT_MAX_TRAIL; diff --git a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs index 9c8442d..4bbbcb3 100644 --- a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs @@ -260,7 +260,7 @@ public class TestNavmeshTool : Tool if (endOfPath && PathUtils.inRange(iterPos, steerTarget.steerPos, SLOP, 1.0f)) { // Reached end of path. - vCopy(ref iterPos, targetPos); + iterPos = targetPos; if (m_smoothPath.Count < MAX_SMOOTH) { m_smoothPath.Add(iterPos); @@ -302,7 +302,7 @@ public class TestNavmeshTool : Tool } // Move position at the other side of the off-mesh link. - vCopy(ref iterPos, endPos); + iterPos = endPos; iterPos[1] = m_navQuery.getPolyHeight(polys[0], iterPos).result; } } @@ -990,7 +990,7 @@ public class TestNavmeshTool : Tool { // In case of partial path, make sure the end point is clamped to the last polygon. Vector3f epos = new Vector3f(); - vCopy(ref epos, m_epos); + epos = m_epos; if (m_polys[m_polys.Count - 1] != m_endRef) { Result result = m_navQuery diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs index a195564..53e488b 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs @@ -58,7 +58,7 @@ public class MeshSetReaderWriterTest NavMeshSetHeader header = new NavMeshSetHeader(); header.magic = NavMeshSetHeader.NAVMESHSET_MAGIC; header.version = NavMeshSetHeader.NAVMESHSET_VERSION; - vCopy(ref header.option.orig, geom.getMeshBoundsMin()); + header.option.orig = geom.getMeshBoundsMin(); header.option.tileWidth = m_tileSize * m_cellSize; header.option.tileHeight = m_tileSize * m_cellSize; header.option.maxTiles = m_maxTiles; diff --git a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs index 18d135a..a714dde 100644 --- a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs @@ -54,7 +54,7 @@ public class AbstractTileCacheTest int[] twh = Recast.Recast.calcTileCount(geom.getMeshBoundsMin(), geom.getMeshBoundsMax(), m_cellSize, m_tileSize, m_tileSize); option.ch = m_cellHeight; option.cs = m_cellSize; - vCopy(ref option.orig, geom.getMeshBoundsMin()); + option.orig = geom.getMeshBoundsMin(); option.height = m_tileSize; option.width = m_tileSize; option.walkableHeight = m_agentHeight; diff --git a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs index 7edc1fd..e23cce2 100644 --- a/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs +++ b/test/DotRecast.Detour.TileCache.Test/TestTileLayerBuilder.cs @@ -98,8 +98,8 @@ public class TestTileLayerBuilder : AbstractTileLayersBuilder header.tx = tx; header.ty = ty; header.tlayer = i; - vCopy(ref header.bmin, layer.bmin); - vCopy(ref header.bmax, layer.bmax); + header.bmin = layer.bmin; + header.bmax = layer.bmax; // Tile info. header.width = layer.width;