本文整理汇总了C#中Vertex.Rewrite方法的典型用法代码示例。如果您正苦于以下问题:C# Vertex.Rewrite方法的具体用法?C# Vertex.Rewrite怎么用?C# Vertex.Rewrite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertex
的用法示例。
在下文中一共展示了Vertex.Rewrite方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLowestRegionCenter
public Vertex GetLowestRegionCenter(int radius, int offset)
{
double lowestSum = 100;
Vertex lowestRegionCenter = new Vertex(offset, offset, 10);
for (int x = offset; x < terrainSize - offset; x += radius)
{
for (int z = offset; z < terrainSize - offset; z += radius)
{
double sum = 0;
for (int i = x - radius; i < x + radius; i++)
{
for (int j = z - radius; j < z + radius; j++)
{
if (CheckBounds(i, j))
sum += vertices[i, j].y;
else
sum += 1;
}
}
if (sum < lowestSum)
{
lowestSum = sum;
lowestRegionCenter.Rewrite(x, z, vertices[x, z].y);
}
}
}
return lowestRegionCenter;
}
示例2: GetLowestPointInArea
public Vertex GetLowestPointInArea(int _x, int _z, int area)
{
Vertex lowestVert = new Vertex(_x, _z, vertices[_x, _z].y);
for (int x = _x - area; x <= _x + area; x++)
{
for (int z = _z - area; z <= _z + area; z++)
{
if (CheckBounds(x, z) && vertices[x, z].y < lowestVert.height)
{
lowestVert.Rewrite(x, z, vertices[x, z].y);
}
}
}
return lowestVert;
}