Sfoglia il codice sorgente

Merge pull request #1765 from simon-matt/master

Add viewport.clone
David Catuhe 8 anni fa
parent
commit
534f2546f9
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/Math/babylon.math.ts

+ 5 - 1
src/Math/babylon.math.ts

@@ -4139,6 +4139,10 @@
         public toGlobal(renderWidth: number, renderHeight: number): Viewport {
             return new Viewport(this.x * renderWidth, this.y * renderHeight, this.width * renderWidth, this.height * renderHeight);
         }
+
+        public clone(): Viewport {
+            return new Viewport(this.x, this.y, this.width, this.height);
+        }
     }
 
     export class Frustum {
@@ -4834,4 +4838,4 @@
             Matrix.Zero(), Matrix.Zero(),
             Matrix.Zero(), Matrix.Zero()];                      // 6 temp Matrices at once should be enough
     }
-}
+}