public listBoxForm(ParameterSet ps, Actor a, Manipulator m, MainForm ma)
        {
            InitializeComponent();
            int index = 0;

            selectedActor = a;
            parms = ps;
            man = m;
            main = ma;
            if (man != null)
                man.enableRayCast = false;

            if (selectedActor.Name.Contains("Trigger"))
                triggerFlag = true;

            string agents = "";
            if (selectedActor.Parm.HasParm("Agents"))
                agents = selectedActor.Parm.GetString("Agents");

            foreach (KeyValuePair<string, string> s in ps)
            {
                if (index++ != 0)
                {
                    this.listBox.Items.Add(s.Key);
                    foreach (string str in agents.Split(','))
                    {
                        if (str == s.Key)
                            listBox.SelectedIndices.Add(index - 2);
                    }
                }
            }
        }
        public void Stop()
        {
            if (playState != PlayState.Stopped)
            {
                // stop game
                playState = PlayState.Stopped;
                PhysicsObject.ForceStaticMesh = true;
                PhysicsObject.DisableMass = true;

                // reload world
                Stage.EditorReloadStage();

                activeManipulator = new Manipulator();
                activeManipulator.Initialize(content, GraphicsDevice);

                //stop the theme song cause that is annoying
                AudioQB aQB = Stage.ActiveStage.GetQB<AudioQB>();
                aQB.PauseTheme();

                // set to freecam
                CameraQB cameraQB = Stage.ActiveStage.GetQB<CameraQB>();
                cameraQB.StartFreeCam();
            }
        }
 public void StartRotate()
 {
     if (playState == PlayState.Stopped)
     {
         Actor selectedActor = null;
         if (activeManipulator != null)
             selectedActor = activeManipulator.selectedActor;
         activeManipulator = new RotateManipulator();
         ((RotateManipulator)activeManipulator).modelDrawer = new BEPUphysicsDrawer.Models.InstancedModelDrawer(GraphicsDevice, Services);
         activeManipulator.Initialize(content, GraphicsDevice);
         activeManipulator.selectedActor = selectedActor;
     }
 }
        public void Start()
        {
            if (playState != PlayState.Playing)
            {
                activeManipulator = null;

                if (playState == PlayState.Stopped)
                {
                    mf.PropertiesPanel.Controls.Clear();
                    PhysicsObject.DisableMass = false;
                    PhysicsObject.ForceStaticMesh = false;

                    // save then load stage
                    //SaveStage(worldFile); //uncomment this line if we want to save to file everytime we start a level in the editor
                    reloadStage();
                    Stage.EditorLoadStage(parms);
                }
                else
                {
                    CameraQB cameraQB = Stage.ActiveStage.GetQB<CameraQB>();
                    cameraQB.EndFreeCam();
                }

                // start game
                playState = PlayState.Playing;

            }
        }
        public void Pause()
        {
            if (playState == PlayState.Playing)
            {
                // pause game
                playState = PlayState.Paused;

                activeManipulator = new Manipulator();
                activeManipulator.Initialize(content, GraphicsDevice);

                // push the freecam
                CameraQB cameraQB = Stage.ActiveStage.GetQB<CameraQB>();
                cameraQB.StartFreeCam();
            }
        }
        public void LoadStage(string filename)
        {
            Stop();
            activeManipulator = null;
            worldFile = filename;
            parms = ParameterSet.FromFile(worldFile);
            GameLib.Stage.EditorLoadStage(parms);
            //stop the theme song cause that is annoying
            AudioQB aQB = Stage.ActiveStage.GetQB<AudioQB>();
            aQB.PauseTheme();

            activeManipulator = new Manipulator();
            activeManipulator.Initialize(content, GraphicsDevice);
            Stage.ActiveStage.GetQB<CameraQB>().StartFreeCam();
        }