public void TestRoom()
        {
            var engine = EngineFactory.CreateEngine();

            engine.Initialize();

            var grid = new VoxelGrid <bool>(new Point3(50, 40, 50));

            var room = new BoundingBox(new Vector3(20, 20, 20), new Vector3(30, 30, 30));


            var gen = new SimpleCaveGenerator();

            gen.Rand = new Random();
            gen.GenerateRandom(grid, 0.30f);

            gen.CreateRoom(grid, room);

            for (int i = 0; i < 5; i++)
            {
                gen.ProcessCellularAutomata(grid);
            }

            new VoxelTerrainConvertor().SetTerrain(grid.ToArray());

            engine.AddSimulator(new FlashlightSimulator());
            engine.AddSimulator(new VoxelTerrainSimulator());
            engine.AddSimulator(new WorldRenderingSimulator());
            engine.Run();
        }
Beispiel #2
0
 public BoundingBox(Vector3 minimum, Vector3 maximum)
 {
     box = new SlimDX.BoundingBox(minimum, maximum);
 }
Beispiel #3
0
 public BoundingBox(Vector3[] points)
 {
     box = SlimDX.BoundingBox.FromPoints(points);
 }
Beispiel #4
0
 public BoundingBox()
 {
     box = new SlimDX.BoundingBox();
 }