Beispiel #1
0
        public void ShapeOperationsOverlapping(ShapeOperation operation)
        {
            var result = RunMemoryTest("", () =>
            {
                var shape1 = new Cylinder(new Vector3(0, 0, 0), new Vector3(0, 1, 0));
                var shape2 = new Cylinder(new Vector3(0, 0, 0), new Vector3(0, 1, 0));
                return(shape1.Do(operation, shape2));
            });

            if (operation == ShapeOperation.Subtract)
            {
                Assert.True(result.Cache.Vertices.Length == 0);
                Assert.True(result.Cache.Indices.Length == 0);
            }
            else
            {
                Assert.True(result.Cache.Vertices.Length > 0);
                Assert.True(result.Cache.Indices.Length > 0);
            }

            output.WriteLine($"Result Cache: {result.Cache.ToString()}");
        }