瀏覽代碼

Merge pull request #4849 from TrevorDev/defaultPipelineCopyArray

copy array to avoid modifying passed in variable
David Catuhe 7 年之前
父節點
當前提交
1105da5b0e

+ 1 - 0
dist/preview release/what's new.md

@@ -136,6 +136,7 @@
 - Removing observers during observable notify should not skip over valid observers ([TrevorDev](https://github.com/TrevorDev))
 - Initializing gamepadManager should register the gamepad update events ([TrevorDev](https://github.com/TrevorDev))
 - Do not generate mipmaps for RawCubeTexture if OES_texture_float_linear and/or EXT_color_buffer_float extensions are not supported ([PeapBoy](https://github.com/NicolasBuecher))
+- Do not modify passed camera array parameter when creating a default pipeline ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 

+ 1 - 0
src/PostProcess/RenderPipeline/Pipelines/babylon.defaultRenderingPipeline.ts

@@ -367,6 +367,7 @@
         constructor(name: string = "", hdr: boolean = true, scene: Scene = BABYLON.Engine.LastCreatedScene!, cameras?: Camera[], automaticBuild = true) {
             super(scene.getEngine(), name);
             this._cameras = cameras ||  scene.cameras;
+            this._cameras = this._cameras.slice();
             this._camerasToBeAttached = this._cameras.slice();
 
             this._buildAllowed = automaticBuild;