Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 void ik_KeyStateChange(InputPlayableKeyBoard ipk)
 {
     if (ssao.Enabled)
     {
         ssao.OutputONLYSSAOMAP = !ssao.OutputONLYSSAOMAP;
     }
 }
Exemplo n.º 4
0
 void ipk_KeyStateChange2(InputPlayableKeyBoard ipk)
 {
     if (wh.CurrentWaypointsCollection.State == WaypointsState.Connected)
     {
         wh.SaveConnectedWaypoints("waypoints.xml");
         saved = true;
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 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;
        }
Exemplo n.º 12
0
        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++;
 }
Exemplo n.º 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;
        }
Exemplo n.º 15
0
        /// <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++;
        }
Exemplo n.º 20
0
 public void aumentaBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y + 0.001f);
 }
Exemplo n.º 21
0
 public void Active(InputPlayableKeyBoard ipk)
 {
     ssao.Enabled = !ssao.Enabled;
 }
Exemplo n.º 22
0
 void GameMenu(InputPlayableKeyBoard ipk)
 {
     EngineSettings.freeMouse = !EngineSettings.freeMouse;
 }
Exemplo n.º 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;
 }
Exemplo n.º 27
0
 public void EnableDisableBump(InputPlayableKeyBoard ipk)
 {
     paralax.UseBump = !paralax.UseBump;
 }
Exemplo n.º 28
0
 public void EnableDisableParalax(InputPlayableKeyBoard ipk)
 {
     paralax.UseParalax = !paralax.UseParalax;
 }
Exemplo n.º 29
0
 public void diminuiBias(InputPlayableKeyBoard ipk)
 {
     paralax.ScaleBias = new Vector2(paralax.ScaleBias.X, paralax.ScaleBias.Y - 0.001f);
 }