本文整理汇总了C#中IntVector3.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IntVector3.ToString方法的具体用法?C# IntVector3.ToString怎么用?C# IntVector3.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntVector3
的用法示例。
在下文中一共展示了IntVector3.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateChunk
public virtual Chunk GenerateChunk(IntVector3 start, IntVector3 end, int lod = 1)
{
Debug.WriteLine("Generating Chunk at " + start.ToString());
var chunk = new Chunk(start, end);
var pos = new IntVector3(start);
for (pos.X = chunk.Start.X; pos.X < chunk.End.X; pos.X += lod)
for (pos.Y = chunk.Start.Y; pos.Y < chunk.End.Y; pos.Y += lod)
for (pos.Z = chunk.Start.Z; pos.Z < chunk.End.Z; pos.Z += lod)
chunk.SetVoxel(pos, GenerateVoxel(pos));
return chunk;
}
示例2: getPatternOrChunk
/// <summary>
/// NOT FULLY IMPLEMENTED
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public patternOrChunk getPatternOrChunk(IntVector3 position)
{
patternOrChunk toMake;
//map first
if ((position >= mapOffset) && position < mapOffset + new IntVector3(mapSize))
{
Chunk possible = map.get(position - mapOffset);
if (possible != null)
{
toMake = new patternOrChunk(possible);
if (mapGenHelper != null)
{
mapGenHelper[position] = toMake;
}
return toMake;
}
}
//then helper
//because if you do helper first, then ones generated during a run don't get acknowledged
if (mapGenHelper != null)
{
if (mapGenHelper.ContainsKey(position))
{
return mapGenHelper[position];
}
}
//then, check for a file
String filename = position.ToString();
mapV1 mapmaker;
try
{
//for some reason this is slow as fuck
//probably because hard drives are slow
//so it's commented for now
//I wonder if it would be better if it was actually loading things?
//mapmaker = content.Load<mapV1>(filename);
}
catch (ContentLoadException)
{
//if no file, then generate the pattern
//mapmaker = Mapgen.generatePatterns(this, position);
}
//beyond here lies TEMP SHIT CODE
//if (mapmaker.layers[0] == "ungenerated")
{
toMake = new patternOrChunk(OutpostLibrary.Structure.field);
if (mapGenHelper != null)
{
mapGenHelper[position] = toMake;
}
return toMake;
}
Chunk building = new Chunk(position, graphics);
//chunk loading from file goes here
building.endFill();
toMake = new patternOrChunk(building);
if (mapGenHelper != null)
{
mapGenHelper[position] = toMake;
}
return toMake;
}
示例3: loadChunk
/// <summary>
/// NOT FULLY IMPLEMENTED
/// Loads a chunk specified by position in the world map.
/// Will generate the chunk if it does not already exist.
/// </summary>
/// <param name="position">The position to load from.</param>
/// <returns>An Octree representation of the chunk.</returns>
Chunk loadChunk(IntVector3 position)
{
LoadingScreen.ChangeMessage("Loading chunk " + position.ToString());
String filename = position.ToString();
mapV1 mapmaker;
try
{
//mapmaker = content.Load<mapV1>(filename);
}
catch (ContentLoadException)
{
//mapmaker = Mapgen.generatePatterns(this, position);
}
Chunk building = new Chunk(position, graphics);
//if (mapmaker.layers[0] == "ungenerated")
{
lua.buildChunk(position, building);
}
//else
{
//Chunk loading from file code goes here.
}
return building;
}