فهرست منبع

Updating Math library
New engine.runRenderLoop function

Deltakosh 12 سال پیش
والد
کامیت
bf5d82121e
3فایلهای تغییر یافته به همراه28 افزوده شده و 2 حذف شده
  1. 1 1
      Babylon/Tools/babylon.math.js
  2. 26 0
      Babylon/babylon.engine.js
  3. 1 1
      babylon.js

+ 1 - 1
Babylon/Tools/babylon.math.js

@@ -628,7 +628,7 @@
     ////////////////////////////////// Matrix //////////////////////////////////
     ////////////////////////////////// Matrix //////////////////////////////////
 
 
     BABYLON.Matrix = function () {
     BABYLON.Matrix = function () {
-        this.m = [];
+        this.m = new Array(16);
     };
     };
 
 
     // Properties
     // Properties

+ 26 - 0
Babylon/babylon.engine.js

@@ -105,6 +105,32 @@
     };
     };
 
 
     // Methods
     // Methods
+    BABYLON.Engine.prototype.stopRenderLoop = function () {
+        this._runningLoop = false;
+    };
+
+    BABYLON.Engine.prototype.runRenderLoop = function (renderFunction) {
+        this._runningLoop = true
+        var that = this;
+
+        var loop = function () {
+            // Start new frame
+            that.beginFrame();
+
+            renderFunction();
+
+            // Present
+            that.endFrame();
+
+            if (that._runningLoop) {
+                // Register new frame
+                BABYLON.Tools.QueueNewFrame(loop);
+            }
+        };
+
+        BABYLON.Tools.QueueNewFrame(loop);
+    };
+
     BABYLON.Engine.prototype.switchFullscreen = function (element) {
     BABYLON.Engine.prototype.switchFullscreen = function (element) {
         if (this.isFullscreen) {
         if (this.isFullscreen) {
             BABYLON.Tools.ExitFullscreen();
             BABYLON.Tools.ExitFullscreen();

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
babylon.js