Skip to content

Commit

Permalink
delay handle_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
openblw committed Aug 11, 2019
1 parent 72a5ebe commit 7517ca4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/omvr.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ function OMVR() {
}

var stereoEnabled = false;
var handle_frame_params = null;

var self = {
set_view_quaternion : function(value) {
Expand Down Expand Up @@ -520,6 +521,16 @@ function OMVR() {
},

handle_frame : function(type, data, width, height, info, time) {
handle_frame_params = {
type : type,
data : data,
width : width,
height : height,
info : info,
time : time,
};
},
_handle_frame : function(type, data, width, height, info, time) {
m_texture_num++;

var now = new Date().getTime();
Expand Down Expand Up @@ -969,6 +980,12 @@ function OMVR() {
},

animate : function(elapsedTime) {
if (handle_frame_params) {
var params = handle_frame_params;
handle_frame_params = null;
self
._handle_frame(params.type, params.data, params.width, params.height, params.info, params.time);
}
m_view_tex_diff_quat = m_tex_quat.clone().conjugate()
.multiply(m_view_quat);
{
Expand Down

0 comments on commit 7517ca4

Please sign in to comment.