浏览代码

Add calls to beginFrame() and endFrame()

customisations
alemart 9 个月前
父节点
当前提交
ca00aeb9be
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5
    3
      plugins/babylon-with-encantar.js

+ 5
- 3
plugins/babylon-with-encantar.js 查看文件

231
 function encantar(demo)
231
 function encantar(demo)
232
 {
232
 {
233
     const ar = new ARSystem();
233
     const ar = new ARSystem();
234
-    const flipZAxis = new BABYLON.Matrix().copyFromFloats(
234
+    const flipZ = new BABYLON.Matrix().copyFromFloats(
235
         1, 0, 0, 0,
235
         1, 0, 0, 0,
236
         0, 1, 0, 0,
236
         0, 1, 0, 0,
237
         0, 0,-1, 0,
237
         0, 0,-1, 0,
243
         ar._frame = frame;
243
         ar._frame = frame;
244
         mix(frame);
244
         mix(frame);
245
 
245
 
246
+        ar._engine.beginFrame();
246
         demo.update(ar);
247
         demo.update(ar);
247
-
248
         ar._scene.render(false);
248
         ar._scene.render(false);
249
+        ar._engine.endFrame();
250
+
249
         ar._session.requestAnimationFrame(animate);
251
         ar._session.requestAnimationFrame(animate);
250
     }
252
     }
251
 
253
 
285
         if(ar._scene.useRightHandedSystem)
287
         if(ar._scene.useRightHandedSystem)
286
             ar._camera.freezeProjectionMatrix(convert(projectionMatrix));
288
             ar._camera.freezeProjectionMatrix(convert(projectionMatrix));
287
         else
289
         else
288
-            ar._camera.freezeProjectionMatrix(convert(projectionMatrix).multiply(flipZAxis));
290
+            ar._camera.freezeProjectionMatrix(convert(projectionMatrix).multiply(flipZ));
289
 
291
 
290
         ar._camera.setViewMatrix(convert(viewMatrix));
292
         ar._camera.setViewMatrix(convert(viewMatrix));
291
 
293
 

正在加载...
取消
保存