Explorar o código

Merge remote-tracking branch 'BabylonJS/master'

MackeyK24 %!s(int64=8) %!d(string=hai) anos
pai
achega
b0078c41ae

+ 2 - 1
Tools/Gulp/config.json

@@ -1496,7 +1496,8 @@
                     "../../inspector/sass/**/*.scss"
                 ],
                 "output": "babylon.inspector.js",
-                "webpack": "../../inspector/webpack.config.js"
+                "webpack": "../../inspector/webpack.config.js",
+                "bundle":"true"
             }
         ],
         "build": {

+ 23 - 11
Tools/Gulp/gulpfile.js

@@ -292,16 +292,28 @@ var buildExternalLibrary = function (library, settings, watch) {
         return merge2([shader, includeShader, dev, css]);
     }
     else {
-        var code = merge2([tsProcess.js, shader, includeShader])
-            .pipe(concat(library.output))
-            .pipe(gulp.dest(outputDirectory))
-            .pipe(cleants())
-            .pipe(replace(extendsSearchRegex, ""))
-            .pipe(replace(decorateSearchRegex, ""))
-            .pipe(rename({ extname: ".min.js" }))
-            .pipe(uglify())
-            .pipe(optimisejs())
-            .pipe(gulp.dest(outputDirectory));
+        if (library.bundle) {
+            // Don't remove extends and decorate functions
+            var code = merge2([tsProcess.js, shader, includeShader])
+                .pipe(concat(library.output))
+                .pipe(gulp.dest(outputDirectory))
+                .pipe(cleants())
+                .pipe(rename({ extname: ".min.js" }))
+                .pipe(uglify())
+                .pipe(optimisejs())
+                .pipe(gulp.dest(outputDirectory));
+        } else {
+            var code = merge2([tsProcess.js, shader, includeShader])
+                .pipe(concat(library.output))
+                .pipe(gulp.dest(outputDirectory))
+                .pipe(cleants())
+                .pipe(replace(extendsSearchRegex, ""))
+                .pipe(replace(decorateSearchRegex, ""))
+                .pipe(rename({ extname: ".min.js" }))
+                .pipe(uglify())
+                .pipe(optimisejs())
+                .pipe(gulp.dest(outputDirectory));
+        }
 
         var dts = tsProcess.dts
             .pipe(concat(library.output))
@@ -426,7 +438,7 @@ gulp.task('webserver', function () {
     gulp.src('../../.').pipe(webserver({
         port: 1338,
         livereload: false
-        }));
+    }));
 });
 
 /**

+ 260 - 200
dist/preview release/babylon.d.ts

@@ -26,9 +26,14 @@ declare module BABYLON {
          */
         attributeName: string;
     }
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     class EngineCapabilities {
+        /** The maximum textures image */
         maxTexturesImageUnits: number;
         maxVertexTextureImageUnits: number;
+        /** The maximum texture size */
         maxTextureSize: number;
         maxCubemapTextureSize: number;
         maxRenderTextureSize: number;
@@ -284,6 +289,7 @@ declare module BABYLON {
         getHardwareScalingLevel(): number;
         getLoadedTexturesCache(): WebGLTexture[];
         getCaps(): EngineCapabilities;
+        /** The number of draw calls submitted last frame */
         readonly drawCalls: number;
         readonly drawCallsPerfCounter: PerfCounter;
         getDepthFunction(): number;
@@ -413,6 +419,10 @@ declare module BABYLON {
         drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void;
         drawUnIndexed(useTriangles: boolean, verticesStart: number, verticesCount: number, instancesCount?: number): void;
         _releaseEffect(effect: Effect): void;
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
         createEffectForParticles(fragmentName: string, uniformsNames?: string[], samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect;
         createShaderProgram(vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram;
@@ -1360,9 +1370,13 @@ declare module BABYLON {
         private static _FOGMODE_LINEAR;
         static MinDeltaTime: number;
         static MaxDeltaTime: number;
+        /** The fog is deactivated */
         static readonly FOGMODE_NONE: number;
+        /** The fog density is following an exponential function */
         static readonly FOGMODE_EXP: number;
+        /** The fog density is following an exponential function faster than FOGMODE_EXP */
         static readonly FOGMODE_EXP2: number;
+        /** The fog density is following a linear function. */
         static readonly FOGMODE_LINEAR: number;
         autoClear: boolean;
         autoClearDepthAndStencil: boolean;
@@ -1407,6 +1421,7 @@ declare module BABYLON {
         */
         onDisposeObservable: Observable<Scene>;
         private _onDisposeObserver;
+        /** A function to be executed when this scene is disposed. */
         onDispose: () => void;
         /**
         * An event triggered before rendering the scene
@@ -1414,6 +1429,7 @@ declare module BABYLON {
         */
         onBeforeRenderObservable: Observable<Scene>;
         private _onBeforeRenderObserver;
+        /** A function to be executed before rendering this scene */
         beforeRender: () => void;
         /**
         * An event triggered after rendering the scene
@@ -1421,6 +1437,7 @@ declare module BABYLON {
         */
         onAfterRenderObservable: Observable<Scene>;
         private _onAfterRenderObserver;
+        /** A function to be executed after rendering this scene */
         afterRender: () => void;
         /**
         * An event triggered when the scene is ready
@@ -1494,9 +1511,13 @@ declare module BABYLON {
         private _onPointerMove;
         private _onPointerDown;
         private _onPointerUp;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void;
         /**
          * This observable event is triggered when any mouse event registered during Scene.attach() is called BEFORE the 3D engine to process anything (mesh/sprite picking for instance).
@@ -1508,9 +1529,13 @@ declare module BABYLON {
          */
         onPointerObservable: Observable<PointerInfo>;
         readonly unTranslatedPointer: Vector2;
+        /** The distance in pixel that you have to move to prevent some events */
         static DragMovementThreshold: number;
+        /** Time in milliseconds to wait to raise long press events if button is still pressed */
         static LongPressDelay: number;
+        /** Time in milliseconds with two consecutive clicks will be considered as a double click */
         static DoubleClickDelay: number;
+        /** If you need to check double click without raising a single click at first click, enable this flag */
         static ExclusiveDoubleClickMode: boolean;
         private _initClickEvent;
         private _initActionManager;
@@ -1524,6 +1549,7 @@ declare module BABYLON {
         private _previousPickResult;
         private _isButtonPressed;
         private _doubleClickOccured;
+        /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
         cameraToUseForPointers: Camera;
         private _pointerX;
         private _pointerY;
@@ -1542,11 +1568,10 @@ declare module BABYLON {
         */
         private _useRightHandedSystem;
         useRightHandedSystem: boolean;
+        private _fogEnabled;
         /**
         * is fog enabled on this scene.
-        * @type {boolean}
         */
-        private _fogEnabled;
         fogEnabled: boolean;
         private _fogMode;
         fogMode: number;
@@ -1572,13 +1597,11 @@ declare module BABYLON {
         * @type {BABYLON.Light[]}
         */
         lights: Light[];
-        /**
-        * All of the cameras added to this scene.
-        * @see BABYLON.Camera
-        * @type {BABYLON.Camera[]}
-        */
+        /** All of the cameras added to this scene. */
         cameras: Camera[];
+        /** All of the active cameras added to this scene. */
         activeCameras: Camera[];
+        /** The current active camera */
         activeCamera: Camera;
         /**
         * All of the (abstract) meshes added to this scene.
@@ -1590,6 +1613,8 @@ declare module BABYLON {
         materials: Material[];
         multiMaterials: MultiMaterial[];
         private _defaultMaterial;
+        /** The default material used on meshes when no material is affected */
+        /** The default material used on meshes when no material is affected */
         defaultMaterial: Material;
         private _texturesEnabled;
         texturesEnabled: boolean;
@@ -1609,6 +1634,7 @@ declare module BABYLON {
         collisionsEnabled: boolean;
         private _workerCollisions;
         collisionCoordinator: ICollisionCoordinator;
+        /** Defines the gravity applied to this scene */
         gravity: Vector3;
         postProcessesEnabled: boolean;
         postProcessManager: PostProcessManager;
@@ -1783,9 +1809,8 @@ declare module BABYLON {
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable): Animatable;
         beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable;
@@ -2019,10 +2044,41 @@ declare module BABYLON {
         private _internalPick(rayFunction, predicate, fastCheck?);
         private _internalMultiPick(rayFunction, predicate);
         private _internalPickSprites(ray, predicate?, fastCheck?, camera?);
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo;
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         pickSprite(x: number, y: number, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo;
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo;
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         multiPick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, camera?: Camera): PickingInfo[];
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         multiPickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean): PickingInfo[];
         setPointerOverMesh(mesh: AbstractMesh): void;
         getPointerOverMesh(): AbstractMesh;
@@ -2150,7 +2206,6 @@ declare module BABYLON {
         sourceEvent: any;
         additionalData: any;
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event
@@ -3808,6 +3863,120 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    class BoundingBox implements ICullable {
+        minimum: Vector3;
+        maximum: Vector3;
+        vectors: Vector3[];
+        center: Vector3;
+        centerWorld: Vector3;
+        extendSize: Vector3;
+        extendSizeWorld: Vector3;
+        directions: Vector3[];
+        vectorsWorld: Vector3[];
+        minimumWorld: Vector3;
+        maximumWorld: Vector3;
+        private _worldMatrix;
+        constructor(minimum: Vector3, maximum: Vector3);
+        getWorldMatrix(): Matrix;
+        setWorldMatrix(matrix: Matrix): BoundingBox;
+        _update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersectsSphere(sphere: BoundingSphere): boolean;
+        intersectsMinMax(min: Vector3, max: Vector3): boolean;
+        static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
+        static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
+        static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
+        static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
+    }
+}
+
+declare module BABYLON {
+    interface ICullable {
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+    }
+    class BoundingInfo implements ICullable {
+        minimum: Vector3;
+        maximum: Vector3;
+        boundingBox: BoundingBox;
+        boundingSphere: BoundingSphere;
+        private _isLocked;
+        constructor(minimum: Vector3, maximum: Vector3);
+        isLocked: boolean;
+        update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+        _checkCollision(collider: Collider): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
+    }
+}
+
+declare module BABYLON {
+    class BoundingSphere {
+        minimum: Vector3;
+        maximum: Vector3;
+        center: Vector3;
+        radius: number;
+        centerWorld: Vector3;
+        radiusWorld: number;
+        private _tempRadiusVector;
+        constructor(minimum: Vector3, maximum: Vector3);
+        _update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
+    }
+}
+
+declare module BABYLON {
+    class Ray {
+        origin: Vector3;
+        direction: Vector3;
+        length: number;
+        private _edge1;
+        private _edge2;
+        private _pvec;
+        private _tvec;
+        private _qvec;
+        private _tmpRay;
+        private _rayHelper;
+        constructor(origin: Vector3, direction: Vector3, length?: number);
+        intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
+        intersectsBox(box: BoundingBox): boolean;
+        intersectsSphere(sphere: BoundingSphere): boolean;
+        intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
+        intersectsPlane(plane: Plane): number;
+        intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
+        intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
+        private _comparePickingInfo(pickingInfoA, pickingInfoB);
+        private static smallnum;
+        private static rayl;
+        /**
+         * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
+         * @param sega the first point of the segment to test the intersection against
+         * @param segb the second point of the segment to test the intersection against
+         * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
+         * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
+         */
+        intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
+        static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
+        /**
+        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
+        * transformed to the given world matrix.
+        * @param origin The origin point
+        * @param end The end point
+        * @param world a matrix to transform the ray to. Default is the identity matrix.
+        */
+        static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
+        static Transform(ray: Ray, matrix: Matrix): Ray;
+        static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
+    }
+}
+
+declare module BABYLON {
     class Collider {
         radius: Vector3;
         retry: number;
@@ -4050,120 +4219,6 @@ declare module BABYLON {
     }
 }
 
-declare module BABYLON {
-    class BoundingBox implements ICullable {
-        minimum: Vector3;
-        maximum: Vector3;
-        vectors: Vector3[];
-        center: Vector3;
-        centerWorld: Vector3;
-        extendSize: Vector3;
-        extendSizeWorld: Vector3;
-        directions: Vector3[];
-        vectorsWorld: Vector3[];
-        minimumWorld: Vector3;
-        maximumWorld: Vector3;
-        private _worldMatrix;
-        constructor(minimum: Vector3, maximum: Vector3);
-        getWorldMatrix(): Matrix;
-        setWorldMatrix(matrix: Matrix): BoundingBox;
-        _update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        intersectsSphere(sphere: BoundingSphere): boolean;
-        intersectsMinMax(min: Vector3, max: Vector3): boolean;
-        static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
-        static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
-        static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
-        static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
-    }
-}
-
-declare module BABYLON {
-    interface ICullable {
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-    }
-    class BoundingInfo implements ICullable {
-        minimum: Vector3;
-        maximum: Vector3;
-        boundingBox: BoundingBox;
-        boundingSphere: BoundingSphere;
-        private _isLocked;
-        constructor(minimum: Vector3, maximum: Vector3);
-        isLocked: boolean;
-        update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-        _checkCollision(collider: Collider): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
-    }
-}
-
-declare module BABYLON {
-    class BoundingSphere {
-        minimum: Vector3;
-        maximum: Vector3;
-        center: Vector3;
-        radius: number;
-        centerWorld: Vector3;
-        radiusWorld: number;
-        private _tempRadiusVector;
-        constructor(minimum: Vector3, maximum: Vector3);
-        _update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
-    }
-}
-
-declare module BABYLON {
-    class Ray {
-        origin: Vector3;
-        direction: Vector3;
-        length: number;
-        private _edge1;
-        private _edge2;
-        private _pvec;
-        private _tvec;
-        private _qvec;
-        private _tmpRay;
-        private _rayHelper;
-        constructor(origin: Vector3, direction: Vector3, length?: number);
-        intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
-        intersectsBox(box: BoundingBox): boolean;
-        intersectsSphere(sphere: BoundingSphere): boolean;
-        intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
-        intersectsPlane(plane: Plane): number;
-        intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
-        intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
-        private _comparePickingInfo(pickingInfoA, pickingInfoB);
-        private static smallnum;
-        private static rayl;
-        /**
-         * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
-         * @param sega the first point of the segment to test the intersection against
-         * @param segb the second point of the segment to test the intersection against
-         * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
-         * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
-         */
-        intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
-        static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
-        /**
-        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
-        * transformed to the given world matrix.
-        * @param origin The origin point
-        * @param end The end point
-        * @param world a matrix to transform the ray to. Default is the identity matrix.
-        */
-        static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
-        static Transform(ray: Ray, matrix: Matrix): Ray;
-        static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
-    }
-}
-
 declare module BABYLON.Debug {
     class AxesViewer {
         private _xline;
@@ -4293,6 +4348,51 @@ declare module BABYLON.Debug {
 }
 
 declare module BABYLON {
+    class LensFlare {
+        size: number;
+        position: number;
+        color: Color3;
+        texture: Texture;
+        alphaMode: number;
+        private _system;
+        constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
+        dispose: () => void;
+    }
+}
+
+declare module BABYLON {
+    class LensFlareSystem {
+        name: string;
+        lensFlares: LensFlare[];
+        borderLimit: number;
+        viewportBorder: number;
+        meshesSelectionPredicate: (mesh: Mesh) => boolean;
+        layerMask: number;
+        id: string;
+        private _scene;
+        private _emitter;
+        private _vertexBuffers;
+        private _indexBuffer;
+        private _effect;
+        private _positionX;
+        private _positionY;
+        private _isEnabled;
+        constructor(name: string, emitter: any, scene: Scene);
+        isEnabled: boolean;
+        getScene(): Scene;
+        getEmitter(): any;
+        setEmitter(newEmitter: any): void;
+        getEmitterPosition(): Vector3;
+        computeEffectivePosition(globalViewport: Viewport): boolean;
+        _isVisible(): boolean;
+        render(): boolean;
+        dispose(): void;
+        static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
+        serialize(): any;
+    }
+}
+
+declare module BABYLON {
     /**
      * Highlight layer options. This helps customizing the behaviour
      * of the highlight layer.
@@ -4549,51 +4649,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    class LensFlare {
-        size: number;
-        position: number;
-        color: Color3;
-        texture: Texture;
-        alphaMode: number;
-        private _system;
-        constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
-        dispose: () => void;
-    }
-}
-
-declare module BABYLON {
-    class LensFlareSystem {
-        name: string;
-        lensFlares: LensFlare[];
-        borderLimit: number;
-        viewportBorder: number;
-        meshesSelectionPredicate: (mesh: Mesh) => boolean;
-        layerMask: number;
-        id: string;
-        private _scene;
-        private _emitter;
-        private _vertexBuffers;
-        private _indexBuffer;
-        private _effect;
-        private _positionX;
-        private _positionY;
-        private _isEnabled;
-        constructor(name: string, emitter: any, scene: Scene);
-        isEnabled: boolean;
-        getScene(): Scene;
-        getEmitter(): any;
-        setEmitter(newEmitter: any): void;
-        getEmitterPosition(): Vector3;
-        computeEffectivePosition(globalViewport: Viewport): boolean;
-        _isVisible(): boolean;
-        render(): boolean;
-        dispose(): void;
-        static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
-        serialize(): any;
-    }
-}
-
-declare module BABYLON {
     class DirectionalLight extends ShadowLight {
         private _shadowFrustumSize;
         /**
@@ -13064,36 +13119,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    class ReflectionProbe {
-        name: string;
-        private _scene;
-        private _renderTargetTexture;
-        private _projectionMatrix;
-        private _viewMatrix;
-        private _target;
-        private _add;
-        private _attachedMesh;
-        invertYAxis: boolean;
-        position: Vector3;
-        constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
-        samples: number;
-        refreshRate: number;
-        getScene(): Scene;
-        readonly cubeTexture: RenderTargetTexture;
-        readonly renderList: AbstractMesh[];
-        attachToMesh(mesh: AbstractMesh): void;
-        /**
-         * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
-         *
-         * @param renderingGroupId The rendering group id corresponding to its index
-         * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
-         */
-        setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
     class AnaglyphPostProcess extends PostProcess {
         private _passedProcess;
         constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
@@ -13617,6 +13642,36 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    class ReflectionProbe {
+        name: string;
+        private _scene;
+        private _renderTargetTexture;
+        private _projectionMatrix;
+        private _viewMatrix;
+        private _target;
+        private _add;
+        private _attachedMesh;
+        invertYAxis: boolean;
+        position: Vector3;
+        constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
+        samples: number;
+        refreshRate: number;
+        getScene(): Scene;
+        readonly cubeTexture: RenderTargetTexture;
+        readonly renderList: AbstractMesh[];
+        attachToMesh(mesh: AbstractMesh): void;
+        /**
+         * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
+         *
+         * @param renderingGroupId The rendering group id corresponding to its index
+         * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
+         */
+        setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
     class BoundingBoxRenderer {
         frontColor: Color3;
         backColor: Color3;
@@ -17298,6 +17353,11 @@ declare module BABYLON {
         * An event triggered when the texture is unbind.
         * @type {BABYLON.Observable}
         */
+        onBeforeBindObservable: Observable<RenderTargetTexture>;
+        /**
+        * An event triggered when the texture is unbind.
+        * @type {BABYLON.Observable}
+        */
         onAfterUnbindObservable: Observable<RenderTargetTexture>;
         private _onAfterUnbindObserver;
         onAfterUnbind: () => void;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 11 - 11
dist/preview release/babylon.js


+ 87 - 40
dist/preview release/babylon.max.js

@@ -7421,6 +7421,9 @@ var BABYLON;
         return InstancingAttributeInfo;
     }());
     BABYLON.InstancingAttributeInfo = InstancingAttributeInfo;
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     var EngineCapabilities = (function () {
         function EngineCapabilities() {
         }
@@ -8220,6 +8223,7 @@ var BABYLON;
             return this._caps;
         };
         Object.defineProperty(Engine.prototype, "drawCalls", {
+            /** The number of draw calls submitted last frame */
             get: function () {
                 return this._drawCalls.current;
             },
@@ -9062,6 +9066,10 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         Engine.prototype.createEffect = function (baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters) {
             var vertex = baseName.vertexElement || baseName.vertex || baseName;
             var fragment = baseName.fragmentElement || baseName.fragment || baseName;
@@ -15937,7 +15945,8 @@ var BABYLON;
             this._previousPickResult = null;
             this._isButtonPressed = false;
             this._doubleClickOccured = false;
-            this.cameraToUseForPointers = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position
+            /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
+            this.cameraToUseForPointers = null;
             this._startingPointerPosition = new BABYLON.Vector2(0, 0);
             this._previousStartingPointerPosition = new BABYLON.Vector2(0, 0);
             this._startingPointerTime = 0;
@@ -15949,10 +15958,6 @@ var BABYLON;
             */
             this._useRightHandedSystem = false;
             // Fog
-            /**
-            * is fog enabled on this scene.
-            * @type {boolean}
-            */
             this._fogEnabled = true;
             this._fogMode = Scene.FOGMODE_NONE;
             this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3);
@@ -15977,12 +15982,9 @@ var BABYLON;
             */
             this.lights = new Array();
             // Cameras
-            /**
-            * All of the cameras added to this scene.
-            * @see BABYLON.Camera
-            * @type {BABYLON.Camera[]}
-            */
+            /** All of the cameras added to this scene. */
             this.cameras = new Array();
+            /** All of the active cameras added to this scene. */
             this.activeCameras = new Array();
             // Meshes
             /**
@@ -16017,6 +16019,7 @@ var BABYLON;
             this.lensFlareSystems = new Array();
             // Collisions
             this.collisionsEnabled = true;
+            /** Defines the gravity applied to this scene */
             this.gravity = new BABYLON.Vector3(0, -9.807, 0);
             // Postprocesses
             this.postProcessesEnabled = true;
@@ -16095,6 +16098,7 @@ var BABYLON;
             this._imageProcessingConfiguration = new BABYLON.ImageProcessingConfiguration();
         }
         Object.defineProperty(Scene, "FOGMODE_NONE", {
+            /** The fog is deactivated */
             get: function () {
                 return Scene._FOGMODE_NONE;
             },
@@ -16102,6 +16106,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_EXP", {
+            /** The fog density is following an exponential function */
             get: function () {
                 return Scene._FOGMODE_EXP;
             },
@@ -16109,6 +16114,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_EXP2", {
+            /** The fog density is following an exponential function faster than FOGMODE_EXP */
             get: function () {
                 return Scene._FOGMODE_EXP2;
             },
@@ -16116,6 +16122,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_LINEAR", {
+            /** The fog density is following a linear function. */
             get: function () {
                 return Scene._FOGMODE_LINEAR;
             },
@@ -16173,6 +16180,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "onDispose", {
+            /** A function to be executed when this scene is disposed. */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -16183,6 +16191,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "beforeRender", {
+            /** A function to be executed before rendering this scene */
             set: function (callback) {
                 if (this._onBeforeRenderObserver) {
                     this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
@@ -16193,6 +16202,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "afterRender", {
+            /** A function to be executed after rendering this scene */
             set: function (callback) {
                 if (this._onAfterRenderObserver) {
                     this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -16247,6 +16257,9 @@ var BABYLON;
             get: function () {
                 return this._fogEnabled;
             },
+            /**
+            * is fog enabled on this scene.
+            */
             set: function (value) {
                 if (this._fogEnabled === value) {
                     return;
@@ -16300,12 +16313,14 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "defaultMaterial", {
+            /** The default material used on meshes when no material is affected */
             get: function () {
                 if (!this._defaultMaterial) {
                     this._defaultMaterial = new BABYLON.StandardMaterial("default material", this);
                 }
                 return this._defaultMaterial;
             },
+            /** The default material used on meshes when no material is affected */
             set: function (value) {
                 this._defaultMaterial = value;
             },
@@ -17132,9 +17147,8 @@ var BABYLON;
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         Scene.prototype.beginAnimation = function (target, from, to, loop, speedRatio, onAnimationEnd, animatable) {
             if (speedRatio === void 0) { speedRatio = 1.0; }
@@ -18707,25 +18721,32 @@ var BABYLON;
             }
             return pickingInfo || new BABYLON.PickingInfo();
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.pick = function (x, y, predicate, fastCheck, camera) {
             var _this = this;
             return this._internalPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate, fastCheck);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) {
             return this._internalPickSprites(this.createPickingRayInCameraSpace(x, y, camera), predicate, fastCheck, camera);
         };
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         Scene.prototype.pickWithRay = function (ray, predicate, fastCheck) {
             var _this = this;
             return this._internalPick(function (world) {
@@ -18736,18 +18757,22 @@ var BABYLON;
                 return BABYLON.Ray.Transform(ray, _this._pickWithRayInverseMatrix);
             }, predicate, fastCheck);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.multiPick = function (x, y, predicate, camera) {
             var _this = this;
             return this._internalMultiPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="ray">Ray to use</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         Scene.prototype.multiPickWithRay = function (ray, predicate) {
             var _this = this;
             return this._internalMultiPick(function (world) {
@@ -18988,10 +19013,14 @@ var BABYLON;
     Scene._FOGMODE_LINEAR = 3;
     Scene.MinDeltaTime = 1.0;
     Scene.MaxDeltaTime = 1000.0;
+    /** The distance in pixel that you have to move to prevent some events */
     Scene.DragMovementThreshold = 10; // in pixels
+    /** Time in milliseconds to wait to raise long press events if button is still pressed */
     Scene.LongPressDelay = 500; // in milliseconds
+    /** Time in milliseconds with two consecutive clicks will be considered as a double click */
     Scene.DoubleClickDelay = 300; // in milliseconds
-    Scene.ExclusiveDoubleClickMode = false; // If you need to check double click without raising a single click at first click, enable this flag
+    /** If you need to check double click without raising a single click at first click, enable this flag */
+    Scene.ExclusiveDoubleClickMode = false;
     BABYLON.Scene = Scene;
 })(BABYLON || (BABYLON = {}));
 
@@ -24876,13 +24905,25 @@ var BABYLON;
                 if (options.clipPlane) {
                     scene.clipPlane = new BABYLON.Plane(0, 0, 0, 1);
                 }
-                if (_this.isReadyForSubMesh(mesh, subMesh)) {
-                    if (onCompiled) {
-                        onCompiled(_this);
+                if (_this.storeEffectOnSubMeshes) {
+                    if (_this.isReadyForSubMesh(mesh, subMesh)) {
+                        if (onCompiled) {
+                            onCompiled(_this);
+                        }
+                    }
+                    else {
+                        setTimeout(checkReady, 16);
                     }
                 }
                 else {
-                    setTimeout(checkReady, 16);
+                    if (_this.isReady(mesh)) {
+                        if (onCompiled) {
+                            onCompiled(_this);
+                        }
+                    }
+                    else {
+                        setTimeout(checkReady, 16);
+                    }
                 }
                 engine.setAlphaTesting(alphaTestState);
                 if (options.clipPlane) {
@@ -37153,7 +37194,6 @@ var BABYLON;
      */
     var ActionEvent = (function () {
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event
@@ -44523,6 +44563,11 @@ var BABYLON;
             * An event triggered when the texture is unbind.
             * @type {BABYLON.Observable}
             */
+            _this.onBeforeBindObservable = new BABYLON.Observable();
+            /**
+            * An event triggered when the texture is unbind.
+            * @type {BABYLON.Observable}
+            */
             _this.onAfterUnbindObservable = new BABYLON.Observable();
             /**
             * An event triggered before rendering the texture
@@ -44779,6 +44824,7 @@ var BABYLON;
             if (this.renderList && this.renderList.length === 0) {
                 return;
             }
+            this.onBeforeBindObservable.notifyObservers(this);
             // Set custom projection.
             // Needs to be before binding to prevent changing the aspect ratio.
             var camera;
@@ -48758,6 +48804,7 @@ var BABYLON;
             var _this = _super.call(this, name, scene, true) || this;
             scene.multiMaterials.push(_this);
             _this.subMaterials = new Array();
+            _this.storeEffectOnSubMeshes = true; // multimaterial is considered like a push material
             return _this;
         }
         Object.defineProperty(MultiMaterial.prototype, "subMaterials", {
@@ -48809,7 +48856,7 @@ var BABYLON;
             for (var index = 0; index < this.subMaterials.length; index++) {
                 var subMaterial = this.subMaterials[index];
                 if (subMaterial) {
-                    if (this.subMaterials[index].isReadyForSubMesh) {
+                    if (this.subMaterials[index].storeEffectOnSubMeshes) {
                         if (!this.subMaterials[index].isReadyForSubMesh(mesh, subMesh, useInstances)) {
                             return false;
                         }

+ 260 - 200
dist/preview release/babylon.module.d.ts

@@ -26,9 +26,14 @@ declare module BABYLON {
          */
         attributeName: string;
     }
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     class EngineCapabilities {
+        /** The maximum textures image */
         maxTexturesImageUnits: number;
         maxVertexTextureImageUnits: number;
+        /** The maximum texture size */
         maxTextureSize: number;
         maxCubemapTextureSize: number;
         maxRenderTextureSize: number;
@@ -284,6 +289,7 @@ declare module BABYLON {
         getHardwareScalingLevel(): number;
         getLoadedTexturesCache(): WebGLTexture[];
         getCaps(): EngineCapabilities;
+        /** The number of draw calls submitted last frame */
         readonly drawCalls: number;
         readonly drawCallsPerfCounter: PerfCounter;
         getDepthFunction(): number;
@@ -413,6 +419,10 @@ declare module BABYLON {
         drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void;
         drawUnIndexed(useTriangles: boolean, verticesStart: number, verticesCount: number, instancesCount?: number): void;
         _releaseEffect(effect: Effect): void;
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
         createEffectForParticles(fragmentName: string, uniformsNames?: string[], samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void): Effect;
         createShaderProgram(vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram;
@@ -1360,9 +1370,13 @@ declare module BABYLON {
         private static _FOGMODE_LINEAR;
         static MinDeltaTime: number;
         static MaxDeltaTime: number;
+        /** The fog is deactivated */
         static readonly FOGMODE_NONE: number;
+        /** The fog density is following an exponential function */
         static readonly FOGMODE_EXP: number;
+        /** The fog density is following an exponential function faster than FOGMODE_EXP */
         static readonly FOGMODE_EXP2: number;
+        /** The fog density is following a linear function. */
         static readonly FOGMODE_LINEAR: number;
         autoClear: boolean;
         autoClearDepthAndStencil: boolean;
@@ -1407,6 +1421,7 @@ declare module BABYLON {
         */
         onDisposeObservable: Observable<Scene>;
         private _onDisposeObserver;
+        /** A function to be executed when this scene is disposed. */
         onDispose: () => void;
         /**
         * An event triggered before rendering the scene
@@ -1414,6 +1429,7 @@ declare module BABYLON {
         */
         onBeforeRenderObservable: Observable<Scene>;
         private _onBeforeRenderObserver;
+        /** A function to be executed before rendering this scene */
         beforeRender: () => void;
         /**
         * An event triggered after rendering the scene
@@ -1421,6 +1437,7 @@ declare module BABYLON {
         */
         onAfterRenderObservable: Observable<Scene>;
         private _onAfterRenderObserver;
+        /** A function to be executed after rendering this scene */
         afterRender: () => void;
         /**
         * An event triggered when the scene is ready
@@ -1494,9 +1511,13 @@ declare module BABYLON {
         private _onPointerMove;
         private _onPointerDown;
         private _onPointerUp;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void;
         /**
          * This observable event is triggered when any mouse event registered during Scene.attach() is called BEFORE the 3D engine to process anything (mesh/sprite picking for instance).
@@ -1508,9 +1529,13 @@ declare module BABYLON {
          */
         onPointerObservable: Observable<PointerInfo>;
         readonly unTranslatedPointer: Vector2;
+        /** The distance in pixel that you have to move to prevent some events */
         static DragMovementThreshold: number;
+        /** Time in milliseconds to wait to raise long press events if button is still pressed */
         static LongPressDelay: number;
+        /** Time in milliseconds with two consecutive clicks will be considered as a double click */
         static DoubleClickDelay: number;
+        /** If you need to check double click without raising a single click at first click, enable this flag */
         static ExclusiveDoubleClickMode: boolean;
         private _initClickEvent;
         private _initActionManager;
@@ -1524,6 +1549,7 @@ declare module BABYLON {
         private _previousPickResult;
         private _isButtonPressed;
         private _doubleClickOccured;
+        /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
         cameraToUseForPointers: Camera;
         private _pointerX;
         private _pointerY;
@@ -1542,11 +1568,10 @@ declare module BABYLON {
         */
         private _useRightHandedSystem;
         useRightHandedSystem: boolean;
+        private _fogEnabled;
         /**
         * is fog enabled on this scene.
-        * @type {boolean}
         */
-        private _fogEnabled;
         fogEnabled: boolean;
         private _fogMode;
         fogMode: number;
@@ -1572,13 +1597,11 @@ declare module BABYLON {
         * @type {BABYLON.Light[]}
         */
         lights: Light[];
-        /**
-        * All of the cameras added to this scene.
-        * @see BABYLON.Camera
-        * @type {BABYLON.Camera[]}
-        */
+        /** All of the cameras added to this scene. */
         cameras: Camera[];
+        /** All of the active cameras added to this scene. */
         activeCameras: Camera[];
+        /** The current active camera */
         activeCamera: Camera;
         /**
         * All of the (abstract) meshes added to this scene.
@@ -1590,6 +1613,8 @@ declare module BABYLON {
         materials: Material[];
         multiMaterials: MultiMaterial[];
         private _defaultMaterial;
+        /** The default material used on meshes when no material is affected */
+        /** The default material used on meshes when no material is affected */
         defaultMaterial: Material;
         private _texturesEnabled;
         texturesEnabled: boolean;
@@ -1609,6 +1634,7 @@ declare module BABYLON {
         collisionsEnabled: boolean;
         private _workerCollisions;
         collisionCoordinator: ICollisionCoordinator;
+        /** Defines the gravity applied to this scene */
         gravity: Vector3;
         postProcessesEnabled: boolean;
         postProcessManager: PostProcessManager;
@@ -1783,9 +1809,8 @@ declare module BABYLON {
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable): Animatable;
         beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Animatable;
@@ -2019,10 +2044,41 @@ declare module BABYLON {
         private _internalPick(rayFunction, predicate, fastCheck?);
         private _internalMultiPick(rayFunction, predicate);
         private _internalPickSprites(ray, predicate?, fastCheck?, camera?);
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo;
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         pickSprite(x: number, y: number, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo;
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo;
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         multiPick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, camera?: Camera): PickingInfo[];
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         multiPickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean): PickingInfo[];
         setPointerOverMesh(mesh: AbstractMesh): void;
         getPointerOverMesh(): AbstractMesh;
@@ -2150,7 +2206,6 @@ declare module BABYLON {
         sourceEvent: any;
         additionalData: any;
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event
@@ -3808,6 +3863,120 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    class BoundingBox implements ICullable {
+        minimum: Vector3;
+        maximum: Vector3;
+        vectors: Vector3[];
+        center: Vector3;
+        centerWorld: Vector3;
+        extendSize: Vector3;
+        extendSizeWorld: Vector3;
+        directions: Vector3[];
+        vectorsWorld: Vector3[];
+        minimumWorld: Vector3;
+        maximumWorld: Vector3;
+        private _worldMatrix;
+        constructor(minimum: Vector3, maximum: Vector3);
+        getWorldMatrix(): Matrix;
+        setWorldMatrix(matrix: Matrix): BoundingBox;
+        _update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersectsSphere(sphere: BoundingSphere): boolean;
+        intersectsMinMax(min: Vector3, max: Vector3): boolean;
+        static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
+        static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
+        static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
+        static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
+    }
+}
+
+declare module BABYLON {
+    interface ICullable {
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+    }
+    class BoundingInfo implements ICullable {
+        minimum: Vector3;
+        maximum: Vector3;
+        boundingBox: BoundingBox;
+        boundingSphere: BoundingSphere;
+        private _isLocked;
+        constructor(minimum: Vector3, maximum: Vector3);
+        isLocked: boolean;
+        update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
+        _checkCollision(collider: Collider): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
+    }
+}
+
+declare module BABYLON {
+    class BoundingSphere {
+        minimum: Vector3;
+        maximum: Vector3;
+        center: Vector3;
+        radius: number;
+        centerWorld: Vector3;
+        radiusWorld: number;
+        private _tempRadiusVector;
+        constructor(minimum: Vector3, maximum: Vector3);
+        _update(world: Matrix): void;
+        isInFrustum(frustumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
+    }
+}
+
+declare module BABYLON {
+    class Ray {
+        origin: Vector3;
+        direction: Vector3;
+        length: number;
+        private _edge1;
+        private _edge2;
+        private _pvec;
+        private _tvec;
+        private _qvec;
+        private _tmpRay;
+        private _rayHelper;
+        constructor(origin: Vector3, direction: Vector3, length?: number);
+        intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
+        intersectsBox(box: BoundingBox): boolean;
+        intersectsSphere(sphere: BoundingSphere): boolean;
+        intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
+        intersectsPlane(plane: Plane): number;
+        intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
+        intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
+        private _comparePickingInfo(pickingInfoA, pickingInfoB);
+        private static smallnum;
+        private static rayl;
+        /**
+         * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
+         * @param sega the first point of the segment to test the intersection against
+         * @param segb the second point of the segment to test the intersection against
+         * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
+         * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
+         */
+        intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
+        static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
+        /**
+        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
+        * transformed to the given world matrix.
+        * @param origin The origin point
+        * @param end The end point
+        * @param world a matrix to transform the ray to. Default is the identity matrix.
+        */
+        static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
+        static Transform(ray: Ray, matrix: Matrix): Ray;
+        static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
+    }
+}
+
+declare module BABYLON {
     class Collider {
         radius: Vector3;
         retry: number;
@@ -4050,120 +4219,6 @@ declare module BABYLON {
     }
 }
 
-declare module BABYLON {
-    class BoundingBox implements ICullable {
-        minimum: Vector3;
-        maximum: Vector3;
-        vectors: Vector3[];
-        center: Vector3;
-        centerWorld: Vector3;
-        extendSize: Vector3;
-        extendSizeWorld: Vector3;
-        directions: Vector3[];
-        vectorsWorld: Vector3[];
-        minimumWorld: Vector3;
-        maximumWorld: Vector3;
-        private _worldMatrix;
-        constructor(minimum: Vector3, maximum: Vector3);
-        getWorldMatrix(): Matrix;
-        setWorldMatrix(matrix: Matrix): BoundingBox;
-        _update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        intersectsSphere(sphere: BoundingSphere): boolean;
-        intersectsMinMax(min: Vector3, max: Vector3): boolean;
-        static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
-        static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
-        static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
-        static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
-    }
-}
-
-declare module BABYLON {
-    interface ICullable {
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-    }
-    class BoundingInfo implements ICullable {
-        minimum: Vector3;
-        maximum: Vector3;
-        boundingBox: BoundingBox;
-        boundingSphere: BoundingSphere;
-        private _isLocked;
-        constructor(minimum: Vector3, maximum: Vector3);
-        isLocked: boolean;
-        update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
-        _checkCollision(collider: Collider): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
-    }
-}
-
-declare module BABYLON {
-    class BoundingSphere {
-        minimum: Vector3;
-        maximum: Vector3;
-        center: Vector3;
-        radius: number;
-        centerWorld: Vector3;
-        radiusWorld: number;
-        private _tempRadiusVector;
-        constructor(minimum: Vector3, maximum: Vector3);
-        _update(world: Matrix): void;
-        isInFrustum(frustumPlanes: Plane[]): boolean;
-        intersectsPoint(point: Vector3): boolean;
-        static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
-    }
-}
-
-declare module BABYLON {
-    class Ray {
-        origin: Vector3;
-        direction: Vector3;
-        length: number;
-        private _edge1;
-        private _edge2;
-        private _pvec;
-        private _tvec;
-        private _qvec;
-        private _tmpRay;
-        private _rayHelper;
-        constructor(origin: Vector3, direction: Vector3, length?: number);
-        intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
-        intersectsBox(box: BoundingBox): boolean;
-        intersectsSphere(sphere: BoundingSphere): boolean;
-        intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
-        intersectsPlane(plane: Plane): number;
-        intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
-        intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
-        private _comparePickingInfo(pickingInfoA, pickingInfoB);
-        private static smallnum;
-        private static rayl;
-        /**
-         * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
-         * @param sega the first point of the segment to test the intersection against
-         * @param segb the second point of the segment to test the intersection against
-         * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
-         * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
-         */
-        intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
-        static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
-        /**
-        * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
-        * transformed to the given world matrix.
-        * @param origin The origin point
-        * @param end The end point
-        * @param world a matrix to transform the ray to. Default is the identity matrix.
-        */
-        static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
-        static Transform(ray: Ray, matrix: Matrix): Ray;
-        static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
-    }
-}
-
 declare module BABYLON.Debug {
     class AxesViewer {
         private _xline;
@@ -4293,6 +4348,51 @@ declare module BABYLON.Debug {
 }
 
 declare module BABYLON {
+    class LensFlare {
+        size: number;
+        position: number;
+        color: Color3;
+        texture: Texture;
+        alphaMode: number;
+        private _system;
+        constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
+        dispose: () => void;
+    }
+}
+
+declare module BABYLON {
+    class LensFlareSystem {
+        name: string;
+        lensFlares: LensFlare[];
+        borderLimit: number;
+        viewportBorder: number;
+        meshesSelectionPredicate: (mesh: Mesh) => boolean;
+        layerMask: number;
+        id: string;
+        private _scene;
+        private _emitter;
+        private _vertexBuffers;
+        private _indexBuffer;
+        private _effect;
+        private _positionX;
+        private _positionY;
+        private _isEnabled;
+        constructor(name: string, emitter: any, scene: Scene);
+        isEnabled: boolean;
+        getScene(): Scene;
+        getEmitter(): any;
+        setEmitter(newEmitter: any): void;
+        getEmitterPosition(): Vector3;
+        computeEffectivePosition(globalViewport: Viewport): boolean;
+        _isVisible(): boolean;
+        render(): boolean;
+        dispose(): void;
+        static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
+        serialize(): any;
+    }
+}
+
+declare module BABYLON {
     /**
      * Highlight layer options. This helps customizing the behaviour
      * of the highlight layer.
@@ -4549,51 +4649,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    class LensFlare {
-        size: number;
-        position: number;
-        color: Color3;
-        texture: Texture;
-        alphaMode: number;
-        private _system;
-        constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
-        dispose: () => void;
-    }
-}
-
-declare module BABYLON {
-    class LensFlareSystem {
-        name: string;
-        lensFlares: LensFlare[];
-        borderLimit: number;
-        viewportBorder: number;
-        meshesSelectionPredicate: (mesh: Mesh) => boolean;
-        layerMask: number;
-        id: string;
-        private _scene;
-        private _emitter;
-        private _vertexBuffers;
-        private _indexBuffer;
-        private _effect;
-        private _positionX;
-        private _positionY;
-        private _isEnabled;
-        constructor(name: string, emitter: any, scene: Scene);
-        isEnabled: boolean;
-        getScene(): Scene;
-        getEmitter(): any;
-        setEmitter(newEmitter: any): void;
-        getEmitterPosition(): Vector3;
-        computeEffectivePosition(globalViewport: Viewport): boolean;
-        _isVisible(): boolean;
-        render(): boolean;
-        dispose(): void;
-        static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
-        serialize(): any;
-    }
-}
-
-declare module BABYLON {
     class DirectionalLight extends ShadowLight {
         private _shadowFrustumSize;
         /**
@@ -13064,36 +13119,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    class ReflectionProbe {
-        name: string;
-        private _scene;
-        private _renderTargetTexture;
-        private _projectionMatrix;
-        private _viewMatrix;
-        private _target;
-        private _add;
-        private _attachedMesh;
-        invertYAxis: boolean;
-        position: Vector3;
-        constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
-        samples: number;
-        refreshRate: number;
-        getScene(): Scene;
-        readonly cubeTexture: RenderTargetTexture;
-        readonly renderList: AbstractMesh[];
-        attachToMesh(mesh: AbstractMesh): void;
-        /**
-         * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
-         *
-         * @param renderingGroupId The rendering group id corresponding to its index
-         * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
-         */
-        setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
-        dispose(): void;
-    }
-}
-
-declare module BABYLON {
     class AnaglyphPostProcess extends PostProcess {
         private _passedProcess;
         constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
@@ -13617,6 +13642,36 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    class ReflectionProbe {
+        name: string;
+        private _scene;
+        private _renderTargetTexture;
+        private _projectionMatrix;
+        private _viewMatrix;
+        private _target;
+        private _add;
+        private _attachedMesh;
+        invertYAxis: boolean;
+        position: Vector3;
+        constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
+        samples: number;
+        refreshRate: number;
+        getScene(): Scene;
+        readonly cubeTexture: RenderTargetTexture;
+        readonly renderList: AbstractMesh[];
+        attachToMesh(mesh: AbstractMesh): void;
+        /**
+         * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
+         *
+         * @param renderingGroupId The rendering group id corresponding to its index
+         * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
+         */
+        setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
+        dispose(): void;
+    }
+}
+
+declare module BABYLON {
     class BoundingBoxRenderer {
         frontColor: Color3;
         backColor: Color3;
@@ -17298,6 +17353,11 @@ declare module BABYLON {
         * An event triggered when the texture is unbind.
         * @type {BABYLON.Observable}
         */
+        onBeforeBindObservable: Observable<RenderTargetTexture>;
+        /**
+        * An event triggered when the texture is unbind.
+        * @type {BABYLON.Observable}
+        */
         onAfterUnbindObservable: Observable<RenderTargetTexture>;
         private _onAfterUnbindObserver;
         onAfterUnbind: () => void;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 11 - 11
dist/preview release/babylon.worker.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3889 - 3829
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 9 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 87 - 40
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -7421,6 +7421,9 @@ var BABYLON;
         return InstancingAttributeInfo;
     }());
     BABYLON.InstancingAttributeInfo = InstancingAttributeInfo;
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     var EngineCapabilities = (function () {
         function EngineCapabilities() {
         }
@@ -8220,6 +8223,7 @@ var BABYLON;
             return this._caps;
         };
         Object.defineProperty(Engine.prototype, "drawCalls", {
+            /** The number of draw calls submitted last frame */
             get: function () {
                 return this._drawCalls.current;
             },
@@ -9062,6 +9066,10 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         Engine.prototype.createEffect = function (baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters) {
             var vertex = baseName.vertexElement || baseName.vertex || baseName;
             var fragment = baseName.fragmentElement || baseName.fragment || baseName;
@@ -15937,7 +15945,8 @@ var BABYLON;
             this._previousPickResult = null;
             this._isButtonPressed = false;
             this._doubleClickOccured = false;
-            this.cameraToUseForPointers = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position
+            /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
+            this.cameraToUseForPointers = null;
             this._startingPointerPosition = new BABYLON.Vector2(0, 0);
             this._previousStartingPointerPosition = new BABYLON.Vector2(0, 0);
             this._startingPointerTime = 0;
@@ -15949,10 +15958,6 @@ var BABYLON;
             */
             this._useRightHandedSystem = false;
             // Fog
-            /**
-            * is fog enabled on this scene.
-            * @type {boolean}
-            */
             this._fogEnabled = true;
             this._fogMode = Scene.FOGMODE_NONE;
             this.fogColor = new BABYLON.Color3(0.2, 0.2, 0.3);
@@ -15977,12 +15982,9 @@ var BABYLON;
             */
             this.lights = new Array();
             // Cameras
-            /**
-            * All of the cameras added to this scene.
-            * @see BABYLON.Camera
-            * @type {BABYLON.Camera[]}
-            */
+            /** All of the cameras added to this scene. */
             this.cameras = new Array();
+            /** All of the active cameras added to this scene. */
             this.activeCameras = new Array();
             // Meshes
             /**
@@ -16017,6 +16019,7 @@ var BABYLON;
             this.lensFlareSystems = new Array();
             // Collisions
             this.collisionsEnabled = true;
+            /** Defines the gravity applied to this scene */
             this.gravity = new BABYLON.Vector3(0, -9.807, 0);
             // Postprocesses
             this.postProcessesEnabled = true;
@@ -16095,6 +16098,7 @@ var BABYLON;
             this._imageProcessingConfiguration = new BABYLON.ImageProcessingConfiguration();
         }
         Object.defineProperty(Scene, "FOGMODE_NONE", {
+            /** The fog is deactivated */
             get: function () {
                 return Scene._FOGMODE_NONE;
             },
@@ -16102,6 +16106,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_EXP", {
+            /** The fog density is following an exponential function */
             get: function () {
                 return Scene._FOGMODE_EXP;
             },
@@ -16109,6 +16114,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_EXP2", {
+            /** The fog density is following an exponential function faster than FOGMODE_EXP */
             get: function () {
                 return Scene._FOGMODE_EXP2;
             },
@@ -16116,6 +16122,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene, "FOGMODE_LINEAR", {
+            /** The fog density is following a linear function. */
             get: function () {
                 return Scene._FOGMODE_LINEAR;
             },
@@ -16173,6 +16180,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "onDispose", {
+            /** A function to be executed when this scene is disposed. */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -16183,6 +16191,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "beforeRender", {
+            /** A function to be executed before rendering this scene */
             set: function (callback) {
                 if (this._onBeforeRenderObserver) {
                     this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
@@ -16193,6 +16202,7 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "afterRender", {
+            /** A function to be executed after rendering this scene */
             set: function (callback) {
                 if (this._onAfterRenderObserver) {
                     this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -16247,6 +16257,9 @@ var BABYLON;
             get: function () {
                 return this._fogEnabled;
             },
+            /**
+            * is fog enabled on this scene.
+            */
             set: function (value) {
                 if (this._fogEnabled === value) {
                     return;
@@ -16300,12 +16313,14 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Scene.prototype, "defaultMaterial", {
+            /** The default material used on meshes when no material is affected */
             get: function () {
                 if (!this._defaultMaterial) {
                     this._defaultMaterial = new BABYLON.StandardMaterial("default material", this);
                 }
                 return this._defaultMaterial;
             },
+            /** The default material used on meshes when no material is affected */
             set: function (value) {
                 this._defaultMaterial = value;
             },
@@ -17132,9 +17147,8 @@ var BABYLON;
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         Scene.prototype.beginAnimation = function (target, from, to, loop, speedRatio, onAnimationEnd, animatable) {
             if (speedRatio === void 0) { speedRatio = 1.0; }
@@ -18707,25 +18721,32 @@ var BABYLON;
             }
             return pickingInfo || new BABYLON.PickingInfo();
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.pick = function (x, y, predicate, fastCheck, camera) {
             var _this = this;
             return this._internalPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate, fastCheck);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.pickSprite = function (x, y, predicate, fastCheck, camera) {
             return this._internalPickSprites(this.createPickingRayInCameraSpace(x, y, camera), predicate, fastCheck, camera);
         };
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         Scene.prototype.pickWithRay = function (ray, predicate, fastCheck) {
             var _this = this;
             return this._internalPick(function (world) {
@@ -18736,18 +18757,22 @@ var BABYLON;
                 return BABYLON.Ray.Transform(ray, _this._pickWithRayInverseMatrix);
             }, predicate, fastCheck);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         Scene.prototype.multiPick = function (x, y, predicate, camera) {
             var _this = this;
             return this._internalMultiPick(function (world) { return _this.createPickingRay(x, y, world, camera); }, predicate);
         };
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="ray">Ray to use</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         Scene.prototype.multiPickWithRay = function (ray, predicate) {
             var _this = this;
             return this._internalMultiPick(function (world) {
@@ -18988,10 +19013,14 @@ var BABYLON;
     Scene._FOGMODE_LINEAR = 3;
     Scene.MinDeltaTime = 1.0;
     Scene.MaxDeltaTime = 1000.0;
+    /** The distance in pixel that you have to move to prevent some events */
     Scene.DragMovementThreshold = 10; // in pixels
+    /** Time in milliseconds to wait to raise long press events if button is still pressed */
     Scene.LongPressDelay = 500; // in milliseconds
+    /** Time in milliseconds with two consecutive clicks will be considered as a double click */
     Scene.DoubleClickDelay = 300; // in milliseconds
-    Scene.ExclusiveDoubleClickMode = false; // If you need to check double click without raising a single click at first click, enable this flag
+    /** If you need to check double click without raising a single click at first click, enable this flag */
+    Scene.ExclusiveDoubleClickMode = false;
     BABYLON.Scene = Scene;
 })(BABYLON || (BABYLON = {}));
 
@@ -24876,13 +24905,25 @@ var BABYLON;
                 if (options.clipPlane) {
                     scene.clipPlane = new BABYLON.Plane(0, 0, 0, 1);
                 }
-                if (_this.isReadyForSubMesh(mesh, subMesh)) {
-                    if (onCompiled) {
-                        onCompiled(_this);
+                if (_this.storeEffectOnSubMeshes) {
+                    if (_this.isReadyForSubMesh(mesh, subMesh)) {
+                        if (onCompiled) {
+                            onCompiled(_this);
+                        }
+                    }
+                    else {
+                        setTimeout(checkReady, 16);
                     }
                 }
                 else {
-                    setTimeout(checkReady, 16);
+                    if (_this.isReady(mesh)) {
+                        if (onCompiled) {
+                            onCompiled(_this);
+                        }
+                    }
+                    else {
+                        setTimeout(checkReady, 16);
+                    }
                 }
                 engine.setAlphaTesting(alphaTestState);
                 if (options.clipPlane) {
@@ -32133,6 +32174,11 @@ var BABYLON;
             * An event triggered when the texture is unbind.
             * @type {BABYLON.Observable}
             */
+            _this.onBeforeBindObservable = new BABYLON.Observable();
+            /**
+            * An event triggered when the texture is unbind.
+            * @type {BABYLON.Observable}
+            */
             _this.onAfterUnbindObservable = new BABYLON.Observable();
             /**
             * An event triggered before rendering the texture
@@ -32389,6 +32435,7 @@ var BABYLON;
             if (this.renderList && this.renderList.length === 0) {
                 return;
             }
+            this.onBeforeBindObservable.notifyObservers(this);
             // Set custom projection.
             // Needs to be before binding to prevent changing the aspect ratio.
             var camera;
@@ -35786,6 +35833,7 @@ var BABYLON;
             var _this = _super.call(this, name, scene, true) || this;
             scene.multiMaterials.push(_this);
             _this.subMaterials = new Array();
+            _this.storeEffectOnSubMeshes = true; // multimaterial is considered like a push material
             return _this;
         }
         Object.defineProperty(MultiMaterial.prototype, "subMaterials", {
@@ -35837,7 +35885,7 @@ var BABYLON;
             for (var index = 0; index < this.subMaterials.length; index++) {
                 var subMaterial = this.subMaterials[index];
                 if (subMaterial) {
-                    if (this.subMaterials[index].isReadyForSubMesh) {
+                    if (this.subMaterials[index].storeEffectOnSubMeshes) {
                         if (!this.subMaterials[index].isReadyForSubMesh(mesh, subMesh, useInstances)) {
                             return false;
                         }
@@ -45360,7 +45408,6 @@ var BABYLON;
      */
     var ActionEvent = (function () {
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3889 - 3829
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5 - 572
dist/preview release/inspector/babylon.inspector.bundle.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 3
dist/preview release/inspector/babylon.inspector.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 568
dist/preview release/split.js


+ 1 - 1
inspector/webpack.config.js

@@ -13,7 +13,7 @@ module.exports = {
             split: '../split.js'
         }
     },
-    module: {        
+    module: {
         loaders: [
             { test: /\.css$/, loader: "style!css" },
             { test: /babylon.inspector.min.js$/, loader: "imports?Split=split!exports?INSPECTOR" }

+ 21 - 22
src/Actions/babylon.actionManager.ts

@@ -5,7 +5,6 @@
      */
     export class ActionEvent {
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event
@@ -306,11 +305,11 @@
 
             this.actions.push(action);
 
-          if(ActionManager.Triggers[action.trigger]) {
-              ActionManager.Triggers[action.trigger]++;
+            if (ActionManager.Triggers[action.trigger]) {
+                ActionManager.Triggers[action.trigger]++;
             }
-            else{
-              ActionManager.Triggers[action.trigger] = 1;
+            else {
+                ActionManager.Triggers[action.trigger] = 1;
             }
 
             action._actionManager = this;
@@ -369,7 +368,7 @@
 
             return properties[properties.length - 1];
         }
-        
+
         public serialize(name: string): any {
             var root = {
                 children: [],
@@ -377,15 +376,15 @@
                 type: 3, // Root node
                 properties: [] // Empty for root but required
             };
-            
+
             for (var i = 0; i < this.actions.length; i++) {
-                var triggerObject = { 
+                var triggerObject = {
                     type: 0, // Trigger
                     children: [],
                     name: ActionManager.GetTriggerName(this.actions[i].trigger),
                     properties: []
                 };
-                
+
                 var triggerOptions = this.actions[i].triggerOptions;
 
                 if (triggerOptions && typeof triggerOptions !== "number") {
@@ -403,14 +402,14 @@
                         triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter });
                     }
                 }
-                
+
                 // Serialize child action, recursively
                 this.actions[i].serialize(triggerObject);
-                
+
                 // Add serialized trigger
                 root.children.push(triggerObject);
             }
-            
+
             return root;
         }
 
@@ -600,16 +599,16 @@
 
         public static GetTriggerName(trigger: number): string {
             switch (trigger) {
-                case 0:  return "NothingTrigger";
-                case 1:  return "OnPickTrigger";
-                case 2:  return "OnLeftPickTrigger";
-                case 3:  return "OnRightPickTrigger";
-                case 4:  return "OnCenterPickTrigger";
-                case 5:  return "OnPickDownTrigger";
-                case 6:  return "OnPickUpTrigger";
-                case 7:  return "OnLongPressTrigger";
-                case 8:  return "OnPointerOverTrigger";
-                case 9:  return "OnPointerOutTrigger";
+                case 0: return "NothingTrigger";
+                case 1: return "OnPickTrigger";
+                case 2: return "OnLeftPickTrigger";
+                case 3: return "OnRightPickTrigger";
+                case 4: return "OnCenterPickTrigger";
+                case 5: return "OnPickDownTrigger";
+                case 6: return "OnPickUpTrigger";
+                case 7: return "OnLongPressTrigger";
+                case 8: return "OnPointerOverTrigger";
+                case 9: return "OnPointerOutTrigger";
                 case 10: return "OnEveryFrameTrigger";
                 case 11: return "OnIntersectionEnterTrigger";
                 case 12: return "OnIntersectionExitTrigger";

+ 8 - 0
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -50,6 +50,12 @@
         * An event triggered when the texture is unbind.
         * @type {BABYLON.Observable}
         */
+        public onBeforeBindObservable = new Observable<RenderTargetTexture>();        
+
+        /**
+        * An event triggered when the texture is unbind.
+        * @type {BABYLON.Observable}
+        */
         public onAfterUnbindObservable = new Observable<RenderTargetTexture>();
 
         private _onAfterUnbindObserver: Observer<RenderTargetTexture>;
@@ -314,6 +320,8 @@
                 return;
             }
 
+            this.onBeforeBindObservable.notifyObservers(this);            
+
             // Set custom projection.
             // Needs to be before binding to prevent changing the aspect ratio.
             let camera: Camera;

+ 17 - 6
src/Materials/babylon.material.ts

@@ -536,13 +536,24 @@
                     scene.clipPlane = new Plane(0, 0, 0, 1);
                 }
 
-                if (this.isReadyForSubMesh(mesh, subMesh)) {
-                    if (onCompiled) {
-                        onCompiled(this);
+                if (this.storeEffectOnSubMeshes) {
+                    if (this.isReadyForSubMesh(mesh, subMesh)) {
+                        if (onCompiled) {
+                            onCompiled(this);
+                        }
                     }
-                }
-                else {
-                    setTimeout(checkReady, 16);
+                    else {
+                        setTimeout(checkReady, 16);
+                    }
+                } else {
+                    if (this.isReady(mesh)) {
+                        if (onCompiled) {
+                            onCompiled(this);
+                        }
+                    }
+                    else {
+                        setTimeout(checkReady, 16);
+                    }                    
                 }
 
                 engine.setAlphaTesting(alphaTestState);

+ 3 - 1
src/Materials/babylon.multiMaterial.ts

@@ -16,6 +16,8 @@
             scene.multiMaterials.push(this);
 
             this.subMaterials = new Array<Material>();
+
+            this.storeEffectOnSubMeshes = true; // multimaterial is considered like a push material
         }
 
         private _hookArray(array: Material[]): void {
@@ -60,7 +62,7 @@
             for (var index = 0; index < this.subMaterials.length; index++) {
                 var subMaterial = this.subMaterials[index];
                 if (subMaterial) {
-                    if (this.subMaterials[index].isReadyForSubMesh) {
+                    if (this.subMaterials[index].storeEffectOnSubMeshes) {
                         if (!this.subMaterials[index].isReadyForSubMesh(mesh, subMesh, useInstances)) {
                             return false;
                         }

+ 68 - 58
src/babylon.engine.ts

@@ -15,7 +15,7 @@
         var magFilter = gl.NEAREST;
         var minFilter = gl.NEAREST;
 
-        switch(samplingMode) {
+        switch (samplingMode) {
             case Texture.BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
@@ -38,7 +38,7 @@
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.NEAREST;
-                }            
+                }
                 break;
             case Texture.NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
@@ -46,56 +46,56 @@
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.NEAREST;
-                }            
-                break;                
+                }
+                break;
             case Texture.NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.LINEAR;
-                }            
-                break;      
+                }
+                break;
             case Texture.NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.LINEAR;
-                }            
-                break;        
+                }
+                break;
             case Texture.NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
-                break;                                       
+                break;
             case Texture.NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
-                break;                                       
+                break;
             case Texture.LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.NEAREST;
-                }     
-                break;                                       
+                }
+                break;
             case Texture.LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.NEAREST;
-                }     
-                break;   
+                }
+                break;
             case Texture.LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
-                break;                                       
+                break;
             case Texture.LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
-                break;                          
+                break;
         }
 
         return {
@@ -228,9 +228,14 @@
         attributeName: string;
     }
 
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     export class EngineCapabilities {
+        /** The maximum textures image */
         public maxTexturesImageUnits: number;
         public maxVertexTextureImageUnits: number;
+        /** The maximum texture size */
         public maxTextureSize: number;
         public maxCubemapTextureSize: number;
         public maxRenderTextureSize: number;
@@ -299,7 +304,7 @@
         /**
          * Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation
          */
-        public static MarkAllMaterialsAsDirty(flag:number, predicate?: (mat: Material) => boolean): void {
+        public static MarkAllMaterialsAsDirty(flag: number, predicate?: (mat: Material) => boolean): void {
             for (var engineIndex = 0; engineIndex < Engine.Instances.length; engineIndex++) {
                 var engine = Engine.Instances[engineIndex];
 
@@ -454,11 +459,11 @@
 
         public static get ALPHA_INTERPOLATE(): number {
             return Engine._ALPHA_INTERPOLATE;
-        }        
+        }
 
         public static get ALPHA_SCREENMODE(): number {
             return Engine._ALPHA_SCREENMODE;
-        }           
+        }
 
         public static get DELAYLOADSTATE_NONE(): number {
             return Engine._DELAYLOADSTATE_NONE;
@@ -520,11 +525,11 @@
 
         public static get SCALEMODE_NEAREST(): number {
             return Engine._SCALEMODE_NEAREST;
-        }      
+        }
 
         public static get SCALEMODE_CEILING(): number {
             return Engine._SCALEMODE_CEILING;
-        }           
+        }
 
         public static get Version(): string {
             return "3.1-alpha";
@@ -707,7 +712,7 @@
          */
         constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio = false) {
             var canvas: HTMLCanvasElement;
-            Engine.Instances.push(this);            
+            Engine.Instances.push(this);
             options = options || {};
 
             if ((<HTMLCanvasElement>canvasOrContext).getContext) {
@@ -833,9 +838,9 @@
             this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc');
             this._caps.s3tc = this._gl.getExtension('WEBGL_compressed_texture_s3tc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');
             this._caps.pvrtc = this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');
-            this._caps.etc1  = this._gl.getExtension('WEBGL_compressed_texture_etc1' ) || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1' );
-            this._caps.etc2  = this._gl.getExtension('WEBGL_compressed_texture_etc'  ) || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc'  ) ||
-                               this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3
+            this._caps.etc1 = this._gl.getExtension('WEBGL_compressed_texture_etc1') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1');
+            this._caps.etc2 = this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc') ||
+                this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3
 
             this._caps.textureAnisotropicFilterExtension = this._gl.getExtension('EXT_texture_filter_anisotropic') || this._gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || this._gl.getExtension('MOZ_EXT_texture_filter_anisotropic');
             this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0;
@@ -896,11 +901,11 @@
             // Next PVRTC & DXT, which are probably superior to ETC1/2.  
             // Likely no hardware which supports both PVR & DXT, so order matters little.
             // ETC2 is newer and handles ETC1 (no alpha capability), so check for first.
-            if (this._caps.astc ) this.texturesSupported.push('-astc.ktx');
-            if (this._caps.s3tc ) this.texturesSupported.push('-dxt.ktx');
+            if (this._caps.astc) this.texturesSupported.push('-astc.ktx');
+            if (this._caps.s3tc) this.texturesSupported.push('-dxt.ktx');
             if (this._caps.pvrtc) this.texturesSupported.push('-pvrtc.ktx');
-            if (this._caps.etc2 ) this.texturesSupported.push('-etc2.ktx');
-            if (this._caps.etc1 ) this.texturesSupported.push('-etc1.ktx');
+            if (this._caps.etc2) this.texturesSupported.push('-etc2.ktx');
+            if (this._caps.etc1) this.texturesSupported.push('-etc1.ktx');
 
             if (this._gl.getShaderPrecisionFormat) {
                 var highp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);
@@ -1063,6 +1068,7 @@
             return this._caps;
         }
 
+        /** The number of draw calls submitted last frame */
         public get drawCalls(): number {
             return this._drawCalls.current;
         }
@@ -1420,7 +1426,7 @@
                     Tools.Error("No WebVR devices found!");
                     callback(null);
                 }
-            });            
+            });
         }
 
         public initWebVR(): void {
@@ -1481,7 +1487,7 @@
         public bindFramebuffer(texture: WebGLTexture, faceIndex?: number, requiredWidth?: number, requiredHeight?: number): void {
             if (this._currentRenderTarget) {
                 this.unBindFramebuffer(this._currentRenderTarget);
-            }            
+            }
             this._currentRenderTarget = texture;
             this.bindUnboundFramebuffer(texture._MSAAFramebuffer ? texture._MSAAFramebuffer : texture._framebuffer);
             var gl = this._gl;
@@ -2063,7 +2069,11 @@
             }
         }
 
-        
+
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         public createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks,
             onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect {
             var vertex = baseName.vertexElement || baseName.vertex || baseName;
@@ -2348,7 +2358,7 @@
             this._depthCullingState.zOffset = value;
         }
 
-        public getZOffset():number {
+        public getZOffset(): number {
             return this._depthCullingState.zOffset;
         }
 
@@ -2416,11 +2426,11 @@
                 case Engine.ALPHA_INTERPOLATE:
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA);
                     this._alphaState.alphaBlend = true;
-                    break;    
+                    break;
                 case Engine.ALPHA_SCREENMODE:
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
                     this._alphaState.alphaBlend = true;
-                    break;                                      
+                    break;
             }
             if (!noDepthWriteChange) {
                 this.setDepthWrite(mode === Engine.ALPHA_DISABLE);
@@ -2532,7 +2542,7 @@
             var extension = (lastDot > 0) ? url.substring(lastDot).toLowerCase() : "";
             var isDDS = this.getCaps().s3tc && (extension === ".dds");
             var isTGA = (extension === ".tga");
-            
+
             // determine if a ktx file should be substituted
             var isKTX = false;
             if (this._textureFormatInUse && !isBase64 && !fallBack) {
@@ -2546,7 +2556,7 @@
             texture.references = 1;
             texture.samplingMode = samplingMode;
             texture.onLoadedCallbacks = [];
-           
+
             if (onLoad) {
                 texture.onLoadedCallbacks.push(onLoad);
             }
@@ -2562,7 +2572,7 @@
                     onError();
                 }
             };
-            
+
             var callback: (arrayBuffer: any) => void;
 
             // processing for non-image formats
@@ -2590,10 +2600,10 @@
                     callback = (data) => {
                         var info = Internals.DDSTools.GetDDSInfo(data);
 
-                         var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1);
-                         prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, () => {
-                             Internals.DDSTools.UploadDDSLevels(this, data, info, loadMipmap, 1);
-                         }, samplingMode);
+                        var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1);
+                        prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, () => {
+                            Internals.DDSTools.UploadDDSLevels(this, data, info, loadMipmap, 1);
+                        }, samplingMode);
                     };
                 }
 
@@ -2604,7 +2614,7 @@
                 } else {
                     callback(buffer);
                 }
-            // image format processing
+                // image format processing
             } else {
                 var onload = (img) => {
                     prepareWebGLTexture(texture, this._gl, scene, img.width, img.height, invertY, noMipmap, false, (potWidth, potHeight) => {
@@ -2633,7 +2643,7 @@
                             }
                         }
 
-                        let internalFormat = format ? this._getInternalFormat(format) : ((extension === ".jpg") ? this._gl.RGB :this._gl.RGBA);
+                        let internalFormat = format ? this._getInternalFormat(format) : ((extension === ".jpg") ? this._gl.RGB : this._gl.RGBA);
                         this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, internalFormat, this._gl.UNSIGNED_BYTE, isPot ? img : this._workingCanvas);
                     }, samplingMode);
                 };
@@ -2643,7 +2653,7 @@
                 else if (buffer instanceof Array || typeof buffer === "string")
                     Tools.LoadImage(buffer, onload, onerror, scene.database);
                 else
-                    onload(buffer);                
+                    onload(buffer);
             }
 
             return texture;
@@ -2961,7 +2971,7 @@
 
             var width = size.width || size;
             var height = size.height || size;
-            
+
             var textures = [];
             var attachments = []
 
@@ -3000,7 +3010,7 @@
                 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
 
                 gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), width, height, 0, gl.RGBA, this._getWebGLTextureType(type), null);
-            
+
                 gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, 0);
 
                 if (generateMipMaps) {
@@ -3255,7 +3265,7 @@
                 }
 
                 const mipSlices = 3;
-                
+
                 var gl = this._gl;
                 const width = loadData.width;
                 if (!width) {
@@ -3568,8 +3578,8 @@
 
         public createRawCubeTextureFromUrl(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
             callback: (ArrayBuffer: ArrayBuffer) => ArrayBufferView[],
-            mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][]), 
-            onLoad: () => void = null, 
+            mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][]),
+            onLoad: () => void = null,
             onError: () => void = null,
             samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
             invertY = false): WebGLTexture {
@@ -3586,7 +3596,7 @@
                     onError();
                 }
             };
-            
+
             var internalCallback = (data) => {
                 var width = texture._width;
                 var height = texture._height;
@@ -3605,7 +3615,7 @@
 
                     this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
                     gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0);
-                    
+
                     var mipData = mipmmapGenerator(faceDataArrays);
                     for (var level = 0; level < mipData.length; level++) {
                         var mipSize = width >> level;
@@ -3677,7 +3687,7 @@
             if (texture._framebuffer) {
                 gl.deleteFramebuffer(texture._framebuffer);
                 texture._framebuffer = null;
-            }            
+            }
 
             if (texture._depthStencilBuffer) {
                 gl.deleteRenderbuffer(texture._depthStencilBuffer);
@@ -3692,7 +3702,7 @@
             if (texture._MSAARenderBuffer) {
                 gl.deleteRenderbuffer(texture._MSAARenderBuffer);
                 texture._MSAARenderBuffer = null;
-            }            
+            }
         }
 
         public _releaseTexture(texture: WebGLTexture): void {
@@ -3807,7 +3817,7 @@
             }
 
 
-            var internalTexture = texture.isReady() ? texture.getInternalTexture() : 
+            var internalTexture = texture.isReady() ? texture.getInternalTexture() :
                 (texture.isCube ? this.emptyCubeTexture : this.emptyTexture);
 
             if (this._activeTexturesCache[channel] === internalTexture) {
@@ -3955,7 +3965,7 @@
             if (!this._externalData) {
                 this._externalData = new StringDictionary<Object>();
             }
-            
+
             return this._externalData.remove(key);
         }
 
@@ -4088,7 +4098,7 @@
         }
 
         public get loadingScreen(): ILoadingScreen {
-            if (!this._loadingScreen && DefaultLoadingScreen) 
+            if (!this._loadingScreen && DefaultLoadingScreen)
                 this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
             return this._loadingScreen;
         }
@@ -4127,7 +4137,7 @@
 
         public getError(): number {
             return this._gl.getError();
-        }        
+        }
 
         // FPS
         public getFps(): number {

+ 180 - 153
src/babylon.scene.ts

@@ -15,10 +15,10 @@
         public get doubleClick(): boolean {
             return this._doubleClick;
         }
-        public get hasSwiped(): boolean{
+        public get hasSwiped(): boolean {
             return this._hasSwiped;
         }
-        public get ignore(): boolean{
+        public get ignore(): boolean {
             return this._ignore;
         }
 
@@ -64,7 +64,7 @@
         public static get POINTERPICK(): number {
             return PointerEventTypes._POINTERPICK;
         }
-        
+
         public static get POINTERTAP(): number {
             return PointerEventTypes._POINTERTAP;
         }
@@ -168,18 +168,22 @@
         public static MinDeltaTime = 1.0;
         public static MaxDeltaTime = 1000.0;
 
+        /** The fog is deactivated */
         public static get FOGMODE_NONE(): number {
             return Scene._FOGMODE_NONE;
         }
 
+        /** The fog density is following an exponential function */
         public static get FOGMODE_EXP(): number {
             return Scene._FOGMODE_EXP;
         }
 
+        /** The fog density is following an exponential function faster than FOGMODE_EXP */
         public static get FOGMODE_EXP2(): number {
             return Scene._FOGMODE_EXP2;
         }
 
+        /** The fog density is following a linear function. */
         public static get FOGMODE_LINEAR(): number {
             return Scene._FOGMODE_LINEAR;
         }
@@ -226,7 +230,7 @@
 
         public forceWireframe = false;
         private _forcePointsCloud = false;
-        public set forcePointsCloud(value : boolean) {
+        public set forcePointsCloud(value: boolean) {
             if (this._forcePointsCloud === value) {
                 return;
             }
@@ -235,7 +239,7 @@
         }
         public get forcePointsCloud(): boolean {
             return this._forcePointsCloud;
-        }   
+        }
 
         public forceShowBoundingBoxes = false;
         public clipPlane: Plane;
@@ -257,6 +261,7 @@
         public onDisposeObservable = new Observable<Scene>();
 
         private _onDisposeObserver: Observer<Scene>;
+        /** A function to be executed when this scene is disposed. */
         public set onDispose(callback: () => void) {
             if (this._onDisposeObserver) {
                 this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -271,6 +276,7 @@
         public onBeforeRenderObservable = new Observable<Scene>();
 
         private _onBeforeRenderObserver: Observer<Scene>;
+        /** A function to be executed before rendering this scene */
         public set beforeRender(callback: () => void) {
             if (this._onBeforeRenderObserver) {
                 this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
@@ -285,6 +291,7 @@
         public onAfterRenderObservable = new Observable<Scene>();
 
         private _onAfterRenderObserver: Observer<Scene>;
+        /** A function to be executed after rendering this scene */
         public set afterRender(callback: () => void) {
             if (this._onAfterRenderObserver) {
                 this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -393,9 +400,13 @@
         private _onPointerDown: (evt: PointerEvent) => void;
         private _onPointerUp: (evt: PointerEvent) => void;
 
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void;
 
         /**
@@ -413,10 +424,14 @@
             return new Vector2(this._unTranslatedPointerX, this._unTranslatedPointerY);
         }
 
+        /** The distance in pixel that you have to move to prevent some events */
         public static DragMovementThreshold = 10; // in pixels
+        /** Time in milliseconds to wait to raise long press events if button is still pressed */
         public static LongPressDelay = 500; // in milliseconds
+        /** Time in milliseconds with two consecutive clicks will be considered as a double click */
         public static DoubleClickDelay = 300; // in milliseconds
-        public static ExclusiveDoubleClickMode = false; // If you need to check double click without raising a single click at first click, enable this flag
+        /** If you need to check double click without raising a single click at first click, enable this flag */
+        public static ExclusiveDoubleClickMode = false;
 
         private _initClickEvent: (obs1: Observable<PointerInfoPre>, obs2: Observable<PointerInfo>, evt: PointerEvent, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void) => void;
         private _initActionManager: (act: ActionManager, clickInfo: ClickInfo) => ActionManager;
@@ -432,7 +447,8 @@
         private _isButtonPressed = false;
         private _doubleClickOccured = false;
 
-        public cameraToUseForPointers: Camera = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position
+        /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
+        public cameraToUseForPointers: Camera = null;
         private _pointerX: number;
         private _pointerY: number;
         private _unTranslatedPointerX: number;
@@ -441,7 +457,7 @@
         private _previousStartingPointerPosition = new Vector2(0, 0);
         private _startingPointerTime = 0;
         private _previousStartingPointerTime = 0;
-        
+
         // Mirror
         public _mirroredCameraPosition: Vector3;
 
@@ -467,12 +483,12 @@
         }
 
         // Fog
+
+        private _fogEnabled = true;
         /**
         * is fog enabled on this scene.
-        * @type {boolean}
         */
-        private _fogEnabled = true;
-        public set fogEnabled(value : boolean) {
+        public set fogEnabled(value: boolean) {
             if (this._fogEnabled === value) {
                 return;
             }
@@ -481,10 +497,10 @@
         }
         public get fogEnabled(): boolean {
             return this._fogEnabled;
-        }   
+        }
 
         private _fogMode = Scene.FOGMODE_NONE;
-        public set fogMode(value : number) {
+        public set fogMode(value: number) {
             if (this._fogMode === value) {
                 return;
             }
@@ -493,7 +509,7 @@
         }
         public get fogMode(): number {
             return this._fogMode;
-        }  
+        }
 
         public fogColor = new Color3(0.2, 0.2, 0.3);
         public fogDensity = 0.1;
@@ -506,7 +522,7 @@
         * @type {boolean}
         */
         private _shadowsEnabled = true;
-        public set shadowsEnabled(value : boolean) {
+        public set shadowsEnabled(value: boolean) {
             if (this._shadowsEnabled === value) {
                 return;
             }
@@ -515,14 +531,14 @@
         }
         public get shadowsEnabled(): boolean {
             return this._shadowsEnabled;
-        }       
+        }
 
         /**
         * is light enabled on this scene.
         * @type {boolean}
         */
         private _lightsEnabled = true;
-        public set lightsEnabled(value : boolean) {
+        public set lightsEnabled(value: boolean) {
             if (this._lightsEnabled === value) {
                 return;
             }
@@ -542,13 +558,11 @@
         public lights = new Array<Light>();
 
         // Cameras
-        /**
-        * All of the cameras added to this scene.
-        * @see BABYLON.Camera
-        * @type {BABYLON.Camera[]}
-        */
+        /** All of the cameras added to this scene. */
         public cameras = new Array<Camera>();
+        /** All of the active cameras added to this scene. */
         public activeCameras = new Array<Camera>();
+        /** The current active camera */
         public activeCamera: Camera;
 
         // Meshes
@@ -566,6 +580,7 @@
         public multiMaterials = new Array<MultiMaterial>();
         private _defaultMaterial: Material;
 
+        /** The default material used on meshes when no material is affected */
         public get defaultMaterial(): Material {
             if (!this._defaultMaterial) {
                 this._defaultMaterial = new StandardMaterial("default material", this);
@@ -574,13 +589,14 @@
             return this._defaultMaterial;
         }
 
+        /** The default material used on meshes when no material is affected */
         public set defaultMaterial(value: Material) {
             this._defaultMaterial = value;
         }
 
         // Textures
         private _texturesEnabled = true;
-        public set texturesEnabled(value : boolean) {
+        public set texturesEnabled(value: boolean) {
             if (this._texturesEnabled === value) {
                 return;
             }
@@ -590,7 +606,7 @@
 
         public get texturesEnabled(): boolean {
             return this._texturesEnabled;
-        }     
+        }
 
         public textures = new Array<BaseTexture>();
 
@@ -608,7 +624,7 @@
 
         // Skeletons
         private _skeletonsEnabled = true;
-        public set skeletonsEnabled(value : boolean) {
+        public set skeletonsEnabled(value: boolean) {
             if (this._skeletonsEnabled === value) {
                 return;
             }
@@ -618,7 +634,7 @@
 
         public get skeletonsEnabled(): boolean {
             return this._skeletonsEnabled;
-        }       
+        }
 
         public skeletons = new Array<Skeleton>();
 
@@ -633,6 +649,7 @@
         public collisionsEnabled = true;
         private _workerCollisions;
         public collisionCoordinator: ICollisionCoordinator;
+        /** Defines the gravity applied to this scene */
         public gravity = new Vector3(0, -9.807, 0);
 
         // Postprocesses
@@ -742,13 +759,13 @@
         private _sceneUbo: UniformBuffer;
 
         private _pickWithRayInverseMatrix: Matrix;
-        
+
         private _boundingBoxRenderer: BoundingBoxRenderer;
         private _outlineRenderer: OutlineRenderer;
 
         private _viewMatrix: Matrix;
         private _projectionMatrix: Matrix;
-        
+
         private _frustumPlanes: Plane[];
         public get frustumPlanes(): Plane[] {
             return this._frustumPlanes;
@@ -1040,7 +1057,7 @@
             this._delayedSimpleClick = (btn: number, clickInfo: ClickInfo, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void) => {
                 // double click delay is over and that no double click has been raised since, or the 2 consecutive keys pressed are different
                 if ((new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay && !this._doubleClickOccured) ||
-                btn !== this._previousButtonPressed ) {
+                    btn !== this._previousButtonPressed) {
                     this._doubleClickOccured = false;
                     clickInfo.singleClick = true;
                     clickInfo.ignore = false;
@@ -1049,99 +1066,79 @@
             }
 
             this._initClickEvent = (obs1: Observable<PointerInfoPre>, obs2: Observable<PointerInfo>, evt: PointerEvent, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void): void => {
-                    let clickInfo = new ClickInfo();
-                    this._currentPickResult = null;
-                    let act;
-
-                    let checkPicking = obs1.hasSpecificMask(PointerEventTypes.POINTERPICK) || obs2.hasSpecificMask(PointerEventTypes.POINTERPICK)
-                                    || obs1.hasSpecificMask(PointerEventTypes.POINTERTAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERTAP)
-                                    || obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-                    if (!checkPicking && BABYLON.ActionManager && ActionManager.HasPickTriggers) {
-                        act = this._initActionManager(act, clickInfo);
-                        if (act)
-                            checkPicking = act.hasPickTriggers;
-                    }
-                    if (checkPicking) {
-                        let btn = evt.button;
-                        clickInfo.hasSwiped = Math.abs(this._startingPointerPosition.x - this._pointerX) > Scene.DragMovementThreshold ||
-                                              Math.abs(this._startingPointerPosition.y - this._pointerY) > Scene.DragMovementThreshold;
-
-                        if (!clickInfo.hasSwiped) {
-                            let checkSingleClickImmediately = !Scene.ExclusiveDoubleClickMode;
-
-                            if (!checkSingleClickImmediately) {
-                                checkSingleClickImmediately = !obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) &&
-                                                              !obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-
-                                if (checkSingleClickImmediately && !ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
-                                    act = this._initActionManager(act, clickInfo);
-                                    if (act)
-                                        checkSingleClickImmediately = !act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
-                                }
+                let clickInfo = new ClickInfo();
+                this._currentPickResult = null;
+                let act;
+
+                let checkPicking = obs1.hasSpecificMask(PointerEventTypes.POINTERPICK) || obs2.hasSpecificMask(PointerEventTypes.POINTERPICK)
+                    || obs1.hasSpecificMask(PointerEventTypes.POINTERTAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERTAP)
+                    || obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+                if (!checkPicking && BABYLON.ActionManager && ActionManager.HasPickTriggers) {
+                    act = this._initActionManager(act, clickInfo);
+                    if (act)
+                        checkPicking = act.hasPickTriggers;
+                }
+                if (checkPicking) {
+                    let btn = evt.button;
+                    clickInfo.hasSwiped = Math.abs(this._startingPointerPosition.x - this._pointerX) > Scene.DragMovementThreshold ||
+                        Math.abs(this._startingPointerPosition.y - this._pointerY) > Scene.DragMovementThreshold;
+
+                    if (!clickInfo.hasSwiped) {
+                        let checkSingleClickImmediately = !Scene.ExclusiveDoubleClickMode;
+
+                        if (!checkSingleClickImmediately) {
+                            checkSingleClickImmediately = !obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) &&
+                                !obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+
+                            if (checkSingleClickImmediately && !ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
+                                act = this._initActionManager(act, clickInfo);
+                                if (act)
+                                    checkSingleClickImmediately = !act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
                             }
+                        }
 
-                            if (checkSingleClickImmediately) {
-                                // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required
-                                if (new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
-                                    btn !== this._previousButtonPressed ) {
-                                        clickInfo.singleClick = true;
-                                        cb(clickInfo, this._currentPickResult);
-                                }
-                            }
-                            // at least one double click is required to be check and exclusive double click is enabled
-                            else {
-                                // wait that no double click has been raised during the double click delay
-                                this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                this._delayedSimpleClickTimeout = window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), Scene.DoubleClickDelay);
+                        if (checkSingleClickImmediately) {
+                            // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required
+                            if (new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
+                                btn !== this._previousButtonPressed) {
+                                clickInfo.singleClick = true;
+                                cb(clickInfo, this._currentPickResult);
                             }
+                        }
+                        // at least one double click is required to be check and exclusive double click is enabled
+                        else {
+                            // wait that no double click has been raised during the double click delay
+                            this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                            this._delayedSimpleClickTimeout = window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), Scene.DoubleClickDelay);
+                        }
 
-                            let checkDoubleClick = obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) ||
-                                                   obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-                            if (!checkDoubleClick && ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)){
-                                act = this._initActionManager(act, clickInfo);
-                                if (act)
-                                    checkDoubleClick = act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
-                            }
-                            if (checkDoubleClick) {
-                                // two successive keys pressed are equal, double click delay is not over and double click has not just occurred
-                                if (btn === this._previousButtonPressed &&
-                                    new Date().getTime() - this._previousStartingPointerTime < Scene.DoubleClickDelay &&
-                                    !this._doubleClickOccured
-                                ) {
-                                    // pointer has not moved for 2 clicks, it's a double click
-                                    if (!clickInfo.hasSwiped &&
-                                        Math.abs(this._previousStartingPointerPosition.x - this._startingPointerPosition.x) < Scene.DragMovementThreshold &&
-                                        Math.abs(this._previousStartingPointerPosition.y - this._startingPointerPosition.y) < Scene.DragMovementThreshold) {
-                                        this._previousStartingPointerTime = 0;
-                                        this._doubleClickOccured = true;
-                                        clickInfo.doubleClick = true;
-                                        clickInfo.ignore = false;
-                                        if (Scene.ExclusiveDoubleClickMode && this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout)
-                                            this._previousDelayedSimpleClickTimeout.clearTimeout();
-                                        this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                        cb(clickInfo, this._currentPickResult);
-                                    }
-                                    // if the two successive clicks are too far, it's just two simple clicks
-                                    else {
-                                        this._doubleClickOccured = false;
-                                        this._previousStartingPointerTime = this._startingPointerTime;
-                                        this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
-                                        this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
-                                        this._previousButtonPressed = btn;
-                                        this._previousHasSwiped = clickInfo.hasSwiped;
-                                        if (Scene.ExclusiveDoubleClickMode){
-                                            if (this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout) {
-                                                this._previousDelayedSimpleClickTimeout.clearTimeout();
-                                            }
-                                            this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                            cb(clickInfo, this._previousPickResult);
-                                        }
-                                        else {
-                                            cb(clickInfo, this._currentPickResult);
-                                        }
-                                    }
+                        let checkDoubleClick = obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) ||
+                            obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+                        if (!checkDoubleClick && ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
+                            act = this._initActionManager(act, clickInfo);
+                            if (act)
+                                checkDoubleClick = act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
+                        }
+                        if (checkDoubleClick) {
+                            // two successive keys pressed are equal, double click delay is not over and double click has not just occurred
+                            if (btn === this._previousButtonPressed &&
+                                new Date().getTime() - this._previousStartingPointerTime < Scene.DoubleClickDelay &&
+                                !this._doubleClickOccured
+                            ) {
+                                // pointer has not moved for 2 clicks, it's a double click
+                                if (!clickInfo.hasSwiped &&
+                                    Math.abs(this._previousStartingPointerPosition.x - this._startingPointerPosition.x) < Scene.DragMovementThreshold &&
+                                    Math.abs(this._previousStartingPointerPosition.y - this._startingPointerPosition.y) < Scene.DragMovementThreshold) {
+                                    this._previousStartingPointerTime = 0;
+                                    this._doubleClickOccured = true;
+                                    clickInfo.doubleClick = true;
+                                    clickInfo.ignore = false;
+                                    if (Scene.ExclusiveDoubleClickMode && this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout)
+                                        this._previousDelayedSimpleClickTimeout.clearTimeout();
+                                    this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                                    cb(clickInfo, this._currentPickResult);
                                 }
-                                // just the first click of the double has been raised
+                                // if the two successive clicks are too far, it's just two simple clicks
                                 else {
                                     this._doubleClickOccured = false;
                                     this._previousStartingPointerTime = this._startingPointerTime;
@@ -1149,12 +1146,32 @@
                                     this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
                                     this._previousButtonPressed = btn;
                                     this._previousHasSwiped = clickInfo.hasSwiped;
+                                    if (Scene.ExclusiveDoubleClickMode) {
+                                        if (this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout) {
+                                            this._previousDelayedSimpleClickTimeout.clearTimeout();
+                                        }
+                                        this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                                        cb(clickInfo, this._previousPickResult);
+                                    }
+                                    else {
+                                        cb(clickInfo, this._currentPickResult);
+                                    }
                                 }
                             }
+                            // just the first click of the double has been raised
+                            else {
+                                this._doubleClickOccured = false;
+                                this._previousStartingPointerTime = this._startingPointerTime;
+                                this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
+                                this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
+                                this._previousButtonPressed = btn;
+                                this._previousHasSwiped = clickInfo.hasSwiped;
+                            }
                         }
                     }
-                    clickInfo.ignore = true;
-                    cb(clickInfo, this._currentPickResult);
+                }
+                clickInfo.ignore = true;
+                cb(clickInfo, this._currentPickResult);
             };
 
             var spritePredicate = (sprite: Sprite): boolean => {
@@ -1296,9 +1313,9 @@
                                     if (this._isButtonPressed &&
                                         ((new Date().getTime() - this._startingPointerTime) > Scene.LongPressDelay) &&
                                         (Math.abs(this._startingPointerPosition.x - this._pointerX) < Scene.DragMovementThreshold &&
-                                         Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold)) {
-                                            this._startingPointerTime = 0;
-                                            actionManager.processTrigger(ActionManager.OnLongPressTrigger, ActionEvent.CreateNew(pickResult.pickedMesh, evt));
+                                            Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold)) {
+                                        this._startingPointerTime = 0;
+                                        actionManager.processTrigger(ActionManager.OnLongPressTrigger, ActionEvent.CreateNew(pickResult.pickedMesh, evt));
                                     }
                                 }
                             }).bind(this), Scene.LongPressDelay);
@@ -1350,7 +1367,7 @@
 
                 this._updatePointerPosition(evt);
 
-                this._initClickEvent(this.onPrePointerObservable, this.onPointerObservable,  evt, (function(clickInfo, pickResult){
+                this._initClickEvent(this.onPrePointerObservable, this.onPointerObservable, evt, (function (clickInfo, pickResult) {
                     // PreObservable support
                     if (this.onPrePointerObservable.hasObservers()) {
                         if (!clickInfo.ignore) {
@@ -1426,7 +1443,7 @@
                         }
                     }
                     if (this._pickedDownMesh &&
-                        this._pickedDownMesh.actionManager && 
+                        this._pickedDownMesh.actionManager &&
                         this._pickedDownMesh.actionManager.hasSpecificTrigger(ActionManager.OnPickOutTrigger) &&
                         this._pickedDownMesh !== this._pickedUpMesh) {
                         this._pickedDownMesh.actionManager.processTrigger(ActionManager.OnPickOutTrigger, ActionEvent.CreateNew(this._pickedDownMesh, evt));
@@ -1653,13 +1670,12 @@
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable): Animatable {
 
-            if(from > to && speedRatio > 0){
+            if (from > to && speedRatio > 0) {
                 speedRatio *= -1;
             }
 
@@ -1889,7 +1905,7 @@
         }
 
         public sortLightsByPriority(): void {
-            if(this.requireLightSorting) {
+            if (this.requireLightSorting) {
                 this.lights.sort(Light.compareLightsPriority);
             }
         }
@@ -2914,9 +2930,9 @@
 
             // Physics
             if (this._physicsEngine) {
-               Tools.StartPerformanceCounter("Physics");
-               this._physicsEngine._step(deltaTime / 1000.0);
-               Tools.EndPerformanceCounter("Physics");
+                Tools.StartPerformanceCounter("Physics");
+                this._physicsEngine._step(deltaTime / 1000.0);
+                Tools.EndPerformanceCounter("Physics");
             }
 
             // Before render
@@ -3489,7 +3505,7 @@
         private _internalMultiPick(rayFunction: (world: Matrix) => Ray, predicate: (mesh: AbstractMesh) => boolean): PickingInfo[] {
             if (!BABYLON.PickingInfo) {
                 return null;
-            }            
+            }
             var pickingInfos = new Array<PickingInfo>();
 
             for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {
@@ -3552,26 +3568,33 @@
             return pickingInfo || new PickingInfo();
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo {
             return this._internalPick(world => this.createPickingRay(x, y, world, camera), predicate, fastCheck);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public pickSprite(x: number, y: number, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo {
             return this._internalPickSprites(this.createPickingRayInCameraSpace(x, y, camera), predicate, fastCheck, camera);
         }
 
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         public pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo {
             return this._internalPick(world => {
                 if (!this._pickWithRayInverseMatrix) {
@@ -3582,18 +3605,22 @@
             }, predicate, fastCheck);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public multiPick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, camera?: Camera): PickingInfo[] {
             return this._internalMultiPick(world => this.createPickingRay(x, y, world, camera), predicate);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="ray">Ray to use</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         public multiPickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean): PickingInfo[] {
             return this._internalMultiPick(world => {
                 if (!this._pickWithRayInverseMatrix) {

+ 0 - 278
tests/Tools/Jasmine/ObservableArrayTest.js

@@ -1,278 +0,0 @@
-/// <reference path="../../../src/tools/babylon.observable.ts" />
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var JasmineTest;
-(function (JasmineTest) {
-    var ObservableArray = BABYLON.ObservableArray;
-    var ArrayChanged = BABYLON.ArrayChanged;
-    var PropertyChangedBase = BABYLON.PropertyChangedBase;
-    var Customer = (function (_super) {
-        __extends(Customer, _super);
-        function Customer(firstName, lastName) {
-            _super.call(this);
-            this._firstName = firstName;
-            this._lastName = lastName;
-        }
-        Object.defineProperty(Customer.prototype, "firstName", {
-            get: function () {
-                return this._firstName;
-            },
-            set: function (value) {
-                if (this._firstName === value) {
-                    return;
-                }
-                var old = this._firstName;
-                var oldDN = this.displayName;
-                this._firstName = value;
-                this.onPropertyChanged("firstName", old, value);
-                this.onPropertyChanged("displayName", oldDN, this.displayName);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Customer.prototype, "lastName", {
-            get: function () {
-                return this._lastName;
-            },
-            set: function (value) {
-                if (this._lastName === value) {
-                    return;
-                }
-                var old = this._lastName;
-                var oldDN = this.displayName;
-                this._lastName = value;
-                this.onPropertyChanged("lastName", old, value);
-                this.onPropertyChanged("displayName", oldDN, this.displayName);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Customer.prototype, "displayName", {
-            get: function () {
-                return this.firstName + " " + this.lastName;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return Customer;
-    }(PropertyChangedBase));
-    describe("Tools - ObservableArray", function () {
-        it("Push", function () {
-            var oa = new ObservableArray(true);
-            oa.push(new Customer("loic", "baumann"));
-            oa.propertyChanged.add(function (e, c) {
-                expect(e.oldValue).toBe(1, "PropChanged length is bad");
-                expect(e.newValue).toBe(2, "PropChanged length is bad");
-            });
-            oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe(ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-                expect(e.newItems.length).toBe(1);
-                var item = e.newItems[0];
-                expect(item.index).toEqual(1);
-                expect(item.value.firstName).toBe("david");
-                expect(e.newStartingIndex).toBe(1);
-            });
-            oa.push(new Customer("david", "catuhe"));
-            expect(oa.length).toBe(2);
-            var item = oa.getAt(1);
-            expect(item).toBeDefined();
-            expect(item.firstName).toBe("david");
-            var triggerCounter = 0;
-            oa.watchedObjectChanged.add(function (e, c) {
-                if (triggerCounter === 0) {
-                    expect(e.propertyChanged.propertyName).toBe("firstName");
-                    expect(e.propertyChanged.oldValue).toBe("david");
-                    expect(e.propertyChanged.newValue).toBe("delta");
-                    ++triggerCounter;
-                }
-                else {
-                    expect(e.propertyChanged.propertyName).toBe("displayName");
-                    expect(e.propertyChanged.oldValue).toBe("david catuhe");
-                    expect(e.propertyChanged.newValue).toBe("delta catuhe");
-                    ++triggerCounter;
-                }
-            });
-        });
-        it("SetAt/GetAt", function () {
-            var oa = new ObservableArray(true);
-            var propChangedCount = 0;
-            var co = oa.propertyChanged.add(function (e, c) {
-                if (e.propertyName !== "length") {
-                    return;
-                }
-                expect(e.oldValue).toBe(e.newValue - ((e.oldValue === 3) ? 2 : 1), "bad length value reported in PropChanged");
-                ++propChangedCount;
-                expect(propChangedCount).toBeLessThan(5, "PropChanged notif sent during illegal item insertion");
-            });
-            var triggerCount = 0;
-            var aco = oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe(ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-                switch (triggerCount) {
-                    case 0:
-                        expect(e.newItems.length).toBe(1);
-                        expect(e.newItems[0].index).toEqual(0);
-                        expect(e.newItems[0].value.firstName).toEqual("Mike");
-                        expect(e.newStartingIndex).toBe(0);
-                        break;
-                    case 1:
-                        expect(e.newItems.length).toBe(1);
-                        expect(e.newItems[0].index).toEqual(1);
-                        expect(e.newItems[0].value.firstName).toEqual("Steven");
-                        expect(e.newStartingIndex).toBe(1);
-                        break;
-                    case 2:
-                        expect(e.newItems.length).toBe(1);
-                        expect(e.newItems[0].index).toEqual(2);
-                        expect(e.newItems[0].value.firstName).toEqual("John");
-                        expect(e.newStartingIndex).toBe(2);
-                        break;
-                    case 3:
-                        expect(e.newItems.length).toBe(1);
-                        expect(e.newItems[0].index).toEqual(4);
-                        expect(e.newItems[0].value.firstName).toEqual("Matthew");
-                        expect(e.newStartingIndex).toBe(4);
-                        break;
-                    default:
-                        fail("arrayChanged called abnormally");
-                }
-                ++triggerCount;
-            });
-            oa.setAt(0, new Customer("Mike", "Portnoy"));
-            oa.setAt(1, new Customer("Steven", "Wilson"));
-            oa.setAt(2, new Customer("John", "Petrucci"));
-            oa.setAt(4, new Customer("Matthew", "Bellamy"));
-            oa.setAt(-10, new Customer("Hilary", "Hahn"));
-            oa.propertyChanged.remove(co);
-            oa.arrayChanged.remove(aco);
-            expect(oa.length).toBe(5);
-            expect(oa.getAt(0).firstName).toBe("Mike");
-            expect(oa.getAt(1).firstName).toBe("Steven");
-            expect(oa.getAt(2).firstName).toBe("John");
-            expect(oa.getAt(4).firstName).toBe("Matthew");
-            triggerCount = 0;
-            oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe((triggerCount < 2) ? ArrayChanged.changedItemAction : ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-                switch (triggerCount) {
-                    case 0:
-                        expect(e.changedItems.length).toBe(1);
-                        expect(e.changedItems[0].index).toEqual(0);
-                        expect(e.changedItems[0].value.firstName).toEqual("MP");
-                        expect(e.changedStartingIndex).toBe(0);
-                        break;
-                    case 1:
-                        expect(e.changedItems.length).toBe(1);
-                        expect(e.changedItems[0].index).toEqual(1);
-                        expect(e.changedItems[0].value.firstName).toEqual("SW");
-                        expect(e.changedStartingIndex).toBe(1);
-                        break;
-                    case 2:
-                        expect(e.newItems.length).toBe(1);
-                        expect(e.newItems[0].index).toEqual(3);
-                        expect(e.newItems[0].value.firstName).toEqual("JP");
-                        expect(e.newStartingIndex).toBe(3);
-                        break;
-                }
-                ++triggerCount;
-            });
-            var cust0 = new Customer("MP", "Portnoy");
-            var cust1 = new Customer("SW", "Wilson");
-            var cust3 = new Customer("JP", "Petrucci");
-            oa.setAt(0, cust0);
-            oa.setAt(1, cust1);
-            oa.setAt(3, cust3);
-            var triggerCounter = 0;
-            var propTriggered = false;
-            oa.watchedObjectChanged.add(function (e, c) {
-                propTriggered = true;
-                if (e.propertyChanged.propertyName === "firstName") {
-                    expect(e.propertyChanged.newValue).not.toBe("MP");
-                    expect(e.propertyChanged.newValue).not.toBe("SW");
-                    expect(e.propertyChanged.newValue).not.toBe("JP");
-                }
-                if (triggerCounter === 0) {
-                    expect(e.propertyChanged.propertyName).toBe("firstName");
-                    expect(e.propertyChanged.oldValue).toBe("MP");
-                    expect(e.propertyChanged.newValue).toBe("BestDrummerInDaWorld");
-                    ++triggerCounter;
-                }
-                else {
-                    expect(e.propertyChanged.propertyName).toBe("displayName");
-                    expect(e.propertyChanged.oldValue).toBe("MP Portnoy");
-                    expect(e.propertyChanged.newValue).toBe("BestDrummerInDaWorld Portnoy");
-                    ++triggerCounter;
-                }
-            });
-            cust0.firstName = "BestDrummerInDaWorld";
-            expect(propTriggered).toBe(true, "no WatchedObjectChanged was called, not ok!");
-        });
-        it("Pop", function () {
-            var oa = new ObservableArray(true);
-            oa.push(new Customer("Myles", "Kennedy"));
-            oa.propertyChanged.add(function (e, c) {
-                expect(e.oldValue).toBe(1);
-                expect(e.newValue).toBe(0);
-            });
-            oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe(ArrayChanged.removedItemsAction);
-                expect(e.removedItems.length).toBe(1);
-                expect(e.removedItems[0].index).toEqual(0);
-                expect(e.removedItems[0].value.firstName).toEqual("Myles");
-                expect(e.removedStartingIndex).toBe(0);
-            });
-            var pop = oa.pop();
-            expect(pop.firstName).toBe("Myles");
-            oa.watchedObjectChanged.add(function (e, c) {
-                fail("watchedObject shouldn't be called as only a removed object had a property changed");
-            });
-            pop.firstName = "MK";
-        });
-        it("Concat", function () {
-            var oa = new ObservableArray(false);
-            oa.push("item0", "item1", "item2");
-            oa.setAt(4, "item4");
-            var noa = oa.concat("pipo0", "pipo1", "pipo2");
-            var res = ["item0", "item1", "item2", "item4", "pipo0", "pipo1", "pipo2"];
-            var i = 0;
-            noa.forEach(function (v) {
-                expect(v).toBe(res[i++]);
-            });
-            expect(noa.length).toBe(8);
-        });
-        it("Shift", function () {
-            var oa = new ObservableArray(false);
-            oa.push("item0", "item1", "item2");
-            oa.propertyChanged.add(function (e, c) {
-                expect(e.oldValue).toBe(3);
-                expect(e.newValue).toBe(2);
-            });
-            oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe(ArrayChanged.replacedArrayAction);
-                expect(e.removedItems.length).toBe(1);
-                expect(e.removedItems[0]).toEqual({ index: 0, value: "item0" });
-                expect(oa.getAt(0)).toEqual("item1");
-                expect(oa.getAt(1)).toEqual("item2");
-                expect(e.removedStartingIndex).toBe(0);
-            });
-            oa.shift();
-        });
-        it("Sort", function () {
-            var oa = new ObservableArray(false);
-            oa.push(3, 2, 4, 1);
-            oa.propertyChanged.add(function (e, c) {
-                fail("no propertyChanged should be fired");
-            });
-            oa.arrayChanged.add(function (e, c) {
-                expect(e.action).toBe(ArrayChanged.replacedArrayAction);
-                expect(oa.getAt(0)).toEqual(1);
-                expect(oa.getAt(1)).toEqual(2);
-                expect(oa.getAt(2)).toEqual(3);
-                expect(oa.getAt(3)).toEqual(4);
-            });
-            oa.sort(function (a, b) { return a - b; });
-        });
-    });
-})(JasmineTest || (JasmineTest = {}));
-//# sourceMappingURL=ObservableArrayTest.js.map

+ 0 - 344
tests/Tools/Jasmine/ObservableArrayTest.ts

@@ -1,344 +0,0 @@
-/// <reference path="../../../src/tools/babylon.observable.ts" />
-
-module JasmineTest {
-    import ObservableArray = BABYLON.ObservableArray;
-    import ArrayChanged = BABYLON.ArrayChanged;
-    import PropertyChangedBase = BABYLON.PropertyChangedBase;
-
-    class Customer extends PropertyChangedBase {
-
-        constructor(firstName: string, lastName: string) {
-            super();
-            this._firstName = firstName;
-            this._lastName = lastName;
-        }
-
-        public get firstName(): string {
-            return this._firstName;
-        }
-
-        public set firstName(value: string) {
-            if (this._firstName === value) {
-                return;
-            }
-
-            let old = this._firstName;
-            let oldDN = this.displayName;
-            this._firstName = value;
-
-            this.onPropertyChanged("firstName", old, value);
-            this.onPropertyChanged("displayName", oldDN, this.displayName);
-        }
-
-        public get lastName(): string {
-            return this._lastName;
-        }
-
-        public set lastName(value: string) {
-            if (this._lastName === value) {
-                return;
-            }
-
-            let old = this._lastName;
-            let oldDN = this.displayName;
-            this._lastName = value;
-
-            this.onPropertyChanged("lastName", old, value);
-            this.onPropertyChanged("displayName", oldDN, this.displayName);
-        }
-
-        public get displayName(): string {
-            return this.firstName + " " + this.lastName;
-        }
-
-        private _firstName: string;
-        private _lastName: string;
-
-    }
-
-    describe("Tools - ObservableArray",
-        () => {
-
-            it("Push",
-                () => {
-
-                    let oa = new ObservableArray<Customer>(true);
-                    oa.push(new Customer("loic", "baumann"));
-
-                    oa.propertyChanged.add((e, c) => {
-                        expect(e.oldValue).toBe(1, "PropChanged length is bad");
-                        expect(e.newValue).toBe(2, "PropChanged length is bad");
-                    });
-                    oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe(ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-                        expect(e.newItems.length).toBe(1);
-                        let item = e.newItems[0];
-                        expect(item.index).toEqual(1);
-                        expect(item.value.firstName).toBe("david");
-
-                        expect(e.newStartingIndex).toBe(1);
-                    });
-
-                    oa.push(new Customer("david", "catuhe"));
-
-                    expect(oa.length).toBe(2);
-                    let item = oa.getAt(1);
-                    expect(item).toBeDefined();
-                    expect(item.firstName).toBe("david");
-
-                    let triggerCounter = 0;
-                    oa.watchedObjectChanged.add((e, c) => {
-                        if (triggerCounter === 0) {
-                            expect(e.propertyChanged.propertyName).toBe("firstName");
-                            expect(e.propertyChanged.oldValue).toBe("david");
-                            expect(e.propertyChanged.newValue).toBe("delta");
-                            ++triggerCounter;
-                        } else {
-                            expect(e.propertyChanged.propertyName).toBe("displayName");
-                            expect(e.propertyChanged.oldValue).toBe("david catuhe");
-                            expect(e.propertyChanged.newValue).toBe("delta catuhe");
-                            ++triggerCounter;
-                        }
-                    });
-                }
-            );
-
-
-            it("SetAt/GetAt",
-                () => {
-
-                    let oa = new ObservableArray<Customer>(true);
-
-                    let propChangedCount = 0;
-                    let co = oa.propertyChanged.add((e, c) => {
-                        if (e.propertyName !== "length") {
-                            return;
-                        }
-                        expect(e.oldValue).toBe(e.newValue - ((e.oldValue===3) ? 2 : 1), "bad length value reported in PropChanged");
-                        ++propChangedCount;
-
-                        expect(propChangedCount).toBeLessThan(5, "PropChanged notif sent during illegal item insertion");
-                    });
-
-                    let triggerCount = 0;
-                    let aco = oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe(ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-
-                        switch (triggerCount) {
-                            case 0:
-                                expect(e.newItems.length).toBe(1);
-                                expect(e.newItems[0].index).toEqual(0);
-                                expect(e.newItems[0].value.firstName).toEqual("Mike");
-                                expect(e.newStartingIndex).toBe(0);
-                                break;
-
-                            case 1:
-                                expect(e.newItems.length).toBe(1);
-                                expect(e.newItems[0].index).toEqual(1);
-                                expect(e.newItems[0].value.firstName).toEqual("Steven");
-                                expect(e.newStartingIndex).toBe(1);
-                                break;
-
-                            case 2:
-                                expect(e.newItems.length).toBe(1);
-                                expect(e.newItems[0].index).toEqual(2);
-                                expect(e.newItems[0].value.firstName).toEqual("John");
-                                expect(e.newStartingIndex).toBe(2);
-                                break;
-
-                            case 3:
-                                expect(e.newItems.length).toBe(1);
-                                expect(e.newItems[0].index).toEqual(4);
-                                expect(e.newItems[0].value.firstName).toEqual("Matthew");
-                                expect(e.newStartingIndex).toBe(4);
-                                break;
-                            default:
-                                fail("arrayChanged called abnormally");
-                        }
-
-                        ++triggerCount;
-                    });
-
-                    oa.setAt(0, new Customer("Mike", "Portnoy"));
-                    oa.setAt(1, new Customer("Steven", "Wilson"));
-                    oa.setAt(2, new Customer("John", "Petrucci"));
-                    oa.setAt(4, new Customer("Matthew", "Bellamy"));
-                    oa.setAt(-10, new Customer("Hilary", "Hahn"));
-
-                    oa.propertyChanged.remove(co);
-                    oa.arrayChanged.remove(aco);
-
-                    expect(oa.length).toBe(5);
-                    expect(oa.getAt(0).firstName).toBe("Mike");
-                    expect(oa.getAt(1).firstName).toBe("Steven");
-                    expect(oa.getAt(2).firstName).toBe("John");
-                    expect(oa.getAt(4).firstName).toBe("Matthew");
-
-                    triggerCount = 0;
-                    oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe((triggerCount < 2) ? ArrayChanged.changedItemAction : ArrayChanged.newItemsAction, "Wrong ArrayChanged action");
-
-                        switch (triggerCount) {
-                            case 0:
-                                expect(e.changedItems.length).toBe(1);
-                                expect(e.changedItems[0].index).toEqual(0);
-                                expect(e.changedItems[0].value.firstName).toEqual("MP");
-                                expect(e.changedStartingIndex).toBe(0);
-                                break;
-
-                            case 1:
-                                expect(e.changedItems.length).toBe(1);
-                                expect(e.changedItems[0].index).toEqual(1);
-                                expect(e.changedItems[0].value.firstName).toEqual("SW");
-                                expect(e.changedStartingIndex).toBe(1);
-                                break;
-
-                            case 2:
-                                expect(e.newItems.length).toBe(1);
-                                expect(e.newItems[0].index).toEqual(3);
-                                expect(e.newItems[0].value.firstName).toEqual("JP");
-                                expect(e.newStartingIndex).toBe(3);
-                                break;
-                        }
-
-                        ++triggerCount;
-                    });
-
-
-                    let cust0 = new Customer("MP", "Portnoy");
-                    let cust1 = new Customer("SW", "Wilson");
-                    let cust3 = new Customer("JP", "Petrucci");
-
-                    oa.setAt(0, cust0);
-                    oa.setAt(1, cust1);
-                    oa.setAt(3, cust3);
-
-                    let triggerCounter = 0;
-                    let propTriggered = false;
-                    oa.watchedObjectChanged.add((e, c) => {
-                        propTriggered = true;
-                        if (e.propertyChanged.propertyName === "firstName") {
-                            expect(e.propertyChanged.newValue).not.toBe("MP");
-                            expect(e.propertyChanged.newValue).not.toBe("SW");
-                            expect(e.propertyChanged.newValue).not.toBe("JP");
-                        }
-
-                        if (triggerCounter === 0) {
-                            expect(e.propertyChanged.propertyName).toBe("firstName");
-                            expect(e.propertyChanged.oldValue).toBe("MP");
-                            expect(e.propertyChanged.newValue).toBe("BestDrummerInDaWorld");
-                            ++triggerCounter;
-                        } else {
-                            expect(e.propertyChanged.propertyName).toBe("displayName");
-                            expect(e.propertyChanged.oldValue).toBe("MP Portnoy");
-                            expect(e.propertyChanged.newValue).toBe("BestDrummerInDaWorld Portnoy");
-                            ++triggerCounter;
-                        }
-                    });
-                    cust0.firstName = "BestDrummerInDaWorld";
-                    expect(propTriggered).toBe(true, "no WatchedObjectChanged was called, not ok!");
-                }
-            );
-
-            it("Pop",
-                () => {
-
-                    let oa = new ObservableArray<Customer>(true);
-
-                    oa.push(new Customer("Myles", "Kennedy"));
-
-                    oa.propertyChanged.add((e, c) => {
-                        expect(e.oldValue).toBe(1);
-                        expect(e.newValue).toBe(0);
-                    });
-                    oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe(ArrayChanged.removedItemsAction);
-                        expect(e.removedItems.length).toBe(1);
-                        expect(e.removedItems[0].index).toEqual(0);
-                        expect(e.removedItems[0].value.firstName).toEqual("Myles");
-                        expect(e.removedStartingIndex).toBe(0);
-                    });
-
-                    let pop = oa.pop();
-                    expect(pop.firstName).toBe("Myles");
-
-                    oa.watchedObjectChanged.add((e, c) => {
-                        fail("watchedObject shouldn't be called as only a removed object had a property changed");
-                    });
-
-                    pop.firstName = "MK";
-                }
-            );
-
-            it("Concat",
-                () => {
-
-                    let oa = new ObservableArray<string>(false);
-
-                    oa.push("item0", "item1", "item2");
-                    oa.setAt(4, "item4");
-
-                    let noa = oa.concat("pipo0", "pipo1", "pipo2");
-
-                    let res = ["item0", "item1", "item2", "item4", "pipo0", "pipo1", "pipo2"];
-                    let i = 0;
-
-                    noa.forEach((v) => {
-                        expect(v).toBe(res[i++]);
-
-                    });
-                    expect(noa.length).toBe(8);
-
-                }
-            );
-
-            it("Shift",
-                () => {
-
-                    let oa = new ObservableArray<string>(false);
-
-                    oa.push("item0", "item1", "item2");
-
-                    oa.propertyChanged.add((e, c) => {
-                        expect(e.oldValue).toBe(3);
-                        expect(e.newValue).toBe(2);
-                    });
-                    oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe(ArrayChanged.replacedArrayAction);
-                        expect(e.removedItems.length).toBe(1);
-                        expect(e.removedItems[0]).toEqual({ index: 0, value: "item0" });
-                        expect(oa.getAt(0)).toEqual("item1");
-                        expect(oa.getAt(1)).toEqual("item2");
-                        expect(e.removedStartingIndex).toBe(0);
-                    });
-
-                    oa.shift();
-
-                }
-            );
-
-
-            it("Sort",
-                () => {
-
-                    let oa = new ObservableArray<number>(false);
-
-                    oa.push(3, 2, 4, 1);
-
-                    oa.propertyChanged.add((e, c) => {
-                        fail("no propertyChanged should be fired");
-                    });
-                    oa.arrayChanged.add((e, c) => {
-                        expect(e.action).toBe(ArrayChanged.replacedArrayAction);
-                        expect(oa.getAt(0)).toEqual(1);
-                        expect(oa.getAt(1)).toEqual(2);
-                        expect(oa.getAt(2)).toEqual(3);
-                        expect(oa.getAt(3)).toEqual(4);
-                    });
-
-                    oa.sort((a, b) => a - b);
-                }
-            );
-    });
-
-}

+ 0 - 137
tests/Tools/Jasmine/ObservableDictionaryTest.js

@@ -1,137 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var JasmineTest;
-(function (JasmineTest) {
-    var ObservableStringDictionary = BABYLON.ObservableStringDictionary;
-    var PropertyChangedBase = BABYLON.PropertyChangedBase;
-    var DictionaryChanged = BABYLON.DictionaryChanged;
-    var Customer = (function (_super) {
-        __extends(Customer, _super);
-        function Customer(firstName, lastName) {
-            _super.call(this);
-            this._firstName = firstName;
-            this._lastName = lastName;
-        }
-        Object.defineProperty(Customer.prototype, "firstName", {
-            get: function () {
-                return this._firstName;
-            },
-            set: function (value) {
-                if (this._firstName === value) {
-                    return;
-                }
-                var old = this._firstName;
-                var oldDN = this.displayName;
-                this._firstName = value;
-                this.onPropertyChanged("firstName", old, value);
-                this.onPropertyChanged("displayName", oldDN, this.displayName);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Customer.prototype, "lastName", {
-            get: function () {
-                return this._lastName;
-            },
-            set: function (value) {
-                if (this._lastName === value) {
-                    return;
-                }
-                var old = this._lastName;
-                var oldDN = this.displayName;
-                this._lastName = value;
-                this.onPropertyChanged("lastName", old, value);
-                this.onPropertyChanged("displayName", oldDN, this.displayName);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Customer.prototype, "displayName", {
-            get: function () {
-                return this.firstName + " " + this.lastName;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return Customer;
-    }(PropertyChangedBase));
-    describe("Tools - ObservableDictionary", function () {
-        it("Add", function () {
-            var oa = new ObservableStringDictionary(true);
-            oa.add("cust0", new Customer("loic", "baumann"));
-            oa.propertyChanged.add(function (e, c) {
-                expect(e.oldValue).toBe(1, "PropChanged length is bad");
-                expect(e.newValue).toBe(2, "PropChanged length is bad");
-            });
-            oa.dictionaryChanged.add(function (e, c) {
-                expect(e.action).toEqual(DictionaryChanged.newItemAction);
-                var item = e.newItem;
-                expect(item.key).toEqual("cust1");
-                expect(item.value.firstName).toEqual("david");
-                expect(item.value.lastName).toEqual("catuhe");
-            });
-            oa.add("cust1", new Customer("david", "catuhe"));
-            expect(oa.count).toBe(2);
-            var cust = oa.get("cust1");
-            expect(cust).toBeDefined();
-            expect(cust.firstName).toEqual("david");
-            expect(cust.lastName).toEqual("catuhe");
-        });
-        it("Remove", function () {
-            var oa = new ObservableStringDictionary(true);
-            var cust0 = new Customer("loic", "baumann");
-            var cust1 = new Customer("david", "catuhe");
-            oa.add("cust0", cust0);
-            oa.add("cust1", cust1);
-            oa.propertyChanged.add(function (e, c) {
-                expect(e.oldValue).toBe(2, "PropChanged length is bad");
-                expect(e.newValue).toBe(1, "PropChanged length is bad");
-            });
-            oa.dictionaryChanged.add(function (e, c) {
-                expect(e.action).toEqual(DictionaryChanged.removedItemAction);
-                var key = e.removedKey;
-                expect(key).toEqual("cust0");
-            });
-            oa.watchedObjectChanged.add(function (e, c) {
-                fail("watchedObject shouldn't be called as only a removed object had a property changed");
-            });
-            expect(oa.count).toBe(2);
-            var cust = oa.get("cust1");
-            expect(cust).toBeDefined();
-            expect(cust.firstName).toEqual("david");
-            expect(cust.lastName).toEqual("catuhe");
-            oa.remove("cust0");
-            cust = oa.get("cust0");
-            expect(cust).toBeUndefined();
-            cust0.firstName = "nockawa";
-        });
-        it("Watched Element", function () {
-            var oa = new ObservableStringDictionary(true);
-            oa.add("cust0", new Customer("loic", "baumann"));
-            oa.add("cust1", new Customer("david", "catuhe"));
-            var triggerCounter = 0;
-            oa.watchedObjectChanged.add(function (e, c) {
-                if (triggerCounter === 0) {
-                    expect(e.key).toBe("cust1");
-                    expect(e.propertyChanged.propertyName).toBe("firstName");
-                    expect(e.propertyChanged.oldValue).toBe("david");
-                    expect(e.propertyChanged.newValue).toBe("delta");
-                    ++triggerCounter;
-                }
-                else {
-                    expect(e.key).toBe("cust1");
-                    expect(e.propertyChanged.propertyName).toBe("displayName");
-                    expect(e.propertyChanged.oldValue).toBe("david catuhe");
-                    expect(e.propertyChanged.newValue).toBe("delta catuhe");
-                    ++triggerCounter;
-                }
-            });
-            var cust = oa.get("cust1");
-            cust.firstName = "delta";
-        });
-    });
-})(JasmineTest || (JasmineTest = {}));
-//# sourceMappingURL=ObservableDictionaryTest.js.map

+ 0 - 163
tests/Tools/Jasmine/ObservableDictionaryTest.ts

@@ -1,163 +0,0 @@
-module JasmineTest {
-    import ObservableStringDictionary = BABYLON.ObservableStringDictionary;
-    import PropertyChangedBase = BABYLON.PropertyChangedBase;
-    import DictionaryChanged = BABYLON.DictionaryChanged;
-
-    class Customer extends  PropertyChangedBase {
-
-        constructor(firstName: string, lastName: string) {
-            super();
-            this._firstName = firstName;
-            this._lastName = lastName;
-        }
-
-        public get firstName(): string {
-            return this._firstName;
-        }
-
-        public set firstName(value: string) {
-            if (this._firstName === value) {
-                return;
-            }
-
-            let old = this._firstName;
-            let oldDN = this.displayName;
-            this._firstName = value;
-
-            this.onPropertyChanged("firstName", old, value);
-            this.onPropertyChanged("displayName", oldDN, this.displayName);
-        }
-
-        public get lastName(): string {
-            return this._lastName;
-        }
-
-        public set lastName(value: string) {
-            if (this._lastName === value) {
-                return;
-            }
-
-            let old = this._lastName;
-            let oldDN = this.displayName;
-            this._lastName = value;
-
-            this.onPropertyChanged("lastName", old, value);
-            this.onPropertyChanged("displayName", oldDN, this.displayName);
-        }
-
-        public get displayName(): string {
-            return this.firstName + " " + this.lastName;
-        }
-
-        private _firstName: string;
-        private _lastName: string;
-
-    }
-
-    describe("Tools - ObservableDictionary",
-        () => {
-
-            it("Add",
-                () => {
-
-                    let oa = new ObservableStringDictionary<Customer>(true);
-                    oa.add("cust0", new Customer("loic", "baumann"));
-
-                    oa.propertyChanged.add((e, c) => {
-                        expect(e.oldValue).toBe(1, "PropChanged length is bad");
-                        expect(e.newValue).toBe(2, "PropChanged length is bad");
-                    });
-                    oa.dictionaryChanged.add((e, c) => {
-                        expect(e.action).toEqual(DictionaryChanged.newItemAction);
-                        let item = e.newItem;
-                        expect(item.key).toEqual("cust1");
-
-                        expect(item.value.firstName).toEqual("david");
-                        expect(item.value.lastName).toEqual("catuhe");
-                    });
-
-                    oa.add("cust1", new Customer("david", "catuhe"));
-
-                    expect(oa.count).toBe(2);
-                    let cust = oa.get("cust1");
-
-                    expect(cust).toBeDefined();
-                    expect(cust.firstName).toEqual("david");
-                    expect(cust.lastName).toEqual("catuhe");
-                }
-            );
-
-            it("Remove",
-                () => {
-
-                    let oa = new ObservableStringDictionary<Customer>(true);
-                    let cust0 = new Customer("loic", "baumann");
-                    let cust1 = new Customer("david", "catuhe");
-
-                    oa.add("cust0", cust0);
-                    oa.add("cust1", cust1);
-
-                    oa.propertyChanged.add((e, c) => {
-                        expect(e.oldValue).toBe(2, "PropChanged length is bad");
-                        expect(e.newValue).toBe(1, "PropChanged length is bad");
-                    });
-
-                    oa.dictionaryChanged.add((e, c) => {
-                        expect(e.action).toEqual(DictionaryChanged.removedItemAction);
-                        let key = e.removedKey;
-                        expect(key).toEqual("cust0");
-                    });
-
-                    oa.watchedObjectChanged.add((e, c) => {
-                        fail("watchedObject shouldn't be called as only a removed object had a property changed");
-                    });
-
-                    expect(oa.count).toBe(2);
-                    let cust = oa.get("cust1");
-
-                    expect(cust).toBeDefined();
-                    expect(cust.firstName).toEqual("david");
-                    expect(cust.lastName).toEqual("catuhe");
-
-                    oa.remove("cust0");
-
-                    cust = oa.get("cust0");
-                    expect(cust).toBeUndefined();
-
-                    cust0.firstName = "nockawa";
-
-                }
-            );
-
-            it("Watched Element",
-                () => {
-
-                    let oa = new ObservableStringDictionary<Customer>(true);
-                    oa.add("cust0", new Customer("loic", "baumann"));
-                    oa.add("cust1", new Customer("david", "catuhe"));
-
-                    let triggerCounter = 0;
-                    oa.watchedObjectChanged.add((e, c) => {
-                        if (triggerCounter === 0) {
-                            expect(e.key).toBe("cust1");
-                            expect(e.propertyChanged.propertyName).toBe("firstName");
-                            expect(e.propertyChanged.oldValue).toBe("david");
-                            expect(e.propertyChanged.newValue).toBe("delta");
-                            ++triggerCounter;
-                        } else {
-                            expect(e.key).toBe("cust1");
-                            expect(e.propertyChanged.propertyName).toBe("displayName");
-                            expect(e.propertyChanged.oldValue).toBe("david catuhe");
-                            expect(e.propertyChanged.newValue).toBe("delta catuhe");
-                            ++triggerCounter;
-                        }
-                    });
-
-                    let cust = oa.get("cust1");
-
-                    cust.firstName = "delta";
-                }
-            );
-        }
-    );
-}

+ 0 - 214
tests/Tools/Jasmine/chutzpah.json

@@ -1,214 +0,0 @@
-{
-    "Compile": {
-        "Mode": "External",
-        "Extensions": [ ".ts" ],
-        "ExtensionsWithNoOutput": [ ".d.ts" ]
-    },
-    "References": [
-
-        { "Path": "../../../src/Math/babylon.math.js" },
-        { "Path": "../../../src/Math/babylon.math.simd.js" },
-        { "Path": "../../../src/Tools/babylon.decorators.js" },
-        { "Path": "../../../src/Tools/babylon.observable.js" },
-        { "Path": "../../../src/Tools/babylon.database.js" },
-        { "Path": "../../../src/Tools/babylon.tools.tga.js" },
-        { "Path": "../../../src/Tools/babylon.tools.dds.js" },
-        { "Path": "../../../src/Tools/babylon.stringDictionary.js" },
-        { "Path": "../../../src/Tools/babylon.smartArray.js" },
-        { "Path": "../../../src/Tools/babylon.dynamicFloatArray.js" },
-        { "Path": "../../../src/Tools/babylon.rectPackingMap.js" },
-        { "Path": "../../../src/Tools/babylon.tools.js" },
-        { "Path": "../../../src/states/babylon.alphaCullingState.js" },
-        { "Path": "../../../src/states/babylon.depthCullingState.js" },
-        { "Path": "../../../src/states/babylon.stencilState.js" },
-        { "Path": "../../../src/babylon.engine.js" },
-        { "Path": "../../../src/babylon.node.js" },
-        { "Path": "../../../src/Tools/babylon.filesInput.js" },
-        { "Path": "../../../src/Collisions/babylon.pickingInfo.js" },
-        { "Path": "../../../src/Culling/babylon.boundingSphere.js" },
-        { "Path": "../../../src/Culling/babylon.boundingBox.js" },
-        { "Path": "../../../src/Culling/babylon.boundingInfo.js" },
-        { "Path": "../../../src/Culling/babylon.ray.js" },
-        { "Path": "../../../src/Mesh/babylon.abstractMesh.js" },
-        { "Path": "../../../src/Lights/babylon.light.js" },
-        { "Path": "../../../src/Lights/babylon.pointLight.js" },
-        { "Path": "../../../src/Lights/babylon.spotLight.js" },
-        { "Path": "../../../src/Lights/babylon.hemisphericLight.js" },
-        { "Path": "../../../src/Lights/babylon.directionalLight.js" },
-        { "Path": "../../../src/Lights/Shadows/babylon.shadowGenerator.js" },
-        { "Path": "../../../src/Collisions/babylon.collider.js" },
-        { "Path": "../../../src/Collisions/babylon.collisionCoordinator.js" },
-        { "Path": "../../../src/Collisions/babylon.collisionWorker.js" },
-        { "Path": "../../../src/Cameras/babylon.camera.js" },
-        { "Path": "../../../src/Cameras/babylon.camerainputsmanager.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.mouse.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.keyboard.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.touch.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.deviceorientation.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.gamepad.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.freecamera.input.virtualjoystick.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.arcrotatecamera.input.keyboard.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.arcrotatecamera.input.mousewheel.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.arcrotatecamera.input.pointers.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.arcrotatecamera.input.gamepad.js" },
-        { "Path": "../../../src/cameras/inputs/babylon.arcrotatecamera.input.vrdeviceorientation.js" },
-        { "Path": "../../../src/Cameras/babylon.targetCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.followCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.freeCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.freeCameraInputsManager.js" },
-        { "Path": "../../../src/Cameras/babylon.touchCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.arcRotateCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.arcRotateCameraInputsManager.js" },
-        { "Path": "../../../src/Cameras/babylon.universalCamera.js" },
-        { "Path": "../../../src/Cameras/babylon.deviceOrientationCamera.js" },
-        { "Path": "../../../src/Tools/babylon.gamepads.js" },
-        { "Path": "../../../src/Cameras/babylon.gamepadCamera.js" },
-        { "Path": "../../../src/Rendering/babylon.renderingManager.js" },
-        { "Path": "../../../src/Rendering/babylon.renderingGroup.js" },
-        { "Path": "../../../src/babylon.scene.js" },
-        { "Path": "../../../src/Mesh/babylon.buffer.js" },
-        { "Path": "../../../src/Mesh/babylon.vertexBuffer.js" },
-        { "Path": "../../../src/Mesh/babylon.instancedMesh.js" },
-        { "Path": "../../../src/Mesh/babylon.mesh.js" },
-        { "Path": "../../../src/Mesh/babylon.meshBuilder.js" },
-        { "Path": "../../../src/Mesh/babylon.groundMesh.js" },
-        { "Path": "../../../src/Mesh/babylon.subMesh.js" },
-        { "Path": "../../../src/Materials/textures/babylon.baseTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.texture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.cubeTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.renderTargetTexture.js" },
-        { "Path": "../../../src/Materials/textures/procedurals/babylon.proceduralTexture.js" },
-        { "Path": "../../../src/Materials/textures/procedurals/babylon.customProceduralTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.mirrorTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.refractionTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.dynamicTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.videoTexture.js" },
-        { "Path": "../../../src/Materials/textures/babylon.mapTexture.js" },
-        { "Path": "../../../src/Materials/babylon.effect.js" },
-        { "Path": "../../../src/Materials/babylon.materialHelper.js" },
-        { "Path": "../../../src/Materials/babylon.fresnelParameters.js" },
-        { "Path": "../../../src/Materials/babylon.material.js" },
-        { "Path": "../../../src/Materials/babylon.standardMaterial.js" },
-        { "Path": "../../../src/Materials/babylon.pbrMaterial.js" },
-        { "Path": "../../../src/Materials/babylon.multiMaterial.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.fontTexture.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.bounding2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.primitiveCollisionManager.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.canvas2dLayoutEngine.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.brushes2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.smartPropertyPrim.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.prim2dBase.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.modelRenderCache.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.renderablePrim2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.shape2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.group2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.wireFrame2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.rectangle2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.sprite2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.text2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.canvas2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.ellipse2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.lines2d.js" },
-        { "Path": "../../../canvas2d/src/Engine/babylon.worldspacecanvas2dNode.js" },
-        { "Path": "../../../src/GUI/babylon.gui.UIElement.js" },
-        { "Path": "../../../src/GUI/babylon.gui.control.js" },
-        { "Path": "../../../src/GUI/babylon.gui.label.js" },
-        { "Path": "../../../src/GUI/babylon.gui.window.js" },
-        { "Path": "../../../src/GUI/babylon.gui.button.js" },
-        { "Path": "../../../src/Loading/babylon.sceneLoader.js" },
-        { "Path": "../../../src/Loading/Plugins/babylon.babylonFileLoader.js" },
-        { "Path": "../../../src/Sprites/babylon.spriteManager.js" },
-        { "Path": "../../../src/Sprites/babylon.sprite.js" },
-        { "Path": "../../../src/Layer/babylon.layer.js" },
-        { "Path": "../../../src/Particles/babylon.particle.js" },
-        { "Path": "../../../src/Particles/babylon.particleSystem.js" },
-        { "Path": "../../../src/Particles/babylon.solidParticle.js" },
-        { "Path": "../../../src/Particles/babylon.solidParticleSystem.js" },
-        { "Path": "../../../src/Animations/babylon.animation.js" },
-        { "Path": "../../../src/Animations/babylon.animatable.js" },
-        { "Path": "../../../src/Animations/babylon.easing.js" },
-        { "Path": "../../../src/Culling/Octrees/babylon.octree.js" },
-        { "Path": "../../../src/Culling/Octrees/babylon.octreeBlock.js" },
-        { "Path": "../../../src/Bones/babylon.bone.js" },
-        { "Path": "../../../src/Bones/babylon.skeleton.js" },
-        { "Path": "../../../src/PostProcess/babylon.postProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.postProcessManager.js" },
-        { "Path": "../../../src/PostProcess/babylon.passPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.blurPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.refractionPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.blackAndWhitePostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.convolutionPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.filterPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.fxaaPostProcess.js" },
-        { "Path": "../../../src/LensFlare/babylon.lensFlare.js" },
-        { "Path": "../../../src/LensFlare/babylon.lensFlareSystem.js" },
-        { "Path": "../../../src/Physics/Plugins/babylon.cannonJSPlugin.js" },
-        { "Path": "../../../src/Physics/Plugins/babylon.oimoJSPlugin.js" },
-        { "Path": "../../../src/Physics/babylon.physicsImpostor.js" },
-        { "Path": "../../../src/Physics/babylon.physicsEngine.js" },
-        { "Path": "../../../src/Physics/babylon.physicsJoint.js" },
-        { "Path": "../../../src/Tools/babylon.sceneSerializer.js" },
-        { "Path": "../../../src/Mesh/babylon.csg.js" },
-        { "Path": "../../../src/PostProcess/babylon.vrDistortionCorrectionPostProcess.js" },
-        { "Path": "../../../src/Tools/babylon.virtualJoystick.js" },
-        { "Path": "../../../src/Cameras/babylon.virtualJoysticksCamera.js" },
-        { "Path": "../../../src/Materials/babylon.shaderMaterial.js" },
-        { "Path": "../../../src/Mesh/babylon.mesh.vertexData.js" },
-        { "Path": "../../../src/PostProcess/babylon.anaglyphPostProcess.js" },
-        { "Path": "../../../src/Tools/babylon.tags.js" },
-        { "Path": "../../../src/Tools/babylon.andOrNotEvaluator.js" },
-        { "Path": "../../../src/PostProcess/RenderPipeline/babylon.postProcessRenderPass.js" },
-        { "Path": "../../../src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.js" },
-        { "Path": "../../../src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.js" },
-        { "Path": "../../../src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.js" },
-        { "Path": "../../../src/PostProcess/babylon.displayPassPostProcess.js" },
-        { "Path": "../../../src/Rendering/babylon.boundingBoxRenderer.js" },
-        { "Path": "../../../src/Actions/babylon.condition.js" },
-        { "Path": "../../../src/Actions/babylon.action.js" },
-        { "Path": "../../../src/Actions/babylon.actionManager.js" },
-        { "Path": "../../../src/Actions/babylon.interpolateValueAction.js" },
-        { "Path": "../../../src/Actions/babylon.directActions.js" },
-        { "Path": "../../../src/Mesh/babylon.geometry.js" },
-        { "Path": "../../../src/Mesh/babylon.linesMesh.js" },
-        { "Path": "../../../src/Rendering/babylon.outlineRenderer.js" },
-        { "Path": "../../../src/Tools/babylon.assetsManager.js" },
-        { "Path": "../../../src/Cameras/VR/babylon.vrCameraMetrics.js" },
-        { "Path": "../../../src/Cameras/VR/babylon.vrDeviceOrientationCamera.js" },
-        { "Path": "../../../src/Cameras/VR/babylon.webVRCamera.js" },
-        { "Path": "../../../src/Tools/babylon.sceneOptimizer.js" },
-        { "Path": "../../../src/Tools/babylon.earcut.js" },
-        { "Path": "../../../src/Mesh/babylon.meshLODLevel.js" },
-        { "Path": "../../../src/Audio/babylon.audioEngine.js" },
-        { "Path": "../../../src/Audio/babylon.sound.js" },
-        { "Path": "../../../src/Audio/babylon.soundtrack.js" },
-        { "Path": "../../../src/Debug/babylon.skeletonViewer.js" },
-        { "Path": "../../../src/Debug/babylon.debugLayer.js" },
-        { "Path": "../../../src/Materials/Textures/babylon.rawTexture.js" },
-        { "Path": "../../../src/Mesh/babylon.polygonMesh.js" },
-        { "Path": "../../../src/Mesh/babylon.meshSimplification.js" },
-        { "Path": "../../../src/Audio/babylon.analyser.js" },
-        { "Path": "../../../src/Rendering/babylon.depthRenderer.js" },
-        { "Path": "../../../src/PostProcess/babylon.ssaoRenderingPipeline.js" },
-        { "Path": "../../../src/PostProcess/babylon.volumetricLightScatteringPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.lensRenderingPipeline.js" },
-        { "Path": "../../../src/PostProcess/babylon.colorCorrectionPostProcess.js" },
-        { "Path": "../../../src/PostProcess/babylon.stereoscopicInterlacePostProcess.js" },
-        { "Path": "../../../src/Cameras/babylon.stereoscopicCameras.js" },
-        { "Path": "../../../src/PostProcess/babylon.hdrRenderingPipeline.js" },
-        { "Path": "../../../src/Rendering/babylon.edgesRenderer.js" },
-        { "Path": "../../../src/Tools/babylon.loadingScreen.js" },
-        { "Path": "../../../src/Probes/babylon.reflectionProbe.js" },
-        { "Path": "../../../src/tools/hdr/babylon.tools.cubemapToSphericalPolynomial.js" },
-        { "Path": "../../../src/tools/hdr/babylon.tools.panoramaToCubemap.js" },
-        { "Path": "../../../src/tools/hdr/babylon.tools.hdr.js" },
-        { "Path": "../../../src/materials/textures/babylon.hdrCubeTexture.js" },
-        { "Path": "../../../src/Materials/Textures/babylon.colorGradingTexture.js" },
-        { "Path": "../../../src/Materials/babylon.colorcurves.js" },
-        { "Path": "./TestClasses.js" }
-    ],
-    "Tests": [
-        {
-            "Includes": [ "*.ts" ]
-        }
-    ]
-}