Added notes on vr tracking -> camera update
This commit is contained in:
parent
8f60996b64
commit
d5e0f4e84e
16
src/rlgl.c
16
src/rlgl.c
@ -374,7 +374,7 @@ static char *ReadTextFile(const char *fileName); // Read chars array from
|
||||
#if !defined(RLGL_STANDALONE)
|
||||
static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success)
|
||||
static void CloseOculusDevice(void); // Close Oculus device
|
||||
static void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking
|
||||
static void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking
|
||||
static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing
|
||||
static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror
|
||||
#endif
|
||||
@ -2735,15 +2735,11 @@ void ToggleVrMode(void)
|
||||
}
|
||||
|
||||
// Update VR tracking (position and orientation) and camera
|
||||
// NOTE: Camera (position, target, up) gets update with head tracking information
|
||||
void UpdateVrTracking(Camera *camera)
|
||||
{
|
||||
#if defined(RLGL_OCULUS_SUPPORT)
|
||||
if (vrDeviceReady)
|
||||
{
|
||||
UpdateOculusTracking();
|
||||
|
||||
// TODO: Update camera data (position, target, up) with tracking data
|
||||
}
|
||||
if (vrDeviceReady) UpdateOculusTracking(camera);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -4083,7 +4079,7 @@ OCULUSAPI void CloseOculusDevice(void)
|
||||
}
|
||||
|
||||
// Update Oculus head position-orientation tracking
|
||||
OCULUSAPI void UpdateOculusTracking(void)
|
||||
OCULUSAPI void UpdateOculusTracking(Camera *camera)
|
||||
{
|
||||
frameIndex++;
|
||||
|
||||
@ -4093,6 +4089,10 @@ OCULUSAPI void UpdateOculusTracking(void)
|
||||
layer.eyeLayer.RenderPose[0] = eyePoses[0];
|
||||
layer.eyeLayer.RenderPose[1] = eyePoses[1];
|
||||
|
||||
// TODO: Update external camera with eyePoses data (position, orientation)
|
||||
// NOTE: We can simplify to simple camera if we consider IPD and HMD device configuration again later
|
||||
// it will be useful for the user to draw, lets say, billboards oriented to camera
|
||||
|
||||
// Get session status information
|
||||
ovrSessionStatus sessionStatus;
|
||||
ovr_GetSessionStatus(session, &sessionStatus);
|
||||
|
@ -381,7 +381,7 @@ void ToggleVrMode(void); // Enable/Disable VR experience (dev
|
||||
// Oculus Rift API for direct access the device (no simulator)
|
||||
bool InitOculusDevice(void); // Initialize Oculus device (returns true if success)
|
||||
void CloseOculusDevice(void); // Close Oculus device
|
||||
void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking
|
||||
void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking (and camera)
|
||||
void BeginOculusDrawing(void); // Setup Oculus buffers for drawing
|
||||
void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user