public MovingBlockSet() { TerrainGeometrySubset terrainGeometrySubset = new TerrainGeometrySubset(Vertices, Indices); Geometry = new TerrainGeometry(); Geometry.SubsetOpaque = terrainGeometrySubset; Geometry.SubsetAlphaTest = terrainGeometrySubset; Geometry.SubsetTransparent = terrainGeometrySubset; Geometry.OpaqueSubsetsByFace = new TerrainGeometrySubset[6] { terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset }; Geometry.AlphaTestSubsetsByFace = new TerrainGeometrySubset[6] { terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset }; Geometry.TransparentSubsetsByFace = new TerrainGeometrySubset[6] { terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset, terrainGeometrySubset }; }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { TerrainGeometrySubset subsetAlphaTest = geometry.SubsetAlphaTest; DynamicArray <TerrainVertex> vertices = subsetAlphaTest.Vertices; DynamicArray <ushort> indices = subsetAlphaTest.Indices; int count = vertices.Count; int data = Terrain.ExtractData(value); int num = Terrain.ExtractLight(value); int mountingFace = GetMountingFace(data); float s = LightingManager.LightIntensityByLightValueAndFace[num + 16 * mountingFace]; Color color = Color.White * s; switch (mountingFace) { case 2: vertices.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z + 1, color, DefaultTextureSlot, 0, ref vertices.Array[count]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z + 1, color, DefaultTextureSlot, 1, ref vertices.Array[count + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z + 1, color, DefaultTextureSlot, 2, ref vertices.Array[count + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z + 1, color, DefaultTextureSlot, 3, ref vertices.Array[count + 3]); indices.Add((ushort)count); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 1)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 3)); indices.Add((ushort)count); indices.Add((ushort)count); indices.Add((ushort)(count + 3)); indices.Add((ushort)(count + 2)); break; case 3: vertices.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z, color, DefaultTextureSlot, 0, ref vertices.Array[count]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z, color, DefaultTextureSlot, 3, ref vertices.Array[count + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z + 1, color, DefaultTextureSlot, 2, ref vertices.Array[count + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z + 1, color, DefaultTextureSlot, 1, ref vertices.Array[count + 3]); indices.Add((ushort)count); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 1)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 3)); indices.Add((ushort)count); indices.Add((ushort)count); indices.Add((ushort)(count + 3)); indices.Add((ushort)(count + 2)); break; case 0: vertices.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z, color, DefaultTextureSlot, 0, ref vertices.Array[count]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z, color, DefaultTextureSlot, 1, ref vertices.Array[count + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z, color, DefaultTextureSlot, 2, ref vertices.Array[count + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z, color, DefaultTextureSlot, 3, ref vertices.Array[count + 3]); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 2)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)count); indices.Add((ushort)(count + 3)); indices.Add((ushort)(count + 3)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); break; case 1: vertices.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z, color, DefaultTextureSlot, 0, ref vertices.Array[count]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z, color, DefaultTextureSlot, 3, ref vertices.Array[count + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z + 1, color, DefaultTextureSlot, 2, ref vertices.Array[count + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y, z + 1, color, DefaultTextureSlot, 1, ref vertices.Array[count + 3]); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 2)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)count); indices.Add((ushort)(count + 3)); indices.Add((ushort)(count + 3)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); break; } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); Color fabricColor = SubsystemPalette.GetFabricColor(generator, GetColor(data)); generator.GenerateCubeVertices(this, value, x, y, z, 0.0625f, 0.0625f, 0.0625f, 0.0625f, fabricColor, fabricColor, fabricColor, fabricColor, fabricColor, -1, geometry.OpaqueSubsetsByFace); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int size = GetSize(data); bool isDead = GetIsDead(data); if (size >= 1) { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshesBySize[size], Color.White, null, geometry.SubsetOpaque); } if (size == 0) { generator.GenerateCrossfaceVertices(this, value, x, y, z, new Color(160, 160, 160), 11, geometry.SubsetAlphaTest); } else if (size < 7 && !isDead) { generator.GenerateCrossfaceVertices(this, value, x, y, z, Color.White, 28, geometry.SubsetAlphaTest); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int face = GetFace(data); int?color = GetColor(data); if (color.HasValue) { generator.GenerateMeshVertices(this, x, y, z, m_coloredBlockMeshes[face], SubsystemPalette.GetColor(generator, color), null, geometry.SubsetOpaque); } else { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshes[face], Color.White, null, geometry.SubsetOpaque); } generator.GenerateWireVertices(value, x, y, z, GetFace(data), 0.375f, Vector2.Zero, geometry.SubsetOpaque); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { if (GetIsWild(Terrain.ExtractData(value))) { Color color = BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x, y, z); generator.GenerateCrossfaceVertices(this, value, x, y, z, color, GetFaceTextureSlot(0, value), geometry.SubsetAlphaTest); } else { generator.GenerateCrossfaceVertices(this, value, x, y, z, Color.White, GetFaceTextureSlot(0, value), geometry.SubsetAlphaTest); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { generator.GenerateShadedMeshVertices(this, x, y, z, m_blockMesh, Color.White, null, null, geometry.SubsetOpaque); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { Color color = BlockColorsMap.SeagrassColorsMap.Lookup(generator.Terrain, x, y, z); generator.GenerateCrossfaceVertices(this, value, x, y, z, color, GetFaceTextureSlot(-1, value), geometry.SubsetAlphaTest); base.GenerateTerrainVertices(generator, geometry, value, x, y, z); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { Color color = m_blockColorsMap.Lookup(generator.Terrain, x, y, z); generator.GenerateCubeVertices(this, value, x, y, z, color, geometry.AlphaTestSubsetsByFace); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { TerrainGeometrySubset[] alphaTestSubsetsByFace = geometry.AlphaTestSubsetsByFace; int data = Terrain.ExtractData(value); int value2 = (y + 1 < 256) ? generator.Terrain.GetCellValueFast(x, y + 1, z) : 0; int num = Terrain.ExtractContents(value2); int data2 = Terrain.ExtractData(value2); int value3 = (y + 2 < 256) ? generator.Terrain.GetCellValueFast(x, y + 2, z) : 0; int num2 = Terrain.ExtractContents(value3); int data3 = Terrain.ExtractData(value3); if (HasFireOnFace(data, 0)) { int value4 = (y + 1 < 256) ? generator.Terrain.GetCellValueFast(x, y + 1, z + 1) : 0; int num3 = Terrain.ExtractContents(value4); int data4 = Terrain.ExtractData(value4); int value5 = (y + 2 < 256) ? generator.Terrain.GetCellValueFast(x, y + 2, z + 1) : 0; int num4 = Terrain.ExtractContents(value5); int data5 = Terrain.ExtractData(value5); int num5 = DefaultTextureSlot; if ((num == 104 && HasFireOnFace(data2, 0)) || (num3 == 104 && HasFireOnFace(data4, 2))) { num5 += 16; if ((num2 == 104 && HasFireOnFace(data3, 0)) || (num4 == 104 && HasFireOnFace(data5, 2))) { num5 += 16; } } DynamicArray <TerrainVertex> vertices = alphaTestSubsetsByFace[0].Vertices; DynamicArray <ushort> indices = alphaTestSubsetsByFace[0].Indices; int count = vertices.Count; vertices.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z + 1, Color.White, num5, 0, ref vertices.Array[count]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z + 1, Color.White, num5, 1, ref vertices.Array[count + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z + 1, Color.White, num5, 2, ref vertices.Array[count + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z + 1, Color.White, num5, 3, ref vertices.Array[count + 3]); indices.Add((ushort)count); indices.Add((ushort)(count + 1)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 1)); indices.Add((ushort)count); indices.Add((ushort)(count + 2)); indices.Add((ushort)(count + 3)); indices.Add((ushort)count); indices.Add((ushort)count); indices.Add((ushort)(count + 3)); indices.Add((ushort)(count + 2)); } if (HasFireOnFace(data, 1)) { int value6 = (y + 1 < 256) ? generator.Terrain.GetCellValueFast(x + 1, y + 1, z) : 0; int num6 = Terrain.ExtractContents(value6); int data6 = Terrain.ExtractData(value6); int value7 = (y + 2 < 256) ? generator.Terrain.GetCellValueFast(x + 1, y + 2, z) : 0; int num7 = Terrain.ExtractContents(value7); int data7 = Terrain.ExtractData(value7); int num8 = DefaultTextureSlot; if ((num == 104 && HasFireOnFace(data2, 1)) || (num6 == 104 && HasFireOnFace(data6, 3))) { num8 += 16; if ((num2 == 104 && HasFireOnFace(data3, 1)) || (num7 == 104 && HasFireOnFace(data7, 3))) { num8 += 16; } } DynamicArray <TerrainVertex> vertices2 = alphaTestSubsetsByFace[1].Vertices; DynamicArray <ushort> indices2 = alphaTestSubsetsByFace[1].Indices; int count2 = vertices2.Count; vertices2.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z, Color.White, num8, 0, ref vertices2.Array[count2]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z, Color.White, num8, 3, ref vertices2.Array[count2 + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z + 1, Color.White, num8, 2, ref vertices2.Array[count2 + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z + 1, Color.White, num8, 1, ref vertices2.Array[count2 + 3]); indices2.Add((ushort)count2); indices2.Add((ushort)(count2 + 1)); indices2.Add((ushort)(count2 + 2)); indices2.Add((ushort)(count2 + 2)); indices2.Add((ushort)(count2 + 1)); indices2.Add((ushort)count2); indices2.Add((ushort)(count2 + 2)); indices2.Add((ushort)(count2 + 3)); indices2.Add((ushort)count2); indices2.Add((ushort)count2); indices2.Add((ushort)(count2 + 3)); indices2.Add((ushort)(count2 + 2)); } if (HasFireOnFace(data, 2)) { int value8 = (y + 1 < 256) ? generator.Terrain.GetCellValueFast(x, y + 1, z - 1) : 0; int num9 = Terrain.ExtractContents(value8); int data8 = Terrain.ExtractData(value8); int value9 = (y + 2 < 256) ? generator.Terrain.GetCellValueFast(x, y + 2, z - 1) : 0; int num10 = Terrain.ExtractContents(value9); int data9 = Terrain.ExtractData(value9); int num11 = DefaultTextureSlot; if ((num == 104 && HasFireOnFace(data2, 2)) || (num9 == 104 && HasFireOnFace(data8, 0))) { num11 += 16; if ((num2 == 104 && HasFireOnFace(data3, 2)) || (num10 == 104 && HasFireOnFace(data9, 0))) { num11 += 16; } } DynamicArray <TerrainVertex> vertices3 = alphaTestSubsetsByFace[2].Vertices; DynamicArray <ushort> indices3 = alphaTestSubsetsByFace[2].Indices; int count3 = vertices3.Count; vertices3.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z, Color.White, num11, 0, ref vertices3.Array[count3]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y, z, Color.White, num11, 1, ref vertices3.Array[count3 + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x + 1, y + 1, z, Color.White, num11, 2, ref vertices3.Array[count3 + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z, Color.White, num11, 3, ref vertices3.Array[count3 + 3]); indices3.Add((ushort)count3); indices3.Add((ushort)(count3 + 2)); indices3.Add((ushort)(count3 + 1)); indices3.Add((ushort)(count3 + 1)); indices3.Add((ushort)(count3 + 2)); indices3.Add((ushort)count3); indices3.Add((ushort)(count3 + 2)); indices3.Add((ushort)count3); indices3.Add((ushort)(count3 + 3)); indices3.Add((ushort)(count3 + 3)); indices3.Add((ushort)count3); indices3.Add((ushort)(count3 + 2)); } if (!HasFireOnFace(data, 3)) { return; } int value10 = (y + 1 < 256) ? generator.Terrain.GetCellValueFast(x - 1, y + 1, z) : 0; int num12 = Terrain.ExtractContents(value10); int data10 = Terrain.ExtractData(value10); int value11 = (y + 2 < 256) ? generator.Terrain.GetCellValueFast(x - 1, y + 2, z) : 0; int num13 = Terrain.ExtractContents(value11); int data11 = Terrain.ExtractData(value11); int num14 = DefaultTextureSlot; if ((num == 104 && HasFireOnFace(data2, 3)) || (num12 == 104 && HasFireOnFace(data10, 1))) { num14 += 16; if ((num2 == 104 && HasFireOnFace(data3, 3)) || (num13 == 104 && HasFireOnFace(data11, 1))) { num14 += 16; } } DynamicArray <TerrainVertex> vertices4 = alphaTestSubsetsByFace[3].Vertices; DynamicArray <ushort> indices4 = alphaTestSubsetsByFace[3].Indices; int count4 = vertices4.Count; vertices4.Count += 4; BlockGeometryGenerator.SetupLitCornerVertex(x, y, z, Color.White, num14, 0, ref vertices4.Array[count4]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z, Color.White, num14, 3, ref vertices4.Array[count4 + 1]); BlockGeometryGenerator.SetupLitCornerVertex(x, y + 1, z + 1, Color.White, num14, 2, ref vertices4.Array[count4 + 2]); BlockGeometryGenerator.SetupLitCornerVertex(x, y, z + 1, Color.White, num14, 1, ref vertices4.Array[count4 + 3]); indices4.Add((ushort)count4); indices4.Add((ushort)(count4 + 2)); indices4.Add((ushort)(count4 + 1)); indices4.Add((ushort)(count4 + 1)); indices4.Add((ushort)(count4 + 2)); indices4.Add((ushort)count4); indices4.Add((ushort)(count4 + 2)); indices4.Add((ushort)count4); indices4.Add((ushort)(count4 + 3)); indices4.Add((ushort)(count4 + 3)); indices4.Add((ushort)count4); indices4.Add((ushort)(count4 + 2)); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { for (int i = 0; i < 6; i++) { if (WireExistsOnFace(value, i)) { generator.GenerateWireVertices(value, x, y, z, i, 0f, Vector2.Zero, geometry.SubsetOpaque); } } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value) & 0x3F; if (num < m_blockMeshesByData.Length && m_blockMeshesByData[num] != null) { generator.GenerateShadedMeshVertices(this, x, y, z, m_blockMeshesByData[num], Color.White, null, null, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { generator.GenerateCubeVertices(this, value, x, y, z, Color.White, geometry.AlphaTestSubsetsByFace); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { Color topColor = BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x, y, z); Color topColor2 = BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x + 1, y, z); Color topColor3 = BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x + 1, y, z + 1); Color topColor4 = BlockColorsMap.GrassColorsMap.Lookup(generator.Terrain, x, y, z + 1); generator.GenerateCubeVertices(this, value, x, y, z, 1f, 1f, 1f, 1f, Color.White, topColor, topColor2, topColor3, topColor4, -1, geometry.OpaqueSubsetsByFace); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value) & 0x1F; generator.GenerateMeshVertices(this, x, y, z, m_blockMeshes[num], Color.White, null, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, GetFace(value), m_centerBoxSize, Vector2.Zero, geometry.SubsetOpaque); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int variant = GetVariant(data); int?color = GetColor(data); if (color.HasValue) { generator.GenerateMeshVertices(this, x, y, z, m_coloredBlockMeshes[variant], SubsystemPalette.GetColor(generator, color), null, m_useAlphaTest ? geometry.SubsetAlphaTest : geometry.SubsetOpaque); } else { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshes[variant], m_unpaintedColor, null, m_useAlphaTest ? geometry.SubsetAlphaTest : geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int mountingFace = GetMountingFace(Terrain.ExtractData(value)); if (mountingFace < m_blockMeshesByFace.Length) { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshesByFace[mountingFace], Color.White, null, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, mountingFace, 1f, Vector2.Zero, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { Color sideColor; Color color = sideColor = BlockColorsMap.WaterColorsMap.Lookup(generator.Terrain, x, y, z); sideColor.A = byte.MaxValue; Color topColor = color; topColor.A = 0; GenerateFluidTerrainVertices(generator, value, x, y, z, sideColor, topColor, geometry.TransparentSubsetsByFace); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { generator.GenerateCubeVertices(this, value, x, y, z, 0.125f, 0.125f, 0.125f, 0.125f, Color.White, Color.White, Color.White, Color.White, Color.White, -1, geometry.OpaqueSubsetsByFace); }
public abstract void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z);
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value); if (num < m_matricesByData.Length) { int num2 = (generator.SubsystemMetersBlockBehavior != null) ? generator.SubsystemMetersBlockBehavior.GetThermometerReading(x, y, z) : 8; float y2 = MathUtils.Lerp(1f, 4f, (float)num2 / 15f); Matrix matrix = m_matricesByData[num]; Matrix value2 = Matrix.CreateTranslation(0f, 0f - m_fluidBottomPosition, 0f) * Matrix.CreateScale(1f, y2, 1f) * Matrix.CreateTranslation(0f, m_fluidBottomPosition, 0f) * matrix; generator.GenerateMeshVertices(this, x, y, z, m_caseMesh, Color.White, matrix, geometry.SubsetOpaque); generator.GenerateMeshVertices(this, x, y, z, m_fluidMesh, Color.White, value2, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, num & 3, 0.2f, Vector2.Zero, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value); if (num < m_blockMeshesByData.Length) { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshesByData[num], Color.White, null, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, GetFace(value), 0.125f, Vector2.Zero, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int num = GetIsTop(data) ? 1 : 0; int?color = GetColor(data); if (color.HasValue) { generator.GenerateShadedMeshVertices(this, x, y, z, m_coloredBlockMeshes[num], SubsystemPalette.GetColor(generator, color), null, null, geometry.SubsetOpaque); } else { generator.GenerateShadedMeshVertices(this, x, y, z, m_uncoloredBlockMeshes[num], Color.White, null, null, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { generator.GenerateCrossfaceVertices(this, value, x, y, z, Color.White, GetFaceTextureSlot(0, value), geometry.SubsetAlphaTest); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value); if (IsBottomPart(generator.Terrain, x, y, z) && num < m_blockMeshesByData.Length) { generator.GenerateMeshVertices(this, x, y, z, m_blockMeshesByData[num], Color.White, null, geometry.SubsetAlphaTest); } Vector2 centerOffset = GetRightHanded(num) ? new Vector2(-0.45f, 0f) : new Vector2(0.45f, 0f); generator.GenerateWireVertices(value, x, y, z, GetHingeFace(num), 0.01f, centerOffset, geometry.SubsetOpaque); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value); if (num < m_matricesByData.Length) { int humidity = generator.Terrain.GetHumidity(x, z); float radians = MathUtils.Lerp(1.5f, -1.5f, (float)humidity / 15f); Matrix matrix = m_matricesByData[num]; Matrix value2 = m_invPointerMatrix * Matrix.CreateRotationX(radians) * m_pointerMatrix * matrix; generator.GenerateMeshVertices(this, x, y, z, m_caseMesh, Color.White, matrix, geometry.SubsetOpaque); generator.GenerateMeshVertices(this, x, y, z, m_pointerMesh, Color.White, value2, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, num & 3, 0.25f, Vector2.Zero, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int num = Terrain.ExtractData(value); if (num < m_collisionBoxesByData.Length) { generator.GenerateMeshVertices(this, x, y, z, m_meshesByData[num], Color.White, null, geometry.SubsetOpaque); } }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { generator.GenerateMeshVertices(this, x, y, z, m_blockMesh, Color.White, null, geometry.SubsetOpaque); generator.GenerateWireVertices(value, x, y, z, 4, 0.25f, Vector2.Zero, geometry.SubsetOpaque); }
public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) { int data = Terrain.ExtractData(value); int face = BottomSuckerBlock.GetFace(data); int subvariant = BottomSuckerBlock.GetSubvariant(data); Color color = m_colors[subvariant]; generator.GenerateMeshVertices(this, x, y, z, m_blockMeshes[4 * face + subvariant], color, null, geometry.SubsetOpaque); base.GenerateTerrainVertices(generator, geometry, value, x, y, z); }