/**
         * Prepares OpenGL ES before we draw a frame.
         */
        public void OnNewFrame(HeadTransform headTransform)
        {
            SetCubeRotation();

            // Build the camera matrix and apply it to the ModelView.
            Matrix.SetLookAtM(camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

            headTransform.GetHeadView(headView, 0);

            // Update the 3d audio engine with the most recent head rotation.
            headTransform.GetQuaternion(headRotation, 0);
            gvrAudioEngine.SetHeadRotation(
                headRotation [0], headRotation [1], headRotation [2], headRotation [3]);

            // Regular update call to GVR audio engine.
            gvrAudioEngine.Update();

            CheckGLError("onReadyToDraw");
        }
Ejemplo n.º 2
0
        public void OnNewFrame(HeadTransform headTransform)
        {
            GLES20.GlUseProgram(glProgram);

            modelViewProjectionParam = GLES20.GlGetUniformLocation(glProgram, "u_MVP");
            lightPosParam            = GLES20.GlGetUniformLocation(glProgram, "u_LightPos");
            modelViewParam           = GLES20.GlGetUniformLocation(glProgram, "u_MVMatrix");
            modelParam   = GLES20.GlGetUniformLocation(glProgram, "u_Model");
            isFloorParam = GLES20.GlGetUniformLocation(glProgram, "u_IsFloor");
            texture      = GLES20.GlGetUniformLocation(glProgram, "u_texture");

            // Build the Model part of the ModelView matrix.
            Matrix.RotateM(modelCube, 0, TimeDelta, 0.5f, 0.5f, 1.0f);

            // Build the camera matrix and apply it to the ModelView.
            Matrix.SetLookAtM(camera, 0, 0.0f, 0.0f, CameraZ, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

            headTransform.GetHeadView(headView, 0);

            CheckGlError("onReadyToDraw");
        }
        /**
         * Prepares OpenGL ES before we draw a frame.
         */
        public void OnNewFrame (HeadTransform headTransform)
        {
            SetCubeRotation ();

            // Build the camera matrix and apply it to the ModelView.
            Matrix.SetLookAtM (camera, 0, 0.0f, 0.0f, CAMERA_Z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

            headTransform.GetHeadView (headView, 0);

            // Update the 3d audio engine with the most recent head rotation.
            headTransform.GetQuaternion (headRotation, 0);
            gvrAudioEngine.SetHeadRotation (
                headRotation [0], headRotation [1], headRotation [2], headRotation [3]);
            
            // Regular update call to GVR audio engine.
            gvrAudioEngine.Update ();

            CheckGLError ("onReadyToDraw");
        }
Ejemplo n.º 4
0
 public void OnNewFrame(HeadTransform headTransform)
 {
     headTransform.GetHeadView(headView, 0);
     game.PrepareFrame();
 }
Ejemplo n.º 5
0
		public void OnNewFrame (HeadTransform headTransform)
		{
			headTransform.GetHeadView (headView, 0);
			game.PrepareFrame ();
		}