ResetYaw() public method

public ResetYaw ( ) : void
return void
コード例 #1
0
        protected override void Initialize()
        {
            base.Initialize();

            if (UsePsMove)
            {
                var manager = new PSMoveManager();
                manager.Initialize();
                ToDispose(manager);
                PsMoveController = new PSMoveController(Vector3.Zero);
                ToDispose(PsMoveController);
                PsMoveController.OnButtonSelectPressed += (sender, args) => PsMoveController.ResetYaw();
                PsMoveController.OnButtonStartPressed  += (sender, args) => PsMoveController.ResetYaw();
            }
            eyeTexture[0] = hmd.CreateSwapTexture(GraphicsDevice, Format.B8G8R8A8_UNorm,
                                                  hmd.GetFovTextureSize(EyeType.Left, hmd.DefaultEyeFov[0]), true);
            eyeTexture[1] = hmd.CreateSwapTexture(GraphicsDevice, Format.B8G8R8A8_UNorm,
                                                  hmd.GetFovTextureSize(EyeType.Right, hmd.DefaultEyeFov[1]), true);
            ToDispose(eyeTexture[0]);
            ToDispose(eyeTexture[1]);

            // Create our layer
            layerEyeFov = new LayerEyeFov
            {
                Header            = new LayerHeader(LayerType.EyeFov, LayerFlags.None),
                ColorTextureLeft  = eyeTexture[0].TextureSet,
                ColorTextureRight = eyeTexture[1].TextureSet,
                ViewportLeft      = new Rect(0, 0, eyeTexture[0].Size.Width, eyeTexture[0].Size.Height),
                ViewportRight     = new Rect(0, 0, eyeTexture[1].Size.Width, eyeTexture[1].Size.Height),
                FovLeft           = hmd.DefaultEyeFov[0],
                FovRight          = hmd.DefaultEyeFov[1],
            };

            // Keep eye view offsets
            eyeRenderDesc[0]      = hmd.GetRenderDesc(EyeType.Left, hmd.DefaultEyeFov[0]);
            eyeRenderDesc[1]      = hmd.GetRenderDesc(EyeType.Right, hmd.DefaultEyeFov[1]);
            hmdToEyeViewOffset[0] = eyeRenderDesc[0].HmdToEyeViewOffset;
            hmdToEyeViewOffset[1] = eyeRenderDesc[1].HmdToEyeViewOffset;

            // Create a mirror texture
            mirrorTexture = hmd.CreateMirrorTexture(GraphicsDevice, GraphicsDevice.BackBuffer.Description);

            // Set presentation interval to immediate as SubmitFrame will be taking care of VSync
            GraphicsDevice.Presenter.PresentInterval = PresentInterval.Immediate;

            // Configure tracking
            hmd.ConfigureTracking(
                TrackingCapabilities.Orientation | TrackingCapabilities.Position |
                TrackingCapabilities.MagYawCorrection,
                TrackingCapabilities.None);

            // Set enabled capabilities
            hmd.EnabledCaps = HMDCapabilities.LowPersistence | HMDCapabilities.DynamicPrediction;
        }
コード例 #2
0
ファイル: PSMoveTest.cs プロジェクト: x9046/psmove-unity5
 void move_OnButtonMovePressed(object sender, EventArgs e)
 {
     Debug.Log("Move button pressed");
     moveComponent.ResetYaw();
 }