Skip to content
Commits on Source (2)
...@@ -59,6 +59,19 @@ class HMD: ...@@ -59,6 +59,19 @@ class HMD:
""" """
return TODO return TODO
def setup(self, color_texture_left, color_texture_right):
"""
Initialize device
:param color_texture_left: framebuffer object created externally
:type color_texture_left: GLuint
:param color_texture_right: framebuffer object created externally
:type color_texture_right: GLuint
:return: return True if the device was properly initialized
:rtype: bool
"""
return TODO
def update(self): def update(self):
""" """
Get fresh tracking data Get fresh tracking data
......
...@@ -52,18 +52,18 @@ class HMD(baseHMD): ...@@ -52,18 +52,18 @@ class HMD(baseHMD):
self.projection_matrix_right = self._getProjectionMatrix( self.projection_matrix_right = self._getProjectionMatrix(
near, far, bridge.Oculus_projectionMatrixRight) near, far, bridge.Oculus_projectionMatrixRight)
def setup(self, framebuffer_left, framebuffer_right): def setup(self, color_texture_left, color_texture_right):
""" """
Initialize device Initialize device
:param framebuffer_object_left: framebuffer object created externally :param color_texture_left: color texture created externally with the framebuffer object data
:type framebuffer_object_left: GLuint :type color_texture_left: GLuint
:param framebuffer_object_right: framebuffer object created externally :param color_texture_right: color texture created externally with the framebuffer object data
:type framebuffer_object_right: GLuint :type color_texture_right: GLuint
:return: return True if the device was properly initialized :return: return True if the device was properly initialized
:rtype: bool :rtype: bool
""" """
return bridge.Oculus_setup(self._device, framebuffer_left, framebuffer_right) return bridge.Oculus_setup(self._device, color_texture_left, color_texture_right)
def update(self): def update(self):
""" """
......
...@@ -88,22 +88,22 @@ class HMD(baseHMD): ...@@ -88,22 +88,22 @@ class HMD(baseHMD):
self.projection_matrix_left = ovr.Hmd.get_perspective(self._fovPorts[0], near, far, True).toList() self.projection_matrix_left = ovr.Hmd.get_perspective(self._fovPorts[0], near, far, True).toList()
self.projection_matrix_right = ovr.Hmd.get_perspective(self._fovPorts[1], near, far, True).toList() self.projection_matrix_right = ovr.Hmd.get_perspective(self._fovPorts[1], near, far, True).toList()
def setup(self, color_left, color_right): def setup(self, color_texture_left, color_texture_right):
""" """
Initialize device Initialize device
:param color_object_left: color object created externally :param color_texture_left: color texture created externally with the framebuffer object data
:type color_object_left: GLuint :type color_texture_left: GLuint
:param color_object_right: color object created externally :param color_texture_right: color texture created externally with the framebuffer object data
:type color_object_right: GLuint :type color_texture_right: GLuint
:return: return True if the device was properly initialized :return: return True if the device was properly initialized
:rtype: bool :rtype: bool
""" """
# disable safety warning # disable safety warning
ovr.ovrHmd_DismissHSWDisplay(self._device.hmd) ovr.ovrHmd_DismissHSWDisplay(self._device.hmd)
self._eyeTextures[0].OGL.TexId = color_left self._eyeTextures[0].OGL.TexId = color_texture_left
self._eyeTextures[1].OGL.TexId = color_right self._eyeTextures[1].OGL.TexId = color_texture_right
return True return True
def update(self): def update(self):
......