Revert "Add: Helper methods for obtaining X and Z coordinates of chunk given a block's X and Z world coordinates."
This reverts commit cfa49b50a4b58598aa1e1871155ee8ad2c2a8c10.
This commit is contained in:
parent
3e124b2a0f
commit
062fee8471
@ -174,16 +174,6 @@ namespace TrueCraft.Core
|
|||||||
return ChunkZ * Chunk.Depth + BlockCoord;
|
return ChunkZ * Chunk.Depth + BlockCoord;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int BlockToChunkX(int BlockCoord)
|
|
||||||
{
|
|
||||||
return (int)Math.Floor((double)BlockCoord / Chunk.Width);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int BlockToChunkZ(int BlockCoord)
|
|
||||||
{
|
|
||||||
return (int)Math.Floor((double)BlockCoord / Chunk.Depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value indicating the most extreme value of the
|
/// Returns a value indicating the most extreme value of the
|
||||||
/// provided Vector.
|
/// provided Vector.
|
||||||
|
@ -299,8 +299,8 @@ namespace TrueCraft.Core.World
|
|||||||
if (coordinates.Y < 0 || coordinates.Y >= Chunk.Height)
|
if (coordinates.Y < 0 || coordinates.Y >= Chunk.Height)
|
||||||
throw new ArgumentOutOfRangeException("coordinates", "Coordinates are out of range");
|
throw new ArgumentOutOfRangeException("coordinates", "Coordinates are out of range");
|
||||||
|
|
||||||
var chunkX = MathHelper.BlockToChunkX(coordinates.X);
|
var chunkX = (int)Math.Floor((double)coordinates.X / Chunk.Width);
|
||||||
var chunkZ = MathHelper.BlockToChunkZ(coordinates.Z);
|
var chunkZ = (int)Math.Floor((double)coordinates.Z / Chunk.Depth);
|
||||||
|
|
||||||
chunk = GetChunk(new Coordinates2D(chunkX, chunkZ));
|
chunk = GetChunk(new Coordinates2D(chunkX, chunkZ));
|
||||||
return new Coordinates3D(
|
return new Coordinates3D(
|
||||||
|
Reference in New Issue
Block a user