private CalcVecArraySize ( bool includeTerrain, bool includeLiquid, bool includeWMO, bool includeM2 ) : int | ||
includeTerrain | bool | |
includeLiquid | bool | |
includeWMO | bool | |
includeM2 | bool | |
리턴 | int |
private int CalcVecArraySize(bool includeTerrain, bool includeLiquid, bool includeWMO, bool includeM2)
{
var count = 0;
List<Vector3> renderVertices;
foreach (var tile in _adtManager.MapTiles)
{
if (tile == null) continue;
if (includeTerrain)
{
renderVertices = tile.TerrainVertices;
if (renderVertices != null)
{
count += renderVertices.Count;
}
}
if (includeLiquid)
{
renderVertices = tile.LiquidVertices;
if (renderVertices == null) continue;
count += renderVertices.Count;
}
}
// Get the WMO triangles
if (includeWMO)
{
renderVertices = _wmoManager.WmoVertices;
if (renderVertices != null)
{
count += renderVertices.Count;
}
}
// Get the M2 triangles
if (includeM2)
{
renderVertices = _m2Manager.RenderVertices;
if (renderVertices != null)
{
count += renderVertices.Count;
}
}
return count;
}