Exemple #1
0
 /// <summary>
 /// Release the objects
 /// </summary>
 /// <param name="ipk"></param>
 private void releaseObjects(InputPlayableKeyBoard ipk)
 {
     foreach (var item in objects)
     {
         item.PhysicObject.isMotionLess = false;
     }
 }
Exemple #2
0
        /// <summary>
        /// y
        /// </summary>
        /// <param name="ipk"></param>
        private void Load(InputPlayableKeyBoard ipk)
        {
            if (this.World.CameraManager.ActiveCamera is CameraFollowPath)
            {
                if (!(this.World.CameraManager.ActiveCamera as CameraFollowPath).Ended)
                {
                    return;
                }
            }
            else if (isRecording == true)
            {
                return;
            }

            ///Carrega um caminho de um arquivo e seta uma camera para segui-lo
            CameraPathData pd = record.LoadCurveFile("teste.bin");


            CameraFollowPath fcp = new CameraFollowPath(pd, this.World, "stdCam");

            fcp.OnLoop = false;
            this.World.CameraManager.AddCamera(fcp, "follow");
            this.World.CameraManager.SetActiveCamera("follow");
            fcp.OnPathEnded += new OnPathEnded(fcp_OnPathEnded);

            isStopped = false;
            isLoading = true;
        }
 void ik_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     if (ssao.Enabled)
     {
         ssao.OutputONLYSSAOMAP = !ssao.OutputONLYSSAOMAP;
     }
 }
Exemple #4
0
 void ipk_KeyStateChange2(InputPlayableKeyBoard ipk)
 {
     if (wh.CurrentWaypointsCollection.State == WaypointsState.Connected)
     {
         wh.SaveConnectedWaypoints("waypoints.xml");
         saved = true;
     }
 }
Exemple #5
0
        /// <summary>
        /// Binds the KeyBoard input.
        /// </summary>
        /// <param name="ipk">The InputPlayableKeyBoard.</param>
        public void BindInput(InputPlayableKeyBoard ipk)
        {
            System.Diagnostics.Debug.Assert(ipk != null);
            BindKeyCommand bkc = new BindKeyCommand(ipk, BindAction.ADD);

            KeyBinds.Add(ipk, bkc);
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc);
        }
Exemple #6
0
 public void specularChange(InputPlayableKeyBoard ipk)
 {
     foreach (var item in withSpecular)
     {
         DeferredCustomShader shader = item.Material.Shader as DeferredCustomShader;
         System.Diagnostics.Debug.Assert(shader != null);
         shader.UseSpecular = !shader.UseSpecular;
         specular           = shader.UseSpecular;
     }
 }
Exemple #7
0
 public void bumpChange(InputPlayableKeyBoard ipk)
 {
     foreach (var item in withBump)
     {
         DeferredCustomShader shader = item.Material.Shader as DeferredCustomShader;
         System.Diagnostics.Debug.Assert(shader != null);
         shader.UseBump = !shader.UseBump;
         bump           = shader.UseBump;
     }
 }
Exemple #8
0
        /// <summary>
        /// Removes the KeyBoard binding.
        /// </summary>
        /// <param name="ipk">The InputPlayableKeyBoard.</param>
        public void RemoveInputBinding(InputPlayableKeyBoard ipk)
        {
            System.Diagnostics.Debug.Assert(ipk != null);
            BindKeyCommand bc = KeyBinds[ipk];

            if (bc != null)
            {
                bc.BindAction = BindAction.REMOVE;
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bc);
            }
        }
Exemple #9
0
 void ipk_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     if (wh.CurrentWaypointsCollection.State == WaypointsState.UnConnected)
     {
         List <Waypoint> waypointsList = wh.CurrentWaypointsCollection.GetWaypointsList();
         if (waypointsList.Count > 0)
         {
             VisibilityWaypointConnector VisibilityWaypointConnector = new VisibilityWaypointConnector(this.World);
             wh.ConnectWaypoints(VisibilityWaypointConnector);
         }
     }
 }
 public void ChangeCamera(InputPlayableKeyBoard ipk)
 {
     if (shouldDraw)
     {
         shouldDraw = false;
     }
     else
     {
         shouldDraw = true;
     }
     camerasNames.Next();
     this.World.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);
 }
Exemple #11
0
        /// <summary>
        /// Ao PRESSIONAR R
        /// </summary>
        /// <param name="ipk"></param>
        private void Start(InputPlayableKeyBoard ipk)
        {
            if (isRecording || this.World.CameraManager.ActiveCamera is CameraFollowPath)
            {
                return;
            }

            ///Comeca a gravar
            record.StartRecord();

            isFinished  = false;
            isRecording = true;
        }
        void sc_KeyStateChange(InputPlayableKeyBoard ipk)
        {
            SpriteAnimated sa = sheet.Modelo as SpriteAnimated;

            if (sa.GetCurrentAnimation().Name == "ANIM1")
            {
                sa.ChangeAnimation("ANIM2");
            }
            else
            {
                sa.ChangeAnimation("ANIM1");
            }
        }
 public void ChangeDemo(InputPlayableKeyBoard ipk)
 {
     if (this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active)
     {
         this.ScreenState = ScreenState.Hidden;
     }
     if (active != null)
     {
         ScreenManager.RemoveScreen(active);
     }
     active = GetScreen(screenList[index % screenList.GetLength(0)]);
     ScreenManager.AddScreen(active);
     index++;
 }
Exemple #14
0
        /// <summary>
        /// t
        /// </summary>
        /// <param name="ipk"></param>
        private void Stop(InputPlayableKeyBoard ipk)
        {
            if ((this.World.CameraManager.ActiveCamera is CameraFollowPath) || isRecording == false)
            {
                return;
            }

            record.StopRecord();
            record.SaveCurveToFile("teste.bin");

            this.World.CameraManager.SetActiveCamera("stdCam");

            isRecording = false;
            isStopped   = true;
        }
        /// <summary>
        /// Chamada qd Espaco for pressionado
        /// </summary>
        /// <param name="ipk"></param>
        void KeyStateChange(InputPlayableKeyBoard ipk)
        {
            ///TO CHANGE ONLY IN THE END OF THE INTERPOLATION
            //if (mundo.CameraManager.ActiveCameraType != State.INTERPOLATING)
            //{
            //camerasNames.Next();
            //mundo.CameraManager.SetActiveCamera(camerasNames.Value,InterpolationType.BYSTEP, 0.005f);
            //mundo.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);
            //}

            ///Avanca o ponteiro da lista circular
            camerasNames.Next();
            ///Ativa a camera correspondente
            ///Existem dois interpoladores, Por tempo (demora um tempo fixo independententemente da distancia)
            ///e um Por Etapa, que tem uma velocidade fixa de movimentacao (independente de quanto tempo for levar)
            this.World.CameraManager.SetActiveCamera(camerasNames.Value, InterpolationType.BYTIME, 3);
        }
        void key_KeyStateChange2(InputPlayableKeyBoard ipk)
        {
            NetWorkEchoMessageClient c = new NetWorkEchoMessageClient("teste",
                                                                      (mes) =>
            {
                mes.Write("TESTE");
                return(mes);
            }
                                                                      ,
                                                                      (mes) =>
            {
                ///server will change the message =P (just  a test ...)
                Debug.Assert(mes.ReadString() == "TESTE123");
            }
                                                                      );

            client.AddNetWorkEchoMessage(c, true);
        }
        public void ChangeGroup(InputPlayableKeyBoard ipk)
        {
            index = (index + 1) % 3;

            ///Turn Off all Masks (we cant turn the GSYSTEM MASK, even if we try ....)
            TurnOffInputMaskCommand tof = new TurnOffInputMaskCommand(InputMask.GALL);

            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(tof);

            ///Turn only the right mask
            ///Masks are Bit Field, You can turn more than one using InputMask.GALL | InputMask.G1 for example
            ///The TurnOnInputMaskCommand Just combine its actual mask with the mask provided, It does not TURN OFFthe active masks (this is the reason why i sent a turn off mask before)
            TurnOnInputMaskCommand tom = new TurnOnInputMaskCommand(Im[index] | InputMask.GNONE);

            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(tom);

            isAllActive    = false;
            isGroup1       = false;
            isGroup2       = false;
            isComboPressed = false;
            isChangeGroup  = true;
        }
        void key_KeyStateChange(InputPlayableKeyBoard ipk)
        {
            NetWorkClientObject no = new NetWorkClientObject("simpleball",

                                                             (mes) =>
            {
                mes.WriteSphere(new Vector3(50, 50, 10), 1, 1, 10, MaterialDescription.DefaultBepuMaterial());
                return(mes);
            },
                                                             (mes, id) =>
            {
                SimpleModel simpleModel     = new SimpleModel(this.GraphicFactory, "Model//ball");
                SphereObject sphere         = mes.ReadSphere();
                DeferredNormalShader shader = new DeferredNormalShader();
                DeferredMaterial fmaterial  = new DeferredMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, sphere);
                obj.SetId(id);
                return(obj);
            }
                                                             );

            client.CreateNetWorkObject(no);
        }
        public void ChangeDemo(InputPlayableKeyBoard ipk)
        {
            ///lazy ways of cycling between demos
            ///just remove everything and load the righ screen

            if (active is LoadingScreen || (active != null && active.IsLoaded == false))
            {
                return;
            }

            //if(this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active)
            //    this.ScreenState = ScreenState.Hidden;


            foreach (var item in ScreenManager.GetScreens())
            {
                ScreenManager.RemoveScreen(item);
            }


            active = GetScreen(screenList[index % screenList.GetLength(0)]);
            ScreenManager.AddScreen(active, new LoadingScreen());
            index++;
        }
 public void aumentaBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y + 0.001f);
 }
 public void Active(InputPlayableKeyBoard ipk)
 {
     ssao.Enabled = !ssao.Enabled;
 }
Exemple #22
0
 void GameMenu(InputPlayableKeyBoard ipk)
 {
     EngineSettings.freeMouse = !EngineSettings.freeMouse;
 }
Exemple #23
0
 void Save(InputPlayableKeyBoard ipk)
 {
     Saver.Save();
 }
 public void LeaveGame(InputPlayableKeyBoard ipk)
 {
     engine.Exit();
 }
 public void Multiple(InputPlayableKeyBoard ipk)
 {
     isGroup1       = false;
     isGroup2       = false;
     isComboPressed = true;
 }
 public void g2(InputPlayableKeyBoard ipk)
 {
     isGroup1       = false;
     isComboPressed = false;
     isGroup2       = true;
 }
 public void EnableDisableBump(InputPlayableKeyBoard ipk)
 {
     paralax.UseBump = !paralax.UseBump;
 }
 public void EnableDisableParalax(InputPlayableKeyBoard ipk)
 {
     paralax.UseParalax = !paralax.UseParalax;
 }
 public void diminuiBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y - 0.001f);
 }