コード例 #1
0
 public void SetupCamera(WorldDimensions WD)
 {
     float maxDim;
     if (WD.xdim > WD.zdim)
     {
         maxDim = WD.xdim * 1.25f;
     }
     else
     {
         maxDim = WD.zdim * 1.25f;
     }
     // Set up initial view
     CameraView view = new CameraView();
     view.EyePosition = new Vector3(WD.xdim / 2f, maxDim, -(WD.zdim / 2f));
     view.LookAtPoint = new Vector3(WD.xdim / 2f, maxDim - 2f, -(WD.zdim / 2f));
     //view.EyePosition = new Vector3(-1.65f, 1.63f, -0.29f);
     //view.LookAtPoint = new Vector3(-0.68f, 1.38f, -0.18f);
     SimulationEngine.GlobalInstancePort.Update(view);
 }
コード例 #2
0
ファイル: WorldPair.cs プロジェクト: SamirBanna/cs266-simcon
 public WorldPair(WorldDimensions WD, WorldState WS)
 {
     this.WD = WD;
     this.WS = WS;
 }
コード例 #3
0
        //NEW!!!!!! Changed!
        public void PopulateWorld(WorldDimensions WD, WorldState World, GenAlgorithm Algo)
        {
            // Orient sim camera view point
            this.SetupCamera(WD);

            AddSky();
            AddGround(Algo.GridSquareSize);
            AddBoundaries(WD.xdim, WD.zdim);

            for (int i = 0; i < World.objects.Count; i++)
            {
                if (World.objects[i].type == "obstacle")
                {
                    AddObstacle(World.objects[i].dimension, World.objects[i].position, World.objects[i].name);
                }
                else if (World.objects[i].type == "robot")
                {
                    this.RobotList.Add(AddRobot(World.objects[i]));
                }
                else if (World.objects[i].type == "food")
                {
                    AddFood(World.objects[i].position, World.objects[i].name);
                }
            }
        }