Beispiel #1
0
        public EditRecordedForm(Principal pM)
            : base(pM)
        {
            mySkeleton = new HumanSkeleton();
            path       = Environment.CurrentDirectory + "\\Data\\Animation\\default.ani";

            //Para simular el inicio del dispositivo desde un archivo.
            myMiddle = new SkeletonReaderMiddle();
            myMiddle.addUser(mySkeleton, path);

            ready = false;

            //--Render
            myAvatar = new Avatar(mySkeleton);
            camara   = new Camera(pM.graphics);

            //--Estados
            myStates = DB4ObjectState.loadStates(Environment.CurrentDirectory + "\\Data\\States\\default.sta");

            //--Gestos
            myGestures        = DB4ObjectGesture.loadGestures(Environment.CurrentDirectory + "\\Data\\Gestures\\default.ges");
            myPartialGestures = new List <Pair>();

            //Crear formulario de edición de gestos
            formEditor = new WFEditGestures(this);
            formEditor.Show();

            this.LoadContent();
        }
Beispiel #2
0
 internal void reloadAnimation()
 {
     myMiddle = new SkeletonReaderMiddle();
     myMiddle.addUser(mySkeleton, path);
     myMiddle.update();
     formEditor.UpdateGrid();
 }
Beispiel #3
0
        private void escucharTeclado()
        {
            Vector3 cambioCamara = Vector3.Zero;
            Vector3 rotCamara    = Vector3.Zero;
            float   camSpeed     = 0.10f;
            float   rotSpeed     = 1.0f;

            //Movimiento de cámara
            if (Keyboard.GetState().IsKeyDown(Keys.S))
            {
                cambioCamara.Z += camSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.W))
            {
                cambioCamara.Z -= camSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.A))
            {
                cambioCamara.X -= camSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.D))
            {
                cambioCamara.X += camSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                rotCamara.X += rotSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                rotCamara.X -= rotSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                rotCamara.Y -= rotSpeed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                rotCamara.Y += rotSpeed;
            }

            //Recarga la animación
            if (Keyboard.GetState().IsKeyDown(Keys.R))
            {
                myMiddle = new SkeletonReaderMiddle();
                myMiddle.addUser(mySkeleton, path);
            }


            this.camara.cameraRot      += rotCamara;
            this.camara.cameraPosition += cambioCamara;
            this.camara.cameraLookAt   += cambioCamara;
            this.camara.updateCam();

            /*this.camara.cameraPosition += cambioCamara + rotCamara;
             * this.camara.cameraLookAt += cambioCamara;
             * this.camara.updateCam();*/
        }
 public void loadAnimation(string path)
 {
     myMiddleTeacher = new SkeletonReaderMiddle();
     myMiddleTeacher.addUser(mySkeletonTeacher, path);
 }