Ejemplo n.º 1
0
        public void RespectNeighborChunks()
        {
            // Arrange
            ChunkProperties.SetBlock(Pos(-1, 0, 0), NormalBlock);
            ChunkProperties.SetBlock(Pos(0, 0, 0), NormalBlock);

            // Act
            var task = new VisualRemeshTask(ChunkProperties, 0);
            var mesh = task.Finish();

            // Assert
            Assert.AreEqual(20, mesh.Vertices.Count);
            Assert.AreEqual(20, mesh.Normals.Count);
            Assert.AreEqual(20, mesh.UVs.Count);
            Assert.AreEqual(30, mesh.Triangles.Count);
        }
Ejemplo n.º 2
0
        public void BlockFace_DifferentAtlas_IgnoreQuads()
        {
            // Arrange
            ChunkProperties.SetBlock(Pos(0, 0, 0), NormalBlock);
            ChunkProperties.SetBlock(Pos(1, 1, 1), DifferentMaterialBlock);

            // Act
            var task = new VisualRemeshTask(ChunkProperties, 0);
            var mesh = task.Finish();

            // Assert
            Assert.AreEqual(24, mesh.Vertices.Count);
            Assert.AreEqual(24, mesh.Normals.Count);
            Assert.AreEqual(24, mesh.UVs.Count);
            Assert.AreEqual(36, mesh.Triangles.Count);
        }
Ejemplo n.º 3
0
        public void TwoCubes()
        {
            // Arrange
            ChunkProperties.SetBlock(Pos(0, 0, 0), NormalBlock);
            ChunkProperties.SetBlock(Pos(0, 1, 0), NormalBlock);

            // Act
            var task = new VisualRemeshTask(ChunkProperties, 0);
            var mesh = task.Finish();

            // Assert
            Assert.AreEqual(24, mesh.Vertices.Count);
            Assert.AreEqual(24, mesh.Normals.Count);
            Assert.AreEqual(24, mesh.UVs.Count);
            Assert.AreEqual(36, mesh.Triangles.Count);
        }