aboutsummaryrefslogtreecommitdiffstats
path: root/Samples/OculusWorldDemo/OculusWorldDemo.h
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2014-07-24 16:47:31 -0700
committerBrad Davis <[email protected]>2014-07-24 16:47:31 -0700
commit0f49ce8fc6aa54224e4c0d6fda8c4527ad39cce1 (patch)
treeda07ebc6a7f75185bda857dd5f1c34710b416a93 /Samples/OculusWorldDemo/OculusWorldDemo.h
parentca79271759ff7eecd22ec5c4db438370fe51d687 (diff)
0.4 Win-Beta0.4.0
Diffstat (limited to 'Samples/OculusWorldDemo/OculusWorldDemo.h')
-rw-r--r--Samples/OculusWorldDemo/OculusWorldDemo.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/Samples/OculusWorldDemo/OculusWorldDemo.h b/Samples/OculusWorldDemo/OculusWorldDemo.h
index 049ac94..38843df 100644
--- a/Samples/OculusWorldDemo/OculusWorldDemo.h
+++ b/Samples/OculusWorldDemo/OculusWorldDemo.h
@@ -25,7 +25,7 @@ limitations under the License.
#ifndef INC_OculusWorldDemo_h
#define INC_OculusWorldDemo_h
-#include "OVR.h"
+#include "OVR_Kernel.h"
#include "../CommonSrc/Platform/Platform_Default.h"
#include "../CommonSrc/Render/Render_Device.h"
@@ -37,12 +37,9 @@ limitations under the License.
#include "Util/Util_Render_Stereo.h"
using namespace OVR::Util::Render;
-#include <Kernel/OVR_SysFile.h>
-#include <Kernel/OVR_Log.h>
-#include <Kernel/OVR_Timer.h>
#include "Player.h"
-#include "OVR_DeviceConstants.h"
+#include "Sensors/OVR_DeviceConstants.h"
// Filename to be loaded by default, searching specified paths.
#define WORLDDEMO_ASSET_FILE "Tuscany.xml"
@@ -53,7 +50,7 @@ using namespace OVR::Util::Render;
#define WORLDDEMO_ASSET_PATH3 "Samples/OculusWorldDemo/Assets/Tuscany/"
using namespace OVR;
-using namespace OVR::Platform;
+using namespace OVR::OvrPlatform;
using namespace OVR::Render;
@@ -132,7 +129,7 @@ public:
void RenderAnimatedBlocks(ovrEyeType eye, double appTime);
void RenderGrid(ovrEyeType eye);
- Matrix4f CalculateViewFromPose(const Transformf& pose);
+ Matrix4f CalculateViewFromPose(const Posef& pose);
// Determine whether this frame needs rendering based on timewarp timing and flags.
bool FrameNeedsRendering(double curtime);
@@ -154,14 +151,19 @@ public:
// These contain extra actions to be taken in addition to switching the state.
void HmdSettingChange(OptionVar* = 0) { HmdSettingsChanged = true; }
+ void MirrorSettingChange(OptionVar* = 0)
+ { HmdSettingsChanged = true; NotificationTimeout = ovr_GetTimeInSeconds() + 10.0f;}
+
void BlockShowChange(OptionVar* = 0) { BlocksCenter = ThePlayer.BodyPos; }
- void EyeHeightChange(OptionVar* = 0) { ThePlayer.BodyPos.y = ThePlayer.UserEyeHeight; }
+ void EyeHeightChange(OptionVar* = 0) { ThePlayer.BodyPos.y = ThePlayer.UserEyeHeight; }
+ void HmdSensorToggle(OptionVar* = 0);
void HmdSettingChangeFreeRTs(OptionVar* = 0);
void MultisampleChange(OptionVar* = 0);
void CenterPupilDepthChange(OptionVar* = 0);
void DistortionClearColorChange(OptionVar* = 0);
+ void ResetHmdPose(OptionVar* = 0);
protected:
RenderDevice* pRender;
@@ -188,19 +190,20 @@ protected:
// ***** Oculus HMD Variables
ovrHmd Hmd;
- ovrHmdDesc HmdDesc;
ovrEyeRenderDesc EyeRenderDesc[2];
Matrix4f Projection[2]; // Projection matrix for eye.
Matrix4f OrthoProjection[2]; // Projection for 2D.
+ ovrPosef EyeRenderPose[2]; // Poses we used for rendering.
ovrTexture EyeTexture[2];
Sizei EyeRenderSize[2]; // Saved render eye sizes; base for dynamic sizing.
// Sensor caps applied.
- unsigned StartSensorCaps;
+ unsigned StartTrackingCaps;
bool UsingDebugHmd;
// Frame timing logic.
enum { SecondsOfFpsMeasurement = 1 };
int FrameCounter;
+ int TotalFrameCounter;
double NextFPSUpdate;
float SecondsPerFrame;
float FPS;
@@ -223,8 +226,10 @@ protected:
LoadingState_Finished
} LoadingState;
- // Set when vision tracking is detected.
+ // Current status flags so that edges can be reported
bool HaveVisionTracking;
+ bool HavePositionTracker;
+ bool HaveHMDConnected;
GamepadState LastGamepadState;
@@ -242,6 +247,8 @@ protected:
ovrFrameTiming HmdFrameTiming;
unsigned HmdStatus;
+ // Overlay notifications time out in
+ double NotificationTimeout;
// ***** Modifiable Menu Options
@@ -251,12 +258,14 @@ protected:
// Render Target - affecting state.
bool RendertargetIsSharedByBothEyes;
bool DynamicRezScalingEnabled;
+ bool EnableSensor;
bool ForceZeroIpd;
float DesiredPixelDensity;
float FovSideTanMax;
float FovSideTanLimit; // Limit value for Fov.
// Time-warp.
bool TimewarpEnabled;
+ bool TimewarpNoJitEnabled;
float TimewarpRenderIntervalInSeconds;
bool FreezeEyeUpdate;
bool FreezeEyeOneFrameRendered;
@@ -270,7 +279,10 @@ protected:
// DK2 only
bool IsLowPersistence;
bool DynamicPrediction;
+ bool DisplaySleep;
bool PositionTrackingEnabled;
+ bool PixelLuminanceOverdrive;
+ bool MirrorToWindow;
// Support toggling background color for distortion so that we can see
// the effect on the periphery.