本文整理汇总了C#中Index3.NormalizeXYZ方法的典型用法代码示例。如果您正苦于以下问题:C# Index3.NormalizeXYZ方法的具体用法?C# Index3.NormalizeXYZ怎么用?C# Index3.NormalizeXYZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index3
的用法示例。
在下文中一共展示了Index3.NormalizeXYZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetBlock
/// <summary>
/// Überschreibt den Block an der angegebenen Koordinate.
/// </summary>
/// <param name="index">Block-Koordinate</param>
/// <param name="block">Neuer Block oder null, falls der alte Bock gelöscht werden soll.</param>
public void SetBlock(Index3 index, IBlock block)
{
IPlanet planet = ResourceManager.Instance.GetPlanet(Player.Position.Planet);
index.NormalizeXYZ(new Index3(
planet.Size.X * Chunk.CHUNKSIZE_X,
planet.Size.Y * Chunk.CHUNKSIZE_Y,
planet.Size.Z * Chunk.CHUNKSIZE_Z));
Coordinate coordinate = new Coordinate(0, index, Vector3.Zero);
IChunk chunk = localChunkCache.Get(coordinate.ChunkIndex);
chunk.SetBlock(coordinate.LocalBlockIndex, block);
}
示例2: SetBlock
/// <summary>
/// Überschreibt den Block an der angegebenen Koordinate.
/// </summary>
/// <param name="index">Block-Koordinate</param>
/// <param name="block">Neuer Block oder null, falls der alte Bock gelöscht werden soll.</param>
public void SetBlock(int planetId, Index3 index, IBlock block)
{
IPlanet planet = GetPlanet(planetId);
index.NormalizeXYZ(new Index3(
planet.Size.X * Chunk.CHUNKSIZE_X,
planet.Size.Y * Chunk.CHUNKSIZE_Y,
planet.Size.Z * Chunk.CHUNKSIZE_Z));
Coordinate coordinate = new Coordinate(0, index, Vector3.Zero);
IChunk chunk = GetChunk(planetId, coordinate.ChunkIndex);
chunk.SetBlock(coordinate.LocalBlockIndex, block);
}