Kaynağa Gözat

Marking vertex data as number[] | Float32Array

David catuhe 9 yıl önce
ebeveyn
işleme
d5187657c6

+ 189 - 190
dist/preview release/babylon.d.ts

@@ -220,9 +220,9 @@ declare module BABYLON {
         flushFramebuffer(): void;
         restoreDefaultFramebuffer(): void;
         private _resetVertexBufferBinding();
-        createVertexBuffer(vertices: number[]): WebGLBuffer;
+        createVertexBuffer(vertices: number[] | Float32Array): WebGLBuffer;
         createDynamicVertexBuffer(capacity: number): WebGLBuffer;
-        updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: any, offset?: number): void;
+        updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: number[] | Float32Array, offset?: number): void;
         private _resetIndexBufferBinding();
         createIndexBuffer(indices: number[]): WebGLBuffer;
         bindBuffers(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void;
@@ -1183,6 +1183,158 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    class Animatable {
+        target: any;
+        fromFrame: number;
+        toFrame: number;
+        loopAnimation: boolean;
+        speedRatio: number;
+        onAnimationEnd: any;
+        private _localDelayOffset;
+        private _pausedDelay;
+        private _animations;
+        private _paused;
+        private _scene;
+        animationStarted: boolean;
+        constructor(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: any, animations?: any);
+        appendAnimations(target: any, animations: Animation[]): void;
+        getAnimationByTargetProperty(property: string): Animation;
+        reset(): void;
+        pause(): void;
+        restart(): void;
+        stop(): void;
+        _animate(delay: number): boolean;
+    }
+}
+
+declare module BABYLON {
+    class Animation {
+        name: string;
+        targetProperty: string;
+        framePerSecond: number;
+        dataType: number;
+        loopMode: number;
+        private _keys;
+        private _offsetsCache;
+        private _highLimitsCache;
+        private _stopped;
+        _target: any;
+        private _easingFunction;
+        targetPropertyPath: string[];
+        currentFrame: number;
+        allowMatricesInterpolation: boolean;
+        static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Animatable;
+        constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number);
+        reset(): void;
+        isStopped(): boolean;
+        getKeys(): any[];
+        getEasingFunction(): IEasingFunction;
+        setEasingFunction(easingFunction: EasingFunction): void;
+        floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number;
+        quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion;
+        vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3;
+        vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2;
+        color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3;
+        matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number): Matrix;
+        clone(): Animation;
+        setKeys(values: Array<any>): void;
+        private _getKeyValue(value);
+        private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?);
+        animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean;
+        private static _ANIMATIONTYPE_FLOAT;
+        private static _ANIMATIONTYPE_VECTOR3;
+        private static _ANIMATIONTYPE_QUATERNION;
+        private static _ANIMATIONTYPE_MATRIX;
+        private static _ANIMATIONTYPE_COLOR3;
+        private static _ANIMATIONTYPE_VECTOR2;
+        private static _ANIMATIONLOOPMODE_RELATIVE;
+        private static _ANIMATIONLOOPMODE_CYCLE;
+        private static _ANIMATIONLOOPMODE_CONSTANT;
+        static ANIMATIONTYPE_FLOAT: number;
+        static ANIMATIONTYPE_VECTOR3: number;
+        static ANIMATIONTYPE_VECTOR2: number;
+        static ANIMATIONTYPE_QUATERNION: number;
+        static ANIMATIONTYPE_MATRIX: number;
+        static ANIMATIONTYPE_COLOR3: number;
+        static ANIMATIONLOOPMODE_RELATIVE: number;
+        static ANIMATIONLOOPMODE_CYCLE: number;
+        static ANIMATIONLOOPMODE_CONSTANT: number;
+    }
+}
+
+declare module BABYLON {
+    interface IEasingFunction {
+        ease(gradient: number): number;
+    }
+    class EasingFunction implements IEasingFunction {
+        private static _EASINGMODE_EASEIN;
+        private static _EASINGMODE_EASEOUT;
+        private static _EASINGMODE_EASEINOUT;
+        static EASINGMODE_EASEIN: number;
+        static EASINGMODE_EASEOUT: number;
+        static EASINGMODE_EASEINOUT: number;
+        private _easingMode;
+        setEasingMode(easingMode: number): void;
+        getEasingMode(): number;
+        easeInCore(gradient: number): number;
+        ease(gradient: number): number;
+    }
+    class CircleEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class BackEase extends EasingFunction implements IEasingFunction {
+        amplitude: number;
+        constructor(amplitude?: number);
+        easeInCore(gradient: number): number;
+    }
+    class BounceEase extends EasingFunction implements IEasingFunction {
+        bounces: number;
+        bounciness: number;
+        constructor(bounces?: number, bounciness?: number);
+        easeInCore(gradient: number): number;
+    }
+    class CubicEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class ElasticEase extends EasingFunction implements IEasingFunction {
+        oscillations: number;
+        springiness: number;
+        constructor(oscillations?: number, springiness?: number);
+        easeInCore(gradient: number): number;
+    }
+    class ExponentialEase extends EasingFunction implements IEasingFunction {
+        exponent: number;
+        constructor(exponent?: number);
+        easeInCore(gradient: number): number;
+    }
+    class PowerEase extends EasingFunction implements IEasingFunction {
+        power: number;
+        constructor(power?: number);
+        easeInCore(gradient: number): number;
+    }
+    class QuadraticEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class QuarticEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class QuinticEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class SineEase extends EasingFunction implements IEasingFunction {
+        easeInCore(gradient: number): number;
+    }
+    class BezierCurveEase extends EasingFunction implements IEasingFunction {
+        x1: number;
+        y1: number;
+        x2: number;
+        y2: number;
+        constructor(x1?: number, y1?: number, x2?: number, y2?: number);
+        easeInCore(gradient: number): number;
+    }
+}
+
+declare module BABYLON {
     class Analyser {
         SMOOTHING: number;
         FFT_SIZE: number;
@@ -1347,158 +1499,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    class Animatable {
-        target: any;
-        fromFrame: number;
-        toFrame: number;
-        loopAnimation: boolean;
-        speedRatio: number;
-        onAnimationEnd: any;
-        private _localDelayOffset;
-        private _pausedDelay;
-        private _animations;
-        private _paused;
-        private _scene;
-        animationStarted: boolean;
-        constructor(scene: Scene, target: any, fromFrame?: number, toFrame?: number, loopAnimation?: boolean, speedRatio?: number, onAnimationEnd?: any, animations?: any);
-        appendAnimations(target: any, animations: Animation[]): void;
-        getAnimationByTargetProperty(property: string): Animation;
-        reset(): void;
-        pause(): void;
-        restart(): void;
-        stop(): void;
-        _animate(delay: number): boolean;
-    }
-}
-
-declare module BABYLON {
-    class Animation {
-        name: string;
-        targetProperty: string;
-        framePerSecond: number;
-        dataType: number;
-        loopMode: number;
-        private _keys;
-        private _offsetsCache;
-        private _highLimitsCache;
-        private _stopped;
-        _target: any;
-        private _easingFunction;
-        targetPropertyPath: string[];
-        currentFrame: number;
-        allowMatricesInterpolation: boolean;
-        static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Animatable;
-        constructor(name: string, targetProperty: string, framePerSecond: number, dataType: number, loopMode?: number);
-        reset(): void;
-        isStopped(): boolean;
-        getKeys(): any[];
-        getEasingFunction(): IEasingFunction;
-        setEasingFunction(easingFunction: EasingFunction): void;
-        floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number;
-        quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion;
-        vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3;
-        vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2;
-        color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3;
-        matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number): Matrix;
-        clone(): Animation;
-        setKeys(values: Array<any>): void;
-        private _getKeyValue(value);
-        private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?);
-        animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number): boolean;
-        private static _ANIMATIONTYPE_FLOAT;
-        private static _ANIMATIONTYPE_VECTOR3;
-        private static _ANIMATIONTYPE_QUATERNION;
-        private static _ANIMATIONTYPE_MATRIX;
-        private static _ANIMATIONTYPE_COLOR3;
-        private static _ANIMATIONTYPE_VECTOR2;
-        private static _ANIMATIONLOOPMODE_RELATIVE;
-        private static _ANIMATIONLOOPMODE_CYCLE;
-        private static _ANIMATIONLOOPMODE_CONSTANT;
-        static ANIMATIONTYPE_FLOAT: number;
-        static ANIMATIONTYPE_VECTOR3: number;
-        static ANIMATIONTYPE_VECTOR2: number;
-        static ANIMATIONTYPE_QUATERNION: number;
-        static ANIMATIONTYPE_MATRIX: number;
-        static ANIMATIONTYPE_COLOR3: number;
-        static ANIMATIONLOOPMODE_RELATIVE: number;
-        static ANIMATIONLOOPMODE_CYCLE: number;
-        static ANIMATIONLOOPMODE_CONSTANT: number;
-    }
-}
-
-declare module BABYLON {
-    interface IEasingFunction {
-        ease(gradient: number): number;
-    }
-    class EasingFunction implements IEasingFunction {
-        private static _EASINGMODE_EASEIN;
-        private static _EASINGMODE_EASEOUT;
-        private static _EASINGMODE_EASEINOUT;
-        static EASINGMODE_EASEIN: number;
-        static EASINGMODE_EASEOUT: number;
-        static EASINGMODE_EASEINOUT: number;
-        private _easingMode;
-        setEasingMode(easingMode: number): void;
-        getEasingMode(): number;
-        easeInCore(gradient: number): number;
-        ease(gradient: number): number;
-    }
-    class CircleEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class BackEase extends EasingFunction implements IEasingFunction {
-        amplitude: number;
-        constructor(amplitude?: number);
-        easeInCore(gradient: number): number;
-    }
-    class BounceEase extends EasingFunction implements IEasingFunction {
-        bounces: number;
-        bounciness: number;
-        constructor(bounces?: number, bounciness?: number);
-        easeInCore(gradient: number): number;
-    }
-    class CubicEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class ElasticEase extends EasingFunction implements IEasingFunction {
-        oscillations: number;
-        springiness: number;
-        constructor(oscillations?: number, springiness?: number);
-        easeInCore(gradient: number): number;
-    }
-    class ExponentialEase extends EasingFunction implements IEasingFunction {
-        exponent: number;
-        constructor(exponent?: number);
-        easeInCore(gradient: number): number;
-    }
-    class PowerEase extends EasingFunction implements IEasingFunction {
-        power: number;
-        constructor(power?: number);
-        easeInCore(gradient: number): number;
-    }
-    class QuadraticEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class QuarticEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class QuinticEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class SineEase extends EasingFunction implements IEasingFunction {
-        easeInCore(gradient: number): number;
-    }
-    class BezierCurveEase extends EasingFunction implements IEasingFunction {
-        x1: number;
-        y1: number;
-        x2: number;
-        y2: number;
-        constructor(x1?: number, y1?: number, x2?: number, y2?: number);
-        easeInCore(gradient: number): number;
-    }
-}
-
-declare module BABYLON {
     class Bone extends Node {
         name: string;
         children: Bone[];
@@ -2845,8 +2845,8 @@ declare module BABYLON {
         normalize(): Vector2;
         clone(): Vector2;
         static Zero(): Vector2;
-        static FromArray(array: number[], offset?: number): Vector2;
-        static FromArrayToRef(array: number[], offset: number, result: Vector2): void;
+        static FromArray(array: number[] | Float32Array, offset?: number): Vector2;
+        static FromArrayToRef(array: number[] | Float32Array, offset: number, result: Vector2): void;
         static CatmullRom(value1: Vector2, value2: Vector2, value3: Vector2, value4: Vector2, amount: number): Vector2;
         static Clamp(value: Vector2, min: Vector2, max: Vector2): Vector2;
         static Hermite(value1: Vector2, tangent1: Vector2, value2: Vector2, tangent2: Vector2, amount: number): Vector2;
@@ -2866,7 +2866,7 @@ declare module BABYLON {
         constructor(x: number, y: number, z: number);
         toString(): string;
         asArray(): number[];
-        toArray(array: number[], index?: number): Vector3;
+        toArray(array: number[] | Float32Array, index?: number): Vector3;
         toQuaternion(): Quaternion;
         addInPlace(otherVector: Vector3): Vector3;
         add(otherVector: Vector3): Vector3;
@@ -2898,9 +2898,9 @@ declare module BABYLON {
         copyFrom(source: Vector3): Vector3;
         copyFromFloats(x: number, y: number, z: number): Vector3;
         static GetClipFactor(vector0: Vector3, vector1: Vector3, axis: Vector3, size: any): number;
-        static FromArray(array: number[], offset?: number): Vector3;
+        static FromArray(array: number[] | Float32Array, offset?: number): Vector3;
         static FromFloatArray(array: Float32Array, offset?: number): Vector3;
-        static FromArrayToRef(array: number[], offset: number, result: Vector3): void;
+        static FromArrayToRef(array: number[] | Float32Array, offset: number, result: Vector3): void;
         static FromFloatArrayToRef(array: Float32Array, offset: number, result: Vector3): void;
         static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
         static Zero(): Vector3;
@@ -3553,7 +3553,7 @@ declare module BABYLON {
         getLOD(camera: Camera): AbstractMesh;
         getTotalVertices(): number;
         getIndices(): number[];
-        getVerticesData(kind: string): number[];
+        getVerticesData(kind: string): number[] | Float32Array;
         isVerticesDataPresent(kind: string): boolean;
         getBoundingInfo(): BoundingInfo;
         useBones: boolean;
@@ -3704,11 +3704,11 @@ declare module BABYLON {
         getEngine(): Engine;
         isReady(): boolean;
         setAllVerticesData(vertexData: VertexData, updatable?: boolean): void;
-        setVerticesData(kind: string, data: number[], updatable?: boolean, stride?: number): void;
+        setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void;
         updateVerticesDataDirectly(kind: string, data: Float32Array, offset: number): void;
-        updateVerticesData(kind: string, data: number[], updateExtends?: boolean): void;
+        updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean): void;
         getTotalVertices(): number;
-        getVerticesData(kind: string, copyWhenShared?: boolean): number[];
+        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array;
         getVertexBuffer(kind: string): VertexBuffer;
         getVertexBuffers(): VertexBuffer[];
         isVerticesDataPresent(kind: string): boolean;
@@ -3873,7 +3873,7 @@ declare module BABYLON {
         skeleton: Skeleton;
         getTotalVertices(): number;
         sourceMesh: Mesh;
-        getVerticesData(kind: string): number[];
+        getVerticesData(kind: string): number[] | Float32Array;
         isVerticesDataPresent(kind: string): boolean;
         getIndices(): number[];
         _positions: Vector3[];
@@ -3981,7 +3981,7 @@ declare module BABYLON {
         getLOD(camera: Camera, boundingSphere?: BoundingSphere): AbstractMesh;
         geometry: Geometry;
         getTotalVertices(): number;
-        getVerticesData(kind: string, copyWhenShared?: boolean): number[];
+        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array;
         getVertexBuffer(kind: any): VertexBuffer;
         isVerticesDataPresent(kind: string): boolean;
         getVerticesDataKinds(): string[];
@@ -4001,8 +4001,8 @@ declare module BABYLON {
         refreshBoundingInfo(): void;
         _createGlobalSubMesh(): SubMesh;
         subdivide(count: number): void;
-        setVerticesData(kind: any, data: any, updatable?: boolean, stride?: number): void;
-        updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void;
+        setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void;
+        updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void;
         updateVerticesDataDirectly(kind: string, data: Float32Array, offset?: number, makeItUnique?: boolean): void;
         updateMeshPositions(positionFunction: any, computeNormals?: boolean): void;
         makeGeometryUnique(): void;
@@ -4280,26 +4280,26 @@ declare module BABYLON {
 declare module BABYLON {
     interface IGetSetVerticesData {
         isVerticesDataPresent(kind: string): boolean;
-        getVerticesData(kind: string, copyWhenShared?: boolean): number[];
+        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array;
         getIndices(copyWhenShared?: boolean): number[];
-        setVerticesData(kind: string, data: number[], updatable?: boolean): void;
-        updateVerticesData(kind: string, data: number[], updateExtends?: boolean, makeItUnique?: boolean): void;
-        setIndices(indices: number[]): void;
+        setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean): void;
+        updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void;
+        setIndices(indices: number[] | Float32Array): void;
     }
     class VertexData {
-        positions: number[];
-        normals: number[];
-        uvs: number[];
-        uvs2: number[];
-        uvs3: number[];
-        uvs4: number[];
-        uvs5: number[];
-        uvs6: number[];
-        colors: number[];
-        matricesIndices: number[];
-        matricesWeights: number[];
+        positions: number[] | Float32Array;
+        normals: number[] | Float32Array;
+        uvs: number[] | Float32Array;
+        uvs2: number[] | Float32Array;
+        uvs3: number[] | Float32Array;
+        uvs4: number[] | Float32Array;
+        uvs5: number[] | Float32Array;
+        uvs6: number[] | Float32Array;
+        colors: number[] | Float32Array;
+        matricesIndices: number[] | Float32Array;
+        matricesWeights: number[] | Float32Array;
         indices: number[];
-        set(data: number[], kind: string): void;
+        set(data: number[] | Float32Array, kind: string): void;
         applyToMesh(mesh: Mesh, updatable?: boolean): void;
         applyToGeometry(geometry: Geometry, updatable?: boolean): void;
         updateMesh(mesh: Mesh, updateExtends?: boolean, makeItUnique?: boolean): void;
@@ -4628,13 +4628,13 @@ declare module BABYLON {
         private _updatable;
         private _kind;
         private _strideSize;
-        constructor(engine: any, data: number[], kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number);
+        constructor(engine: any, data: number[] | Float32Array, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number);
         isUpdatable(): boolean;
-        getData(): number[];
+        getData(): number[] | Float32Array;
         getBuffer(): WebGLBuffer;
         getStrideSize(): number;
-        create(data?: number[]): void;
-        update(data: number[]): void;
+        create(data?: number[] | Float32Array): void;
+        update(data: number[] | Float32Array): void;
         updateDirectly(data: Float32Array, offset: number): void;
         dispose(): void;
         private static _PositionKind;
@@ -5929,11 +5929,11 @@ declare module BABYLON {
         static GetDOMTextContent(element: HTMLElement): string;
         static ToDegrees(angle: number): number;
         static ToRadians(angle: number): number;
-        static ExtractMinAndMaxIndexed(positions: number[], indices: number[], indexStart: number, indexCount: number): {
+        static ExtractMinAndMaxIndexed(positions: number[] | Float32Array, indices: number[], indexStart: number, indexCount: number): {
             minimum: Vector3;
             maximum: Vector3;
         };
-        static ExtractMinAndMax(positions: number[], start: number, count: number): {
+        static ExtractMinAndMax(positions: number[] | Float32Array, start: number, count: number): {
             minimum: Vector3;
             maximum: Vector3;
         };
@@ -6009,7 +6009,6 @@ declare module BABYLON {
         static StartPerformanceCounter: (counterName: string, condition?: boolean) => void;
         static EndPerformanceCounter: (counterName: string, condition?: boolean) => void;
         static Now: number;
-        static GetFps(): number;
     }
     /**
      * An implementation of a loop for asynchronous functions.

Dosya farkı çok büyük olduğundan ihmal edildi
+ 24 - 34
dist/preview release/babylon.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 26 - 25
dist/preview release/babylon.max.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 23 - 33
dist/preview release/babylon.noworker.js


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

@@ -438,11 +438,11 @@
             return new Vector2(0, 0);
         }
 
-        public static FromArray(array: number[], offset: number = 0): Vector2 {
+        public static FromArray(array: number[] | Float32Array, offset: number = 0): Vector2 {
             return new Vector2(array[offset], array[offset + 1]);
         }
 
-        public static FromArrayToRef(array: number[], offset: number, result: Vector2): void {
+        public static FromArrayToRef(array: number[] | Float32Array, offset: number, result: Vector2): void {
             result.x = array[offset];
             result.y = array[offset + 1];
         }
@@ -557,7 +557,7 @@
             return result;
         }
 
-        public toArray(array: number[], index: number = 0): Vector3 {
+        public toArray(array: number[] | Float32Array, index: number = 0): Vector3 {
             array[index] = this.x;
             array[index + 1] = this.y;
             array[index + 2] = this.z;
@@ -775,7 +775,7 @@
             return s;
         }
 
-        public static FromArray(array: number[], offset?: number): Vector3 {
+        public static FromArray(array: number[] | Float32Array, offset?: number): Vector3 {
             if (!offset) {
                 offset = 0;
             }
@@ -791,7 +791,7 @@
             return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
         }
 
-        public static FromArrayToRef(array: number[], offset: number, result: Vector3): void {
+        public static FromArrayToRef(array: number[] | Float32Array, offset: number, result: Vector3): void {
             result.x = array[offset];
             result.y = array[offset + 1];
             result.z = array[offset + 2];

+ 1 - 1
src/Mesh/babylon.abstractMesh.ts

@@ -162,7 +162,7 @@
             return null;
         }
 
-        public getVerticesData(kind: string): number[] {
+        public getVerticesData(kind: string): number[] | Float32Array {
             return null;
         }
 

+ 9 - 2
src/Mesh/babylon.geometry.js

@@ -148,8 +148,9 @@ var BABYLON;
         };
         Geometry.prototype.getVerticesDataKinds = function () {
             var result = [];
+            var kind;
             if (!this._vertexBuffers && this._delayInfo) {
-                for (var kind in this._delayInfo) {
+                for (kind in this._delayInfo) {
                     result.push(kind);
                 }
             }
@@ -344,7 +345,13 @@ var BABYLON;
             var kind;
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
-                vertexData.set(this.getVerticesData(kind).slice(0), kind);
+                var data = this.getVerticesData(kind);
+                if (data instanceof Float32Array) {
+                    vertexData.set(new Float32Array(data), kind);
+                }
+                else {
+                    vertexData.set(data.slice(0), kind);
+                }
                 if (!stopChecking) {
                     updatable = this.getVertexBuffer(kind).isUpdatable();
                     stopChecking = !updatable;

+ 11 - 5
src/Mesh/babylon.geometry.ts

@@ -58,7 +58,7 @@
             this.notifyUpdate();
         }
 
-        public setVerticesData(kind: string, data: number[], updatable?: boolean, stride?: number): void {
+        public setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void {
             this._vertexBuffers = this._vertexBuffers || {};
 
             if (this._vertexBuffers[kind]) {
@@ -99,7 +99,7 @@
             this.notifyUpdate(kind);
         }
 
-        public updateVerticesData(kind: string, data: number[], updateExtends?: boolean): void {
+        public updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean): void {
             var vertexBuffer = this.getVertexBuffer(kind);
 
             if (!vertexBuffer) {
@@ -147,7 +147,7 @@
             return this._totalVertices;
         }
 
-        public getVerticesData(kind: string, copyWhenShared?: boolean): number[] {
+        public getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array {
             var vertexBuffer = this.getVertexBuffer(kind);
             if (!vertexBuffer) {
                 return null;
@@ -191,8 +191,9 @@
 
         public getVerticesDataKinds(): string[] {
             var result = [];
+            var kind;
             if (!this._vertexBuffers && this._delayInfo) {
-                for (var kind in this._delayInfo) {
+                for (kind in this._delayInfo) {
                     result.push(kind);
                 }
             } else {
@@ -434,8 +435,13 @@
             var kind;
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
-                vertexData.set(this.getVerticesData(kind).slice(0), kind);
+                var data = this.getVerticesData(kind);
 
+                if (data instanceof Float32Array) {
+                    vertexData.set(new Float32Array(<Float32Array>data), kind);
+                } else {
+                    vertexData.set((<number[]>data).slice(0), kind);
+                }
                 if (!stopChecking) {
                     updatable = this.getVertexBuffer(kind).isUpdatable();
                     stopChecking = !updatable;

+ 1 - 1
src/Mesh/babylon.instancedMesh.ts

@@ -55,7 +55,7 @@
             return this._sourceMesh;
         }
 
-        public getVerticesData(kind: string): number[] {
+        public getVerticesData(kind: string): number[] | Float32Array {
             return this._sourceMesh.getVerticesData(kind);
         }
 

+ 1 - 6
src/Mesh/babylon.mesh.js

@@ -387,12 +387,6 @@ var BABYLON;
             this.synchronizeInstances();
         };
         Mesh.prototype.setVerticesData = function (kind, data, updatable, stride) {
-            if (kind instanceof Array) {
-                var temp = data;
-                data = kind;
-                kind = temp;
-                BABYLON.Tools.Warn("Deprecated usage of setVerticesData detected (since v1.12). Current signature is setVerticesData(kind, data, updatable).");
-            }
             if (!this._geometry) {
                 var vertexData = new BABYLON.VertexData();
                 vertexData.set(data, kind);
@@ -416,6 +410,7 @@ var BABYLON;
             }
         };
         Mesh.prototype.updateVerticesDataDirectly = function (kind, data, offset, makeItUnique) {
+            BABYLON.Tools.Warn("Mesh.updateVerticesDataDirectly deprecated since 2.3.");
             if (!this._geometry) {
                 return;
             }

+ 13 - 23
src/Mesh/babylon.mesh.ts

@@ -249,7 +249,7 @@
             return this._geometry.getTotalVertices();
         }
 
-        public getVerticesData(kind: string, copyWhenShared?: boolean): any {
+        public getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array {
             if (!this._geometry) {
                 return null;
             }
@@ -293,7 +293,7 @@
             return this._geometry.getTotalIndices();
         }
 
-        public getIndices(copyWhenShared?: boolean): any {
+        public getIndices(copyWhenShared?: boolean): number[]{
             if (!this._geometry) {
                 return [];
             }
@@ -418,15 +418,7 @@
             this.synchronizeInstances();
         }
 
-        public setVerticesData(kind: any, data: any, updatable?: boolean, stride?: number): void {
-            if (kind instanceof Array) {
-                var temp = data;
-                data = kind;
-                kind = temp;
-
-                Tools.Warn("Deprecated usage of setVerticesData detected (since v1.12). Current signature is setVerticesData(kind, data, updatable).");
-            }
-
+        public setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean, stride?: number): void {
             if (!this._geometry) {
                 var vertexData = new VertexData();
                 vertexData.set(data, kind);
@@ -440,7 +432,7 @@
             }
         }
 
-        public updateVerticesData(kind: string, data: any, updateExtends?: boolean, makeItUnique?: boolean): void {
+        public updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void {
             if (!this._geometry) {
                 return;
             }
@@ -453,13 +445,9 @@
             }
         }
 
-        private _warned = false;
         public updateVerticesDataDirectly(kind: string, data: Float32Array, offset?: number, makeItUnique?: boolean): void {
-            if (!this._warned){
-                Tools.Warn("Mesh.updateVerticesDataDirectly deprecated since 2.3.");
-                this._warned = true;
-            }
-            
+            Tools.Warn("Mesh.updateVerticesDataDirectly deprecated since 2.3.");
+
             if (!this._geometry) {
                 return;
             }
@@ -2288,8 +2276,8 @@
                     vertexData.indices.push(currentVertexDataIndex);
                     vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);
                     vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);
-                    vertexData.uvs.push(0.5 + vertex.position.x / size.x);
-                    vertexData.uvs.push(0.5 + vertex.position.y / size.y);
+                    (<number []>vertexData.uvs).push(0.5 + vertex.position.x / size.x);
+                    (<number[]>vertexData.uvs).push(0.5 + vertex.position.y / size.y);
 
                     currentVertexDataIndex++;
                 }
@@ -2324,10 +2312,11 @@
             if (!this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)) {
                 return this;
             }
-            var source: number[];
+            var source: number[] | Float32Array;
             if (!this._sourcePositions) {
                 source = this.getVerticesData(VertexBuffer.PositionKind);
-                this._sourcePositions = new Float32Array(source);
+
+                this._sourcePositions = new Float32Array(<any>source); 
 
                 if (!this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable()) {
                     this.setVerticesData(VertexBuffer.PositionKind, source, true);
@@ -2336,7 +2325,7 @@
 
             if (!this._sourceNormals) {
                 source = this.getVerticesData(VertexBuffer.NormalKind);
-                this._sourceNormals = new Float32Array(source);
+                this._sourceNormals = new Float32Array(<any>source);
 
                 if (!this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable()) {
                     this.setVerticesData(VertexBuffer.NormalKind, source, true);
@@ -2493,3 +2482,4 @@
 }
 
 
+

+ 30 - 30
src/Mesh/babylon.mesh.vertexData.ts

@@ -1,28 +1,28 @@
 module BABYLON {
     export interface IGetSetVerticesData {
         isVerticesDataPresent(kind: string): boolean;
-        getVerticesData(kind: string, copyWhenShared?: boolean): number[];
+        getVerticesData(kind: string, copyWhenShared?: boolean): number[] | Float32Array;
         getIndices(copyWhenShared?: boolean): number[];
-        setVerticesData(kind: string, data: any, updatable?: boolean): void;
-        updateVerticesData(kind: string, data: any, updateExtends?: boolean, makeItUnique?: boolean): void;
-        setIndices(indices: number[]): void;
+        setVerticesData(kind: string, data: number[] | Float32Array, updatable?: boolean): void;
+        updateVerticesData(kind: string, data: number[] | Float32Array, updateExtends?: boolean, makeItUnique?: boolean): void;
+        setIndices(indices: number[] | Float32Array): void;
     }
 
     export class VertexData {
-        public positions: any;
-        public normals: any;
-        public uvs: any;
-        public uvs2: any;
-        public uvs3: any;
-        public uvs4: any;
-        public uvs5: any;
-        public uvs6: any;
-        public colors: any;
-        public matricesIndices: any;
-        public matricesWeights: any;
+        public positions: number[] | Float32Array;
+        public normals: number[] | Float32Array;
+        public uvs: number[] | Float32Array;
+        public uvs2: number[] | Float32Array;
+        public uvs3: number[] | Float32Array;
+        public uvs4: number[] | Float32Array;
+        public uvs5: number[] | Float32Array;
+        public uvs6: number[] | Float32Array;
+        public colors: number[] | Float32Array;
+        public matricesIndices: number[] | Float32Array;
+        public matricesWeights: number[] | Float32Array;
         public indices: number[];
 
-        public set(data: any, kind: string) {
+        public set(data: number[] | Float32Array, kind: string) {
             switch (kind) {
                 case VertexBuffer.PositionKind:
                     this.positions = data;
@@ -225,7 +225,7 @@
                 }
 
                 for (index = 0; index < other.positions.length; index++) {
-                    this.positions.push(other.positions[index]);
+                    (<number[]>this.positions).push(other.positions[index]);
                 }
             }
 
@@ -234,7 +234,7 @@
                     this.normals = [];
                 }
                 for (index = 0; index < other.normals.length; index++) {
-                    this.normals.push(other.normals[index]);
+                    (<number[]>this.normals).push(other.normals[index]);
                 }
             }
 
@@ -243,7 +243,7 @@
                     this.uvs = [];
                 }
                 for (index = 0; index < other.uvs.length; index++) {
-                    this.uvs.push(other.uvs[index]);
+                    (<number[]>this.uvs).push(other.uvs[index]);
                 }
             }
 
@@ -252,7 +252,7 @@
                     this.uvs2 = [];
                 }
                 for (index = 0; index < other.uvs2.length; index++) {
-                    this.uvs2.push(other.uvs2[index]);
+                    (<number[]>this.uvs2).push(other.uvs2[index]);
                 }
             }
 
@@ -261,7 +261,7 @@
                     this.uvs3 = [];
                 }
                 for (index = 0; index < other.uvs3.length; index++) {
-                    this.uvs3.push(other.uvs3[index]);
+                    (<number[]>this.uvs3).push(other.uvs3[index]);
                 }
             }
 
@@ -270,7 +270,7 @@
                     this.uvs4 = [];
                 }
                 for (index = 0; index < other.uvs4.length; index++) {
-                    this.uvs4.push(other.uvs4[index]);
+                    (<number[]>this.uvs4).push(other.uvs4[index]);
                 }
             }
 
@@ -279,7 +279,7 @@
                     this.uvs5 = [];
                 }
                 for (index = 0; index < other.uvs5.length; index++) {
-                    this.uvs5.push(other.uvs5[index]);
+                    (<number[]>this.uvs5).push(other.uvs5[index]);
                 }
             }
 
@@ -288,7 +288,7 @@
                     this.uvs6 = [];
                 }
                 for (index = 0; index < other.uvs6.length; index++) {
-                    this.uvs6.push(other.uvs6[index]);
+                    (<number[]>this.uvs6).push(other.uvs6[index]);
                 }
             }
 
@@ -297,7 +297,7 @@
                     this.matricesIndices = [];
                 }
                 for (index = 0; index < other.matricesIndices.length; index++) {
-                    this.matricesIndices.push(other.matricesIndices[index]);
+                    (<number[]>this.matricesIndices).push(other.matricesIndices[index]);
                 }
             }
 
@@ -306,7 +306,7 @@
                     this.matricesWeights = [];
                 }
                 for (index = 0; index < other.matricesWeights.length; index++) {
-                    this.matricesWeights.push(other.matricesWeights[index]);
+                    (<number[]>this.matricesWeights).push(other.matricesWeights[index]);
                 }
             }
 
@@ -315,7 +315,7 @@
                     this.colors = [];
                 }
                 for (index = 0; index < other.colors.length; index++) {
-                    this.colors.push(other.colors[index]);
+                    (<number[]>this.colors).push(other.colors[index]);
                 }
             }
         }
@@ -1391,10 +1391,10 @@
             // default face colors and UV if undefined
             for (f = 0; f < nbfaces; f++) {
                 if (faceColors && faceColors[f] === undefined) {
-                    faceColors[f] = new BABYLON.Color4(1, 1, 1, 1);
+                    faceColors[f] = new Color4(1, 1, 1, 1);
                 }
                 if (faceUV && faceUV[f] === undefined) {
-                    faceUV[f] = new BABYLON.Vector4(0, 0, 1, 1);
+                    faceUV[f] = new Vector4(0, 0, 1, 1);
                 }
             }
 
@@ -1595,7 +1595,7 @@
             }
         }
 
-        private static _ComputeSides(sideOrientation: number, positions: any, indices: any, normals: any, uvs: any) {
+        private static _ComputeSides(sideOrientation: number, positions: number[] | Float32Array, indices: number[] | Float32Array, normals: number[] | Float32Array, uvs: number[] | Float32Array) {
             var li: number = indices.length;
             var ln: number = normals.length;
             var i: number;

+ 9 - 10
src/Mesh/babylon.meshSimplification.js

@@ -208,9 +208,9 @@ var BABYLON;
                 var bbox = _this._mesh.getBoundingInfo().boundingBox;
                 if (bbox.maximum.x - vPos.x < _this.boundingBoxEpsilon || vPos.x - bbox.minimum.x > _this.boundingBoxEpsilon)
                     ++count;
-                if (bbox.maximum.y == vPos.y || vPos.y == bbox.minimum.y)
+                if (bbox.maximum.y === vPos.y || vPos.y === bbox.minimum.y)
                     ++count;
-                if (bbox.maximum.z == vPos.z || vPos.z == bbox.minimum.z)
+                if (bbox.maximum.z === vPos.z || vPos.z === bbox.minimum.z)
                     ++count;
                 if (count > 1) {
                     ++gCount;
@@ -271,7 +271,7 @@ var BABYLON;
                                         uniqueArray.push(deletedT);
                                     }
                                 });
-                                if (uniqueArray.length % 2 != 0) {
+                                if (uniqueArray.length % 2 !== 0) {
                                     continue;
                                 }
                                 v0.q = v1.q.add(v0.q);
@@ -337,7 +337,7 @@ var BABYLON;
                 var position = BABYLON.Vector3.FromArray(positionData, offset * 3);
                 var vertex = findInVertices(position) || new DecimationVertex(position, _this.vertices.length);
                 vertex.originalOffsets.push(offset);
-                if (vertex.id == _this.vertices.length) {
+                if (vertex.id === _this.vertices.length) {
                     _this.vertices.push(vertex);
                 }
                 vertexReferences.push(vertex.id);
@@ -403,10 +403,10 @@ var BABYLON;
                     newTriangles.push(t);
                 }
             }
-            var newPositionData = this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind) || [];
-            var newNormalData = this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind) || [];
-            var newUVsData = this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.UVKind) || [];
-            var newColorsData = this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.ColorKind) || [];
+            var newPositionData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.PositionKind) || []);
+            var newNormalData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.NormalKind) || []);
+            var newUVsData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.UVKind) || []);
+            var newColorsData = (this._reconstructedMesh.getVerticesData(BABYLON.VertexBuffer.ColorKind) || []);
             var normalData = this._mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind);
             var uvs = this._mesh.getVerticesData(BABYLON.VertexBuffer.UVKind);
             var colorsData = this._mesh.getVerticesData(BABYLON.VertexBuffer.ColorKind);
@@ -443,8 +443,7 @@ var BABYLON;
             var newIndicesArray = this._reconstructedMesh.getIndices(); //[];
             var originalIndices = this._mesh.getIndices();
             for (i = 0; i < newTriangles.length; ++i) {
-                var t = newTriangles[i];
-                //now get the new referencing point for each vertex
+                t = newTriangles[i]; //now get the new referencing point for each vertex
                 [0, 1, 2].forEach(function (idx) {
                     var id = originalIndices[t.originalOffset + idx];
                     var offset = t.vertices[idx].originalOffsets.indexOf(id);

+ 13 - 14
src/Mesh/babylon.meshSimplification.ts

@@ -272,10 +272,10 @@
                 if (bbox.maximum.x - vPos.x < this.boundingBoxEpsilon || vPos.x - bbox.minimum.x > this.boundingBoxEpsilon)
                     ++count;
 
-                if (bbox.maximum.y == vPos.y || vPos.y == bbox.minimum.y)
+                if (bbox.maximum.y === vPos.y || vPos.y === bbox.minimum.y)
                     ++count;
 
-                if (bbox.maximum.z == vPos.z || vPos.z == bbox.minimum.z)
+                if (bbox.maximum.z === vPos.z || vPos.z === bbox.minimum.z)
                     ++count;
 
                 if (count > 1) {
@@ -338,14 +338,14 @@
                                     continue;
 
                                 var uniqueArray = [];
-                                delTr.forEach(function (deletedT) {
+                                delTr.forEach(deletedT => {
                                     if (uniqueArray.indexOf(deletedT) === -1) {
                                         deletedT.deletePending = true;
                                         uniqueArray.push(deletedT);
                                     }
                                 });
 
-                                if (uniqueArray.length % 2 != 0) {
+                                if (uniqueArray.length % 2 !== 0) {
                                     continue;
                                 }
 
@@ -424,7 +424,7 @@
 
                 var vertex = findInVertices(position) || new DecimationVertex(position, this.vertices.length);
                 vertex.originalOffsets.push(offset);
-                if (vertex.id == this.vertices.length) {
+                if (vertex.id === this.vertices.length) {
                     this.vertices.push(vertex);
                 }
                 vertexReferences.push(vertex.id);
@@ -495,10 +495,10 @@
                 }
             }
 
-            var newPositionData = this._reconstructedMesh.getVerticesData(VertexBuffer.PositionKind) || [];
-            var newNormalData = this._reconstructedMesh.getVerticesData(VertexBuffer.NormalKind) || [];
-            var newUVsData = this._reconstructedMesh.getVerticesData(VertexBuffer.UVKind) || [];
-            var newColorsData = this._reconstructedMesh.getVerticesData(VertexBuffer.ColorKind) || [];
+            var newPositionData = <number[]>(this._reconstructedMesh.getVerticesData(VertexBuffer.PositionKind) || []);
+            var newNormalData = <number[]>(this._reconstructedMesh.getVerticesData(VertexBuffer.NormalKind) || []);
+            var newUVsData = <number[]>(this._reconstructedMesh.getVerticesData(VertexBuffer.UVKind) || []);
+            var newColorsData = <number[]>(this._reconstructedMesh.getVerticesData(VertexBuffer.ColorKind) || []);
 
             var normalData = this._mesh.getVerticesData(VertexBuffer.NormalKind);
             var uvs = this._mesh.getVerticesData(VertexBuffer.UVKind);
@@ -509,7 +509,7 @@
                 var vertex = this.vertices[i];
                 vertex.id = vertexCount;
                 if (vertex.triangleCount) {
-                    vertex.originalOffsets.forEach(function (originalOffset) {
+                    vertex.originalOffsets.forEach(originalOffset => {
                         newPositionData.push(vertex.position.x);
                         newPositionData.push(vertex.position.y);
                         newPositionData.push(vertex.position.z);
@@ -539,9 +539,8 @@
             var newIndicesArray: Array<number> = this._reconstructedMesh.getIndices(); //[];
             var originalIndices = this._mesh.getIndices();
             for (i = 0; i < newTriangles.length; ++i) {
-                var t = newTriangles[i];
-                //now get the new referencing point for each vertex
-                [0, 1, 2].forEach(function (idx) {
+                t = newTriangles[i]; //now get the new referencing point for each vertex
+                [0, 1, 2].forEach(idx => {
                     var id = originalIndices[t.originalOffset + idx]
                     var offset = t.vertices[idx].originalOffsets.indexOf(id);
                     if (offset < 0) offset = 0;
@@ -563,7 +562,7 @@
             var originalSubmesh = this._mesh.subMeshes[submeshIndex];
             if (submeshIndex > 0) {
                 this._reconstructedMesh.subMeshes = [];
-                submeshesArray.forEach(function (submesh) {
+                submeshesArray.forEach(submesh => {
                     new SubMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount,/* 0, newPositionData.length/3, */submesh.indexStart, submesh.indexCount, submesh.getMesh());
                 });
                 var newSubmesh = new SubMesh(originalSubmesh.materialIndex, startingVertex, vertexCount,/* 0, newPositionData.length / 3, */startingIndex, newTriangles.length * 3, this._reconstructedMesh);

+ 6 - 6
src/Mesh/babylon.vertexBuffer.ts

@@ -3,12 +3,12 @@
         private _mesh: Mesh;
         private _engine: Engine;
         private _buffer: WebGLBuffer;
-        private _data: any;
+        private _data: number[] | Float32Array;
         private _updatable: boolean;
         private _kind: string;
         private _strideSize: number;
 
-        constructor(engine: any, data: any, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number) {
+        constructor(engine: any, data: number[] | Float32Array, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number) {
             if (engine instanceof Mesh) { // old versions of BABYLON.VertexBuffer accepted 'mesh' instead of 'engine'
                 this._engine = engine.getScene().getEngine();
             }
@@ -64,7 +64,7 @@
             return this._updatable;
         }
 
-        public getData(): any {
+        public getData(): number[] | Float32Array {
             return this._data;
         }
 
@@ -77,7 +77,7 @@
         }
 
         // Methods
-        public create(data?: any): void {
+        public create(data?: number[] | Float32Array): void {
             if (!data && this._buffer) {
                 return; // nothing to do
             }
@@ -98,11 +98,11 @@
             }
         }
 
-        public update(data: any): void {
+        public update(data: number[] | Float32Array): void {
             this.create(data);
         }
 
-        public updateDirectly(data: Float32Array, offset: number): void {            
+        public updateDirectly(data: Float32Array, offset: number): void {
             if (!this._buffer) {
                 return;
             }

+ 1 - 1
src/Physics/Plugins/babylon.cannonJSPlugin.ts

@@ -121,7 +121,7 @@
             return this._createRigidBodyFromShape(shape, mesh, options.mass, options.friction, options.restitution);
         }
 
-        private _createConvexPolyhedron(rawVerts: number[], rawFaces: number[], mesh: AbstractMesh, options?: PhysicsBodyCreationOptions): any {
+        private _createConvexPolyhedron(rawVerts: number[] | Float32Array, rawFaces: number[], mesh: AbstractMesh, options?: PhysicsBodyCreationOptions): any {
             var verts = [], faces = [];
 
             mesh.computeWorldMatrix(true);

+ 0 - 5
src/Tools/babylon.tools.js

@@ -733,11 +733,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        // Deprecated
-        Tools.GetFps = function () {
-            Tools.Warn("Tools.GetFps() is deprecated. Please use engine.getFps() instead");
-            return 0;
-        };
         Tools.BaseUrl = "";
         // Logs
         Tools._NoneLogLevel = 0;

+ 2 - 11
src/Tools/babylon.tools.ts

@@ -101,7 +101,7 @@
             return angle * Math.PI / 180;
         }
 
-        public static ExtractMinAndMaxIndexed(positions: number[], indices: number[], indexStart: number, indexCount: number): { minimum: Vector3; maximum: Vector3 } {
+        public static ExtractMinAndMaxIndexed(positions: number[] | Float32Array, indices: number[], indexStart: number, indexCount: number): { minimum: Vector3; maximum: Vector3 } {
             var minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
             var maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
 
@@ -118,7 +118,7 @@
             };
         }
 
-        public static ExtractMinAndMax(positions: number[], start: number, count: number): { minimum: Vector3; maximum: Vector3 } {
+        public static ExtractMinAndMax(positions: number[] | Float32Array, start: number, count: number): { minimum: Vector3; maximum: Vector3 } {
             var minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
             var maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
 
@@ -847,15 +847,6 @@
 
             return new Date().getTime();
         }
-
-        // Deprecated
-
-        public static GetFps(): number {
-            Tools.Warn("Tools.GetFps() is deprecated. Please use engine.getFps() instead");
-            return 0;
-        }
-
-
     }
 
     /**

+ 6 - 1
src/babylon.engine.js

@@ -884,7 +884,12 @@ var BABYLON;
         Engine.prototype.createVertexBuffer = function (vertices) {
             var vbo = this._gl.createBuffer();
             this._gl.bindBuffer(this._gl.ARRAY_BUFFER, vbo);
-            this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(vertices), this._gl.STATIC_DRAW);
+            if (vertices instanceof Float32Array) {
+                this._gl.bufferData(this._gl.ARRAY_BUFFER, vertices, this._gl.STATIC_DRAW);
+            }
+            else {
+                this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(vertices), this._gl.STATIC_DRAW);
+            }
             this._resetVertexBufferBinding();
             vbo.references = 1;
             return vbo;

+ 5 - 4
src/babylon.engine.ts

@@ -562,7 +562,7 @@
          * @param {boolean} [antialias] - enable antialias
          * @param options - further options to be sent to the getContext function
          */
-        constructor(canvas: HTMLCanvasElement, antialias?: boolean, options?: { antialias?: boolean, preserveDrawingBuffer?: boolean}, adaptToDeviceRatio = true) {
+        constructor(canvas: HTMLCanvasElement, antialias?: boolean, options?: { antialias?: boolean, preserveDrawingBuffer?: boolean }, adaptToDeviceRatio = true) {
             this._renderingCanvas = canvas;
 
             options = options || {};
@@ -1008,9 +1008,10 @@
             this._cachedVertexBuffers = null;
         }
 
-        public createVertexBuffer(vertices: any): WebGLBuffer {
+        public createVertexBuffer(vertices: number[] | Float32Array): WebGLBuffer {
             var vbo = this._gl.createBuffer();
             this._gl.bindBuffer(this._gl.ARRAY_BUFFER, vbo);
+
             if (vertices instanceof Float32Array) {
                 this._gl.bufferData(this._gl.ARRAY_BUFFER, vertices, this._gl.STATIC_DRAW);
             } else {
@@ -1031,7 +1032,7 @@
             return vbo;
         }
 
-        public updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: any, offset?: number): void {
+        public updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: number[] | Float32Array, offset?: number): void {
             this._gl.bindBuffer(this._gl.ARRAY_BUFFER, vertexBuffer);
 
             if (offset === undefined) {
@@ -1968,7 +1969,7 @@
             var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);
 
             gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
-            
+
             for (var face = 0; face < 6; face++) {
                 gl.texImage2D((gl.TEXTURE_CUBE_MAP_POSITIVE_X + face), 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
             }