forked from mirror/DotRecast
copy -> operator=
This commit is contained in:
parent
5592f82192
commit
67cbf7ffd1
|
@ -426,7 +426,7 @@ public class CrowdProfilingTool
|
||||||
public AgentData(AgentType type, Vector3f home)
|
public AgentData(AgentType type, Vector3f home)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
RecastVectors.copy(ref this.home, home);
|
this.home = home;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ namespace DotRecast.Recast
|
||||||
this.tileX = tileX;
|
this.tileX = tileX;
|
||||||
this.tileZ = tileZ;
|
this.tileZ = tileZ;
|
||||||
this.cfg = cfg;
|
this.cfg = cfg;
|
||||||
copy(ref this.bmin, bmin);
|
this.bmin = bmin;
|
||||||
copy(ref this.bmax, bmax);
|
this.bmax = bmax;
|
||||||
if (cfg.useTiles)
|
if (cfg.useTiles)
|
||||||
{
|
{
|
||||||
float tsx = cfg.tileSizeX * cfg.cs;
|
float tsx = cfg.tileSizeX * cfg.cs;
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace DotRecast.Recast
|
||||||
chf.walkableHeight = walkableHeight;
|
chf.walkableHeight = walkableHeight;
|
||||||
chf.walkableClimb = walkableClimb;
|
chf.walkableClimb = walkableClimb;
|
||||||
chf.maxRegions = 0;
|
chf.maxRegions = 0;
|
||||||
copy(ref chf.bmin, hf.bmin);
|
chf.bmin = hf.bmin;
|
||||||
copy(ref chf.bmax, hf.bmax);
|
chf.bmax = hf.bmax;
|
||||||
chf.bmax.y += walkableHeight * hf.ch;
|
chf.bmax.y += walkableHeight * hf.ch;
|
||||||
chf.cs = hf.cs;
|
chf.cs = hf.cs;
|
||||||
chf.ch = hf.ch;
|
chf.ch = hf.ch;
|
||||||
|
|
|
@ -780,8 +780,8 @@ namespace DotRecast.Recast
|
||||||
ContourSet cset = new ContourSet();
|
ContourSet cset = new ContourSet();
|
||||||
|
|
||||||
ctx.startTimer("CONTOURS");
|
ctx.startTimer("CONTOURS");
|
||||||
RecastVectors.copy(ref cset.bmin, chf.bmin, 0);
|
cset.bmin = chf.bmin;
|
||||||
RecastVectors.copy(ref cset.bmax, chf.bmax, 0);
|
cset.bmax = chf.bmax;
|
||||||
if (borderSize > 0)
|
if (borderSize > 0)
|
||||||
{
|
{
|
||||||
// If the heightfield was build with bordersize, remove the offset.
|
// If the heightfield was build with bordersize, remove the offset.
|
||||||
|
|
|
@ -428,10 +428,8 @@ namespace DotRecast.Recast
|
||||||
int lh = h - borderSize * 2;
|
int lh = h - borderSize * 2;
|
||||||
|
|
||||||
// Build contracted bbox for layers.
|
// Build contracted bbox for layers.
|
||||||
Vector3f bmin = new Vector3f();
|
Vector3f bmin = chf.bmin;
|
||||||
Vector3f bmax = new Vector3f();
|
Vector3f bmax = chf.bmax;
|
||||||
copy(ref bmin, chf.bmin);
|
|
||||||
copy(ref bmax, chf.bmax);
|
|
||||||
bmin.x += borderSize * chf.cs;
|
bmin.x += borderSize * chf.cs;
|
||||||
bmin.z += borderSize * chf.cs;
|
bmin.z += borderSize * chf.cs;
|
||||||
bmax.x -= borderSize * chf.cs;
|
bmax.x -= borderSize * chf.cs;
|
||||||
|
@ -475,8 +473,8 @@ namespace DotRecast.Recast
|
||||||
layer.ch = chf.ch;
|
layer.ch = chf.ch;
|
||||||
|
|
||||||
// Adjust the bbox to fit the heightfield.
|
// Adjust the bbox to fit the heightfield.
|
||||||
copy(ref layer.bmin, bmin);
|
layer.bmin = bmin;
|
||||||
copy(ref layer.bmax, bmax);
|
layer.bmax = bmax;
|
||||||
layer.bmin.y = bmin.y + hmin * chf.ch;
|
layer.bmin.y = bmin.y + hmin * chf.ch;
|
||||||
layer.bmax.y = bmin.y + hmax * chf.ch;
|
layer.bmax.y = bmin.y + hmax * chf.ch;
|
||||||
layer.hmin = hmin;
|
layer.hmin = hmin;
|
||||||
|
|
|
@ -976,8 +976,8 @@ namespace DotRecast.Recast
|
||||||
{
|
{
|
||||||
ctx.startTimer("POLYMESH");
|
ctx.startTimer("POLYMESH");
|
||||||
PolyMesh mesh = new PolyMesh();
|
PolyMesh mesh = new PolyMesh();
|
||||||
RecastVectors.copy(ref mesh.bmin, cset.bmin, 0);
|
mesh.bmin = cset.bmin;
|
||||||
RecastVectors.copy(ref mesh.bmax, cset.bmax, 0);
|
mesh.bmax = cset.bmax;
|
||||||
mesh.cs = cset.cs;
|
mesh.cs = cset.cs;
|
||||||
mesh.ch = cset.ch;
|
mesh.ch = cset.ch;
|
||||||
mesh.borderSize = cset.borderSize;
|
mesh.borderSize = cset.borderSize;
|
||||||
|
@ -1231,8 +1231,8 @@ namespace DotRecast.Recast
|
||||||
mesh.nvp = meshes[0].nvp;
|
mesh.nvp = meshes[0].nvp;
|
||||||
mesh.cs = meshes[0].cs;
|
mesh.cs = meshes[0].cs;
|
||||||
mesh.ch = meshes[0].ch;
|
mesh.ch = meshes[0].ch;
|
||||||
RecastVectors.copy(ref mesh.bmin, meshes[0].bmin, 0);
|
mesh.bmin = meshes[0].bmin;
|
||||||
RecastVectors.copy(ref mesh.bmax, meshes[0].bmax, 0);
|
mesh.bmax = meshes[0].bmax;
|
||||||
|
|
||||||
int maxVerts = 0;
|
int maxVerts = 0;
|
||||||
int maxPolys = 0;
|
int maxPolys = 0;
|
||||||
|
@ -1361,8 +1361,8 @@ namespace DotRecast.Recast
|
||||||
dst.npolys = src.npolys;
|
dst.npolys = src.npolys;
|
||||||
dst.maxpolys = src.npolys;
|
dst.maxpolys = src.npolys;
|
||||||
dst.nvp = src.nvp;
|
dst.nvp = src.nvp;
|
||||||
RecastVectors.copy(ref dst.bmin, src.bmin, 0);
|
dst.bmin = src.bmin;
|
||||||
RecastVectors.copy(ref dst.bmax, src.bmax, 0);
|
dst.bmax = src.bmax;
|
||||||
dst.cs = src.cs;
|
dst.cs = src.cs;
|
||||||
dst.ch = src.ch;
|
dst.ch = src.ch;
|
||||||
dst.borderSize = src.borderSize;
|
dst.borderSize = src.borderSize;
|
||||||
|
|
|
@ -58,18 +58,6 @@ namespace DotRecast.Recast
|
||||||
copy(ref @out, 0, @in, i);
|
copy(ref @out, 0, @in, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void copy(ref Vector3f @out, Vector3f @in, int i)
|
|
||||||
{
|
|
||||||
copy(ref @out, 0, @in, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void copy(ref Vector3f @out, Vector3f @in)
|
|
||||||
{
|
|
||||||
@out = @in;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void copy(float[] @out, int n, float[] @in, int m)
|
public static void copy(float[] @out, int n, float[] @in, int m)
|
||||||
{
|
{
|
||||||
@out[n] = @in[m];
|
@out[n] = @in[m];
|
||||||
|
@ -84,8 +72,6 @@ namespace DotRecast.Recast
|
||||||
@out[n + 2] = @in[m + 2];
|
@out[n + 2] = @in[m + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void copy(ref Vector3f @out, int n, float[] @in, int m)
|
public static void copy(ref Vector3f @out, int n, float[] @in, int m)
|
||||||
{
|
{
|
||||||
@out[n] = @in[m];
|
@out[n] = @in[m];
|
||||||
|
@ -93,14 +79,6 @@ namespace DotRecast.Recast
|
||||||
@out[n + 2] = @in[m + 2];
|
@out[n + 2] = @in[m + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void copy(ref Vector3f @out, int n, Vector3f @in, int m)
|
|
||||||
{
|
|
||||||
@out[n] = @in[m];
|
|
||||||
@out[n + 1] = @in[m + 1];
|
|
||||||
@out[n + 2] = @in[m + 2];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void add(ref Vector3f e0, Vector3f a, float[] verts, int i)
|
public static void add(ref Vector3f e0, Vector3f a, float[] verts, int i)
|
||||||
{
|
{
|
||||||
e0.x = a.x + verts[i];
|
e0.x = a.x + verts[i];
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class TestTiledNavMeshBuilder
|
||||||
{
|
{
|
||||||
// Create empty nav mesh
|
// Create empty nav mesh
|
||||||
NavMeshParams navMeshParams = new NavMeshParams();
|
NavMeshParams navMeshParams = new NavMeshParams();
|
||||||
copy(ref navMeshParams.orig, m_geom.getMeshBoundsMin());
|
navMeshParams.orig = m_geom.getMeshBoundsMin();
|
||||||
navMeshParams.tileWidth = m_tileSize * m_cellSize;
|
navMeshParams.tileWidth = m_tileSize * m_cellSize;
|
||||||
navMeshParams.tileHeight = m_tileSize * m_cellSize;
|
navMeshParams.tileHeight = m_tileSize * m_cellSize;
|
||||||
navMeshParams.maxTiles = 128;
|
navMeshParams.maxTiles = 128;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class AbstractTileCacheTest
|
||||||
option.maxTiles = twh[0] * twh[1] * EXPECTED_LAYERS_PER_TILE;
|
option.maxTiles = twh[0] * twh[1] * EXPECTED_LAYERS_PER_TILE;
|
||||||
option.maxObstacles = 128;
|
option.maxObstacles = 128;
|
||||||
NavMeshParams navMeshParams = new NavMeshParams();
|
NavMeshParams navMeshParams = new NavMeshParams();
|
||||||
copy(ref navMeshParams.orig, geom.getMeshBoundsMin());
|
navMeshParams.orig = geom.getMeshBoundsMin();
|
||||||
navMeshParams.tileWidth = m_tileSize * m_cellSize;
|
navMeshParams.tileWidth = m_tileSize * m_cellSize;
|
||||||
navMeshParams.tileHeight = m_tileSize * m_cellSize;
|
navMeshParams.tileHeight = m_tileSize * m_cellSize;
|
||||||
navMeshParams.maxTiles = 256;
|
navMeshParams.maxTiles = 256;
|
||||||
|
|
Loading…
Reference in New Issue