Sfoglia il codice sorgente

Add calls to beginFrame() and endFrame()

customisations
alemart 9 mesi fa
parent
commit
ca00aeb9be
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5
    3
      plugins/babylon-with-encantar.js

+ 5
- 3
plugins/babylon-with-encantar.js Vedi File

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

Loading…
Annulla
Salva