ソースを参照

modified the fix to include numbers very close to 0

Adam Bowman 8 年 前
コミット
9ba6f2d6c1
1 ファイル変更3 行追加1 行削除
  1. 3 1
      canvas2D/src/Engine/babylon.canvas2d.ts

+ 3 - 1
canvas2D/src/Engine/babylon.canvas2d.ts

@@ -1448,8 +1448,10 @@
 
             cam.getViewMatrix().multiplyToRef(cam.getProjectionMatrix(), Canvas2D._m);
             
-            if(Canvas2D._m.m[15] === 0){
+            if(Canvas2D._m.m[15] < Epsilon && Canvas2D._m.m[15] >= 0){
                 Canvas2D._m.m[15] = Epsilon;
+            }else if(Canvas2D._m.m[15] > -Epsilon && Canvas2D._m.m[15] <= 0){
+                Canvas2D._m.m[15] = -Epsilon;
             }
 
             let vp = cam.viewport.toGlobal(this.engine.getRenderWidth(), this.engine.getRenderHeight());