Quellcode durchsuchen

Merge branch 'master' of https://github.com/RaananW/Babylon.js

Raanan Weber vor 10 Jahren
Ursprung
Commit
fde6a97e14
100 geänderte Dateien mit 2534 neuen und 1138 gelöschten Zeilen
  1. 1 1
      Exporters/3ds Max/readme.md
  2. 825 361
      Exporters/Blender/io_export_babylon.py
  3. 231 187
      dist/preview release - alpha/babylon.2.2.d.ts
  4. 23 24
      dist/preview release - alpha/babylon.2.2.js
  5. 806 511
      dist/preview release - alpha/babylon.2.2.max.js
  6. 22 23
      dist/preview release - alpha/babylon.2.2.noworker.js
  7. 8 1
      dist/preview release - alpha/what's new.md
  8. 1 0
      src/Actions/babylon.action.js
  9. 1 0
      src/Actions/babylon.actionManager.js
  10. 1 0
      src/Actions/babylon.condition.js
  11. 1 0
      src/Actions/babylon.directActions.js
  12. 1 0
      src/Actions/babylon.interpolateValueAction.js
  13. 1 0
      src/Animations/babylon.animatable.js
  14. 1 0
      src/Animations/babylon.animation.js
  15. 1 0
      src/Animations/babylon.easing.js
  16. 1 0
      src/Audio/babylon.analyser.js
  17. 1 0
      src/Audio/babylon.audioEngine.js
  18. 1 0
      src/Audio/babylon.sound.js
  19. 1 0
      src/Audio/babylon.soundtrack.js
  20. 1 0
      src/Bones/babylon.bone.js
  21. 1 0
      src/Bones/babylon.skeleton.js
  22. 1 1
      src/Bones/babylon.skeleton.ts
  23. 1 0
      src/Cameras/VR/babylon.vrDeviceOrientationCamera.js
  24. 1 0
      src/Cameras/VR/babylon.webVRCamera.js
  25. 1 0
      src/Cameras/babylon.arcRotateCamera.js
  26. 1 0
      src/Cameras/babylon.camera.js
  27. 1 0
      src/Cameras/babylon.deviceOrientationCamera.js
  28. 1 0
      src/Cameras/babylon.followCamera.js
  29. 1 0
      src/Cameras/babylon.freeCamera.js
  30. 1 0
      src/Cameras/babylon.gamepadCamera.js
  31. 1 0
      src/Cameras/babylon.stereoscopicCameras.js
  32. 1 0
      src/Cameras/babylon.targetCamera.js
  33. 1 0
      src/Cameras/babylon.touchCamera.js
  34. 1 0
      src/Cameras/babylon.virtualJoysticksCamera.js
  35. 1 0
      src/Collisions/babylon.collider.js
  36. 1 0
      src/Collisions/babylon.collisionCoordinator.js
  37. 1 0
      src/Collisions/babylon.collisionWorker.js
  38. 1 0
      src/Collisions/babylon.pickingInfo.js
  39. 1 0
      src/Culling/Octrees/babylon.octree.js
  40. 1 0
      src/Culling/Octrees/babylon.octreeBlock.js
  41. 1 0
      src/Culling/babylon.boundingBox.js
  42. 1 0
      src/Culling/babylon.boundingInfo.js
  43. 1 0
      src/Culling/babylon.boundingSphere.js
  44. 1 0
      src/Debug/babylon.debugLayer.js
  45. 1 0
      src/Layer/babylon.layer.js
  46. 1 0
      src/LensFlare/babylon.lensFlare.js
  47. 4 0
      src/LensFlare/babylon.lensFlareSystem.js
  48. 4 0
      src/LensFlare/babylon.lensFlareSystem.ts
  49. 3 2
      src/Lights/Shadows/babylon.shadowGenerator.js
  50. 2 2
      src/Lights/Shadows/babylon.shadowGenerator.ts
  51. 1 0
      src/Lights/babylon.directionalLight.js
  52. 1 0
      src/Lights/babylon.hemisphericLight.js
  53. 1 0
      src/Lights/babylon.light.js
  54. 1 0
      src/Lights/babylon.pointLight.js
  55. 1 0
      src/Lights/babylon.spotLight.js
  56. 4 0
      src/Loading/Plugins/babylon.babylonFileLoader.js
  57. 4 0
      src/Loading/Plugins/babylon.babylonFileLoader.ts
  58. 2 2
      src/Loading/babylon.sceneLoader.js
  59. 2 2
      src/Loading/babylon.sceneLoader.ts
  60. 1 0
      src/Materials/Textures/Procedurals/babylon.customProceduralTexture.js
  61. 1 0
      src/Materials/Textures/Procedurals/babylon.proceduralTexture.js
  62. 1 0
      src/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js
  63. 1 0
      src/Materials/Textures/babylon.baseTexture.js
  64. 1 0
      src/Materials/Textures/babylon.cubeTexture.js
  65. 1 0
      src/Materials/Textures/babylon.dynamicTexture.js
  66. 1 0
      src/Materials/Textures/babylon.mirrorTexture.js
  67. 1 0
      src/Materials/Textures/babylon.renderTargetTexture.js
  68. 1 0
      src/Materials/Textures/babylon.texture.js
  69. 1 0
      src/Materials/Textures/babylon.videoTexture.js
  70. 16 0
      src/Materials/babylon.effect.js
  71. 23 0
      src/Materials/babylon.effect.ts
  72. 11 0
      src/Materials/babylon.material.js
  73. 12 0
      src/Materials/babylon.material.ts
  74. 1 0
      src/Materials/babylon.multiMaterial.js
  75. 33 2
      src/Materials/babylon.shaderMaterial.js
  76. 41 2
      src/Materials/babylon.shaderMaterial.ts
  77. 7 2
      src/Materials/babylon.standardMaterial.js
  78. 8 2
      src/Materials/babylon.standardMaterial.ts
  79. 82 0
      src/Math/babylon.math.js
  80. 105 1
      src/Math/babylon.math.ts
  81. 2 0
      src/Mesh/babylon.abstractMesh.js
  82. 1 0
      src/Mesh/babylon.abstractMesh.ts
  83. 1 0
      src/Mesh/babylon.csg.js
  84. 1 0
      src/Mesh/babylon.geometry.js
  85. 1 0
      src/Mesh/babylon.groundMesh.js
  86. 1 0
      src/Mesh/babylon.instancedMesh.js
  87. 1 0
      src/Mesh/babylon.linesMesh.js
  88. 74 0
      src/Mesh/babylon.mesh.js
  89. 98 4
      src/Mesh/babylon.mesh.ts
  90. 6 4
      src/Mesh/babylon.mesh.vertexData.js
  91. 6 4
      src/Mesh/babylon.mesh.vertexData.ts
  92. 1 0
      src/Mesh/babylon.meshLODLevel.js
  93. 1 0
      src/Mesh/babylon.meshSimplification.js
  94. 1 0
      src/Mesh/babylon.polygonMesh.js
  95. 1 0
      src/Mesh/babylon.subMesh.js
  96. 1 0
      src/Mesh/babylon.vertexBuffer.js
  97. 1 0
      src/Particles/babylon.particle.js
  98. 1 0
      src/Particles/babylon.particleSystem.js
  99. 1 0
      src/Physics/Plugins/babylon.cannonJSPlugin.js
  100. 0 0
      src/Physics/Plugins/babylon.oimoJSPlugin.js

+ 1 - 1
Exporters/3ds Max/readme.md

@@ -1,7 +1,7 @@
 3DS Max to Babylon.js exporter
 ==============================
 
-This exporter is designed for 3ds Max 2013+. You just have to unzip the content of the archive to [3ds max folder\bin\assemblies]
+This exporter is designed for 3ds Max 2013, 2015 and 2016 (Use 2015 version for 3dsMax 2016). You just have to unzip the content of the archive to [3ds max folder\bin\assemblies]
 
 **After unzipping DLLs, you may have to go through all files, right-click on them, select the Properties menu and click on Unblock button to remove security protection enforce by Windows**
 

Datei-Diff unterdrückt, da er zu groß ist
+ 825 - 361
Exporters/Blender/io_export_babylon.py


+ 231 - 187
dist/preview release - alpha/babylon.2.2.d.ts

@@ -96,6 +96,7 @@ declare module BABYLON {
         isPointerLock: boolean;
         cullBackFaces: boolean;
         renderEvenInBackground: boolean;
+        enableOfflineSupport: boolean;
         scenes: Scene[];
         _gl: WebGLRenderingContext;
         private _renderingCanvas;
@@ -246,6 +247,8 @@ declare module BABYLON {
         setArray4(uniform: WebGLUniformLocation, array: number[]): void;
         setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void;
         setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void;
+        setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): void;
+        setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): void;
         setFloat(uniform: WebGLUniformLocation, value: number): void;
         setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void;
         setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void;
@@ -631,6 +634,7 @@ declare module BABYLON {
         private _renderTargets;
         _activeParticleSystems: SmartArray<ParticleSystem>;
         private _activeSkeletons;
+        private _softwareSkinnedMeshes;
         _activeBones: number;
         private _renderingManager;
         private _physicsEngine;
@@ -654,6 +658,7 @@ declare module BABYLON {
         constructor(engine: Engine);
         debugLayer: DebugLayer;
         workerCollisions: boolean;
+        SelectionOctree: Octree<AbstractMesh>;
         /**
          * The mesh that is currently under the pointer.
          * @return {BABYLON.AbstractMesh} mesh under the pointer/mouse cursor or null if none.
@@ -764,6 +769,7 @@ declare module BABYLON {
          * @return {BABYLON.Material|null} the material or null if none found.
          */
         getMaterialByName(name: string): Material;
+        getLensFlareSystemByName(name: string): LensFlareSystem;
         getCameraByID(id: string): Camera;
         getCameraByUniqueID(uniqueId: number): Camera;
         /**
@@ -1156,6 +1162,157 @@ 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;
+        static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): 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;
@@ -1319,157 +1476,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;
-        static CreateAndStartAnimation(name: string, mesh: AbstractMesh, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): 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[];
@@ -2306,6 +2312,7 @@ declare module BABYLON {
         isEnabled: boolean;
         getScene(): Scene;
         getEmitter(): any;
+        setEmitter(newEmitter: any): void;
         getEmitterPosition(): Vector3;
         computeEffectivePosition(globalViewport: Viewport): boolean;
         _isVisible(): boolean;
@@ -2315,38 +2322,6 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
-    interface ISceneLoaderPlugin {
-        extensions: string;
-        importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
-        load: (scene: Scene, data: string, rootUrl: string) => boolean;
-    }
-    class SceneLoader {
-        private static _ForceFullSceneLoadingForIncremental;
-        private static _ShowLoadingScreen;
-        static ForceFullSceneLoadingForIncremental: boolean;
-        static ShowLoadingScreen: boolean;
-        private static _registeredPlugins;
-        private static _getPluginForFilename(sceneFilename);
-        static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
-        static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
-        /**
-        * Load a scene
-        * @param rootUrl a string that defines the root url for scene and resources
-        * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
-        * @param engine is the instance of BABYLON.Engine to use to create the scene
-        */
-        static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
-        /**
-        * Append a scene
-        * @param rootUrl a string that defines the root url for scene and resources
-        * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
-        * @param scene is the instance of BABYLON.Scene to append to
-        */
-        static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
-    }
-}
-
-declare module BABYLON {
     class DirectionalLight extends Light implements IShadowLight {
         direction: Vector3;
         position: Vector3;
@@ -2451,6 +2426,38 @@ declare module BABYLON {
 }
 
 declare module BABYLON {
+    interface ISceneLoaderPlugin {
+        extensions: string;
+        importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
+        load: (scene: Scene, data: string, rootUrl: string) => boolean;
+    }
+    class SceneLoader {
+        private static _ForceFullSceneLoadingForIncremental;
+        private static _ShowLoadingScreen;
+        static ForceFullSceneLoadingForIncremental: boolean;
+        static ShowLoadingScreen: boolean;
+        private static _registeredPlugins;
+        private static _getPluginForFilename(sceneFilename);
+        static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
+        static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
+        /**
+        * Load a scene
+        * @param rootUrl a string that defines the root url for scene and resources
+        * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
+        * @param engine is the instance of BABYLON.Engine to use to create the scene
+        */
+        static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
+        /**
+        * Append a scene
+        * @param rootUrl a string that defines the root url for scene and resources
+        * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
+        * @param scene is the instance of BABYLON.Scene to append to
+        */
+        static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
+    }
+}
+
+declare module BABYLON {
     class EffectFallbacks {
         private _defines;
         private _currentRank;
@@ -2502,12 +2509,15 @@ declare module BABYLON {
         setArray4(uniformName: string, array: number[]): Effect;
         setMatrices(uniformName: string, matrices: Float32Array): Effect;
         setMatrix(uniformName: string, matrix: Matrix): Effect;
+        setMatrix3x3(uniformName: string, matrix: Float32Array): Effect;
+        setMatrix2x2(uniformname: string, matrix: Float32Array): Effect;
         setFloat(uniformName: string, value: number): Effect;
         setBool(uniformName: string, bool: boolean): Effect;
         setVector2(uniformName: string, vector2: Vector2): Effect;
         setFloat2(uniformName: string, x: number, y: number): Effect;
         setVector3(uniformName: string, vector3: Vector3): Effect;
         setFloat3(uniformName: string, x: number, y: number, z: number): Effect;
+        setVector4(uniformName: string, vector4: Vector4): Effect;
         setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect;
         setColor3(uniformName: string, color3: Color3): Effect;
         setColor4(uniformName: string, color3: Color3, alpha: number): Effect;
@@ -2536,10 +2546,12 @@ declare module BABYLON {
         onBind: (material: Material, mesh: Mesh) => void;
         getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
         alphaMode: number;
+        disableDepthWrite: boolean;
         _effect: Effect;
         _wasPreviouslyReady: boolean;
         private _scene;
         private _fillMode;
+        private _cachedDepthWriteState;
         pointSize: number;
         zOffset: number;
         wireframe: boolean;
@@ -2583,7 +2595,10 @@ declare module BABYLON {
         private _colors4;
         private _vectors2;
         private _vectors3;
+        private _vectors4;
         private _matrices;
+        private _matrices3x3;
+        private _matrices2x2;
         private _cachedWorldViewMatrix;
         private _renderId;
         constructor(name: string, scene: Scene, shaderPath: any, options: any);
@@ -2597,7 +2612,10 @@ declare module BABYLON {
         setColor4(name: string, value: Color4): ShaderMaterial;
         setVector2(name: string, value: Vector2): ShaderMaterial;
         setVector3(name: string, value: Vector3): ShaderMaterial;
+        setVector4(name: string, value: Vector4): ShaderMaterial;
         setMatrix(name: string, value: Matrix): ShaderMaterial;
+        setMatrix3x3(name: string, value: Float32Array): ShaderMaterial;
+        setMatrix2x2(name: string, value: Float32Array): ShaderMaterial;
         isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
         bindOnlyWorldMatrix(world: Matrix): void;
         bind(world: Matrix, mesh?: Mesh): void;
@@ -2634,6 +2652,7 @@ declare module BABYLON {
         opacityFresnelParameters: FresnelParameters;
         reflectionFresnelParameters: FresnelParameters;
         emissiveFresnelParameters: FresnelParameters;
+        useGlossinessFromSpecularMapAlpha: boolean;
         private _renderTargets;
         private _worldViewProjectionMatrix;
         private _globalAmbientColor;
@@ -2689,6 +2708,8 @@ declare module BABYLON {
         clone(): Color3;
         copyFrom(source: Color3): Color3;
         copyFromFloats(r: number, g: number, b: number): Color3;
+        toHexString(): string;
+        static FromHexString(hex: string): Color3;
         static FromArray(array: number[], offset?: number): Color3;
         static FromInts(r: number, g: number, b: number): Color3;
         static Lerp(start: Color3, end: Color3, amount: number): Color3;
@@ -2719,6 +2740,8 @@ declare module BABYLON {
         toString(): string;
         clone(): Color4;
         copyFrom(source: Color4): Color4;
+        toHexString(): string;
+        static FromHexString(hex: string): Color4;
         static Lerp(left: Color4, right: Color4, amount: number): Color4;
         static LerpToRef(left: Color4, right: Color4, amount: number, result: Color4): void;
         static FromArray(array: number[], offset?: number): Color4;
@@ -2807,6 +2830,7 @@ declare module BABYLON {
         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 FromFloatArray(array: Float32Array, offset?: number): Vector3;
         static FromArrayToRef(array: number[], 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;
@@ -2941,6 +2965,10 @@ declare module BABYLON {
         toArray(): Float32Array;
         asArray(): Float32Array;
         invert(): Matrix;
+        reset(): Matrix;
+        add(other: Matrix): Matrix;
+        addToRef(other: Matrix, result: Matrix): Matrix;
+        addToSelf(other: Matrix): Matrix;
         invertToRef(other: Matrix): Matrix;
         invertToRefSIMD(other: Matrix): Matrix;
         setTranslation(vector3: Vector3): Matrix;
@@ -2955,6 +2983,7 @@ declare module BABYLON {
         decompose(scale: Vector3, rotation: Quaternion, translation: Vector3): boolean;
         static FromArray(array: number[], offset?: number): Matrix;
         static FromArrayToRef(array: number[], offset: number, result: Matrix): void;
+        static FromFloat32ArrayToRefScaled(array: Float32Array, offset: number, scale: number, result: Matrix): void;
         static FromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number, result: Matrix): void;
         static FromValues(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): Matrix;
         static Compose(scale: Vector3, rotation: Quaternion, translation: Vector3): Matrix;
@@ -2986,6 +3015,8 @@ declare module BABYLON {
         static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix;
         static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, fovMode?: number): void;
         static GetFinalMatrix(viewport: Viewport, world: Matrix, view: Matrix, projection: Matrix, zmin: number, zmax: number): Matrix;
+        static GetAsMatrix2x2(matrix: Matrix): Float32Array;
+        static GetAsMatrix3x3(matrix: Matrix): Float32Array;
         static Transpose(matrix: Matrix): Matrix;
         static Reflection(plane: Plane): Matrix;
         static ReflectionToRef(plane: Plane, result: Matrix): void;
@@ -3201,6 +3232,7 @@ declare module BABYLON {
         hasVertexAlpha: boolean;
         useVertexColors: boolean;
         applyFog: boolean;
+        computeBonesUsingShaders: boolean;
         useOctreeForRenderingSelection: boolean;
         useOctreeForPicking: boolean;
         useOctreeForCollisions: boolean;
@@ -3641,6 +3673,8 @@ declare module BABYLON {
         private _preActivateId;
         private _sideOrientation;
         private _areNormalsFrozen;
+        private _sourcePositions;
+        private _sourceNormals;
         /**
          * @constructor
          * @param {string} name - The value used by scene.getMeshByName() to do a lookup.
@@ -3769,6 +3803,11 @@ declare module BABYLON {
             (i: number, distance: number): number;
         }, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, tubeInstance?: Mesh): Mesh;
         static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle?: number): Mesh;
+        /**
+         * Update the vertex buffers by applying transformation from the bones
+         * @param {skeleton} skeleton to apply
+         */
+        applySkeleton(skeleton: Skeleton): Mesh;
         static MinMax(meshes: AbstractMesh[]): {
             min: Vector3;
             max: Vector3;
@@ -5212,8 +5251,10 @@ declare module BABYLON {
         apply: (scene: Scene) => boolean;
     }
     class MergeMeshesOptimization extends SceneOptimization {
+        static _UpdateSelectionTree: boolean;
+        static UpdateSelectionTree: boolean;
         private _canBeMerged;
-        apply: (scene: Scene) => boolean;
+        apply: (scene: Scene, updateSelectionTree?: boolean) => boolean;
     }
     class SceneOptimizerOptions {
         targetFrameRate: number;
@@ -5344,6 +5385,7 @@ declare module BABYLON {
     }
     class Tools {
         static BaseUrl: string;
+        static ToHex(i: number): string;
         static SetImmediate(action: () => void): void;
         static IsExponantOfTwo(value: number): boolean;
         static GetExponantOfTwo(value: number, max: number): number;
@@ -5392,6 +5434,7 @@ declare module BABYLON {
         private static _WarningLogLevel;
         private static _ErrorLogLevel;
         private static _LogCache;
+        static errorsCount: number;
         static OnNewCacheEntry: (entry: string) => void;
         static NoneLogLevel: number;
         static MessageLogLevel: number;
@@ -5410,6 +5453,7 @@ declare module BABYLON {
         private static _ErrorDisabled(message);
         private static _ErrorEnabled(message);
         static LogCache: string;
+        static ClearLogCache(): void;
         static LogLevels: number;
         private static _PerformanceNoneLogLevel;
         private static _PerformanceUserMarkLogLevel;
@@ -5611,9 +5655,6 @@ declare module BABYLON {
     }
 }
 
-declare module BABYLON.Internals {
-}
-
 declare module BABYLON {
     class ShadowGenerator {
         private static _FILTER_NONE;
@@ -5667,6 +5708,9 @@ declare module BABYLON {
     }
 }
 
+declare module BABYLON.Internals {
+}
+
 declare module BABYLON {
     class BaseTexture {
         name: string;

Datei-Diff unterdrückt, da er zu groß ist
+ 23 - 24
dist/preview release - alpha/babylon.2.2.js


Datei-Diff unterdrückt, da er zu groß ist
+ 806 - 511
dist/preview release - alpha/babylon.2.2.max.js


Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 23
dist/preview release - alpha/babylon.2.2.noworker.js


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

@@ -3,8 +3,15 @@
     - Meshes can now be attached to bones. See [documentation here](http://babylondoc.azurewebsites.net/page.php?p=22421) and [sample here](http://www.babylonjs-playground.com/#11BH6Z#18) [deltakosh](https://github.com/deltakosh)
     - HDR Rendering pipeline. See [demo here]() [julien-moreau](https://github.com/julien-moreau)
     - New rewored StandardMaterial.isReady for better memory usage and performance [deltakosh](https://github.com/deltakosh)
-    - Revamping of FBX exporter. Now supports animations and bones Simon Ferquel, [deltakosh](https://github.com/deltakosh)
+    - Revamping of FBX exporter. Now supports animations and bones [simonferquel](http://www.github.com/simonferquel), [deltakosh](https://github.com/deltakosh)
+    - StandardMaterial.useGlossinessFromSpecularMapAlpha to use specular map alpha as glossiness level [deltakosh](https://github.com/deltakosh)
   - **Updates**
+    - Added scene.getLensFlareSystemByName() [deltakosh](https://github.com/deltakosh)
+    - Added LensFlareSystem.setEmitter() [deltakosh](https://github.com/deltakosh)
+    - Added Color3.FromHexString() and Color3.toHexString() [deltakosh](https://github.com/deltakosh)
+    - Added Color4.FromHexString() and Color4.toHexString() [deltakosh](https://github.com/deltakosh)
+    - Added mesh.computeBonesUsingShaders to allow developers to disable HW skinning for low end devices [deltakosh](https://github.com/deltakosh)
+    - Added material.disableDepthWrite (default is off) [deltakosh](https://github.com/deltakosh)
     - Added material.alphaMode (default is BABYLON.Engine.ALPHA_COMBINE, can be set to BABYLON.Engine.ALPHA_ADD, *_SUBTRACT, *_MULTIPLY or *_MAXIMIZED ) [deltakosh](https://github.com/deltakosh), [jahow](https://github.com/jahow)
     - Added Animatable.reset() function [deltakosh](https://github.com/deltakosh)
     - New parameter for ArcRotateCamera.zoomOn to preserve maxZ [deltakosh](https://github.com/deltakosh)

+ 1 - 0
src/Actions/babylon.action.js

@@ -67,3 +67,4 @@ var BABYLON;
     })();
     BABYLON.Action = Action;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.action.js.map

+ 1 - 0
src/Actions/babylon.actionManager.js

@@ -286,3 +286,4 @@ var BABYLON;
     })();
     BABYLON.ActionManager = ActionManager;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.actionManager.js.map

+ 1 - 0
src/Actions/babylon.condition.js

@@ -116,3 +116,4 @@ var BABYLON;
     })(Condition);
     BABYLON.StateCondition = StateCondition;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.condition.js.map

+ 1 - 0
src/Actions/babylon.directActions.js

@@ -203,3 +203,4 @@ var BABYLON;
     })(BABYLON.Action);
     BABYLON.StopSoundAction = StopSoundAction;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.directActions.js.map

+ 1 - 0
src/Actions/babylon.interpolateValueAction.js

@@ -63,3 +63,4 @@ var BABYLON;
     })(BABYLON.Action);
     BABYLON.InterpolateValueAction = InterpolateValueAction;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.interpolateValueAction.js.map

+ 1 - 0
src/Animations/babylon.animatable.js

@@ -100,3 +100,4 @@ var BABYLON;
     })();
     BABYLON.Animatable = Animatable;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.animatable.js.map

+ 1 - 0
src/Animations/babylon.animation.js

@@ -384,3 +384,4 @@ var BABYLON;
     })();
     BABYLON.Animation = Animation;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.animation.js.map

+ 1 - 0
src/Animations/babylon.easing.js

@@ -248,3 +248,4 @@ var BABYLON;
     })(EasingFunction);
     BABYLON.BezierCurveEase = BezierCurveEase;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.easing.js.map

+ 1 - 0
src/Audio/babylon.analyser.js

@@ -109,3 +109,4 @@ var BABYLON;
     })();
     BABYLON.Analyser = Analyser;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.analyser.js.map

+ 1 - 0
src/Audio/babylon.audioEngine.js

@@ -77,3 +77,4 @@ var BABYLON;
     })();
     BABYLON.AudioEngine = AudioEngine;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.audioEngine.js.map

+ 1 - 0
src/Audio/babylon.sound.js

@@ -375,3 +375,4 @@ var BABYLON;
     })();
     BABYLON.Sound = Sound;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.sound.js.map

+ 1 - 0
src/Audio/babylon.soundtrack.js

@@ -92,3 +92,4 @@ var BABYLON;
     })();
     BABYLON.SoundTrack = SoundTrack;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.soundtrack.js.map

+ 1 - 0
src/Bones/babylon.bone.js

@@ -80,3 +80,4 @@ var BABYLON;
     })(BABYLON.Node);
     BABYLON.Bone = Bone;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.bone.js.map

+ 1 - 0
src/Bones/babylon.skeleton.js

@@ -74,3 +74,4 @@ var BABYLON;
     })();
     BABYLON.Skeleton = Skeleton;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.skeleton.js.map

+ 1 - 1
src/Bones/babylon.skeleton.ts

@@ -53,7 +53,7 @@
                     bone.getWorldMatrix().copyFrom(bone.getLocalMatrix());
                 }
 
-                bone.getInvertedAbsoluteTransform().multiplyToArray(bone.getWorldMatrix(), this._transformMatrices, index * 16);
+                bone.getInvertedAbsoluteTransform().multiplyToArray(bone.getWorldMatrix(), this._transformMatrices, index * 16);                
             }
 
             this._identity.copyToArray(this._transformMatrices, this.bones.length * 16);

+ 1 - 0
src/Cameras/VR/babylon.vrDeviceOrientationCamera.js

@@ -46,3 +46,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.VRDeviceOrientationFreeCamera = VRDeviceOrientationFreeCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.vrDeviceOrientationCamera.js.map

+ 1 - 0
src/Cameras/VR/babylon.webVRCamera.js

@@ -72,3 +72,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.WebVRFreeCamera = WebVRFreeCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.webVRCamera.js.map

+ 1 - 0
src/Cameras/babylon.arcRotateCamera.js

@@ -535,3 +535,4 @@ var BABYLON;
     })(BABYLON.TargetCamera);
     BABYLON.ArcRotateCamera = ArcRotateCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.arcRotateCamera.js.map

+ 1 - 0
src/Cameras/babylon.camera.js

@@ -526,3 +526,4 @@ var BABYLON;
     })(BABYLON.Node);
     BABYLON.Camera = Camera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.camera.js.map

+ 1 - 0
src/Cameras/babylon.deviceOrientationCamera.js

@@ -70,3 +70,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.DeviceOrientationCamera = DeviceOrientationCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.deviceOrientationCamera.js.map

+ 1 - 0
src/Cameras/babylon.followCamera.js

@@ -85,3 +85,4 @@ var BABYLON;
     })(BABYLON.TargetCamera);
     BABYLON.ArcFollowCamera = ArcFollowCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.followCamera.js.map

+ 1 - 0
src/Cameras/babylon.freeCamera.js

@@ -224,3 +224,4 @@ var BABYLON;
     })(BABYLON.TargetCamera);
     BABYLON.FreeCamera = FreeCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.freeCamera.js.map

+ 1 - 0
src/Cameras/babylon.gamepadCamera.js

@@ -50,3 +50,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.GamepadCamera = GamepadCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.gamepadCamera.js.map

+ 1 - 0
src/Cameras/babylon.stereoscopicCameras.js

@@ -61,3 +61,4 @@ var BABYLON;
     })(BABYLON.GamepadCamera);
     BABYLON.StereoscopicGamepadCamera = StereoscopicGamepadCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.stereoscopicCameras.js.map

+ 1 - 0
src/Cameras/babylon.targetCamera.js

@@ -239,3 +239,4 @@ var BABYLON;
     })(BABYLON.Camera);
     BABYLON.TargetCamera = TargetCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.targetCamera.js.map

+ 1 - 0
src/Cameras/babylon.touchCamera.js

@@ -114,3 +114,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.TouchCamera = TouchCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.touchCamera.js.map

+ 1 - 0
src/Cameras/babylon.virtualJoysticksCamera.js

@@ -50,3 +50,4 @@ var BABYLON;
     })(BABYLON.FreeCamera);
     BABYLON.VirtualJoysticksCamera = VirtualJoysticksCamera;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.virtualJoysticksCamera.js.map

+ 1 - 0
src/Collisions/babylon.collider.js

@@ -270,3 +270,4 @@ var BABYLON;
     })();
     BABYLON.Collider = Collider;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.collider.js.map

+ 1 - 0
src/Collisions/babylon.collisionCoordinator.js

@@ -271,3 +271,4 @@ var BABYLON;
     })();
     BABYLON.CollisionCoordinatorLegacy = CollisionCoordinatorLegacy;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.collisionCoordinator.js.map

+ 1 - 0
src/Collisions/babylon.collisionWorker.js

@@ -227,3 +227,4 @@ var BABYLON;
         console.log("single worker init");
     }
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.collisionWorker.js.map

+ 1 - 0
src/Collisions/babylon.pickingInfo.js

@@ -73,3 +73,4 @@ var BABYLON;
     })();
     BABYLON.PickingInfo = PickingInfo;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.pickingInfo.js.map

+ 1 - 0
src/Culling/Octrees/babylon.octree.js

@@ -86,3 +86,4 @@ var BABYLON;
     })();
     BABYLON.Octree = Octree;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.octree.js.map

+ 1 - 0
src/Culling/Octrees/babylon.octreeBlock.js

@@ -120,3 +120,4 @@ var BABYLON;
     })();
     BABYLON.OctreeBlock = OctreeBlock;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.octreeBlock.js.map

+ 1 - 0
src/Culling/babylon.boundingBox.js

@@ -137,3 +137,4 @@ var BABYLON;
     })();
     BABYLON.BoundingBox = BoundingBox;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.boundingBox.js.map

+ 1 - 0
src/Culling/babylon.boundingInfo.js

@@ -103,3 +103,4 @@ var BABYLON;
     })();
     BABYLON.BoundingInfo = BoundingInfo;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.boundingInfo.js.map

+ 1 - 0
src/Culling/babylon.boundingSphere.js

@@ -47,3 +47,4 @@ var BABYLON;
     })();
     BABYLON.BoundingSphere = BoundingSphere;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.boundingSphere.js.map

+ 1 - 0
src/Debug/babylon.debugLayer.js

@@ -602,3 +602,4 @@ var BABYLON;
     })();
     BABYLON.DebugLayer = DebugLayer;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.debugLayer.js.map

+ 1 - 0
src/Layer/babylon.layer.js

@@ -74,3 +74,4 @@ var BABYLON;
     })();
     BABYLON.Layer = Layer;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.layer.js.map

+ 1 - 0
src/LensFlare/babylon.lensFlare.js

@@ -21,3 +21,4 @@ var BABYLON;
     })();
     BABYLON.LensFlare = LensFlare;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.lensFlare.js.map

+ 4 - 0
src/LensFlare/babylon.lensFlareSystem.js

@@ -47,6 +47,9 @@ var BABYLON;
         LensFlareSystem.prototype.getEmitter = function () {
             return this._emitter;
         };
+        LensFlareSystem.prototype.setEmitter = function (newEmitter) {
+            this._emitter = newEmitter;
+        };
         LensFlareSystem.prototype.getEmitterPosition = function () {
             return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
         };
@@ -176,3 +179,4 @@ var BABYLON;
     })();
     BABYLON.LensFlareSystem = LensFlareSystem;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.lensFlareSystem.js.map

+ 4 - 0
src/LensFlare/babylon.lensFlareSystem.ts

@@ -67,6 +67,10 @@
             return this._emitter;
         }
 
+        public setEmitter(newEmitter: any): void {
+            this._emitter = newEmitter;
+        }
+
         public getEmitterPosition(): Vector3 {
             return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
         }

+ 3 - 2
src/Lights/Shadows/babylon.shadowGenerator.js

@@ -68,7 +68,7 @@ var BABYLON;
                         _this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
                     }
                     // Bones
-                    if (mesh.useBones) {
+                    if (mesh.useBones && mesh.computeBonesUsingShaders) {
                         _this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
                     }
                     // Draw
@@ -236,7 +236,7 @@ var BABYLON;
                 }
             }
             // Bones
-            if (mesh.useBones) {
+            if (mesh.useBones && mesh.computeBonesUsingShaders) {
                 attribs.push(BABYLON.VertexBuffer.MatricesIndicesKind);
                 attribs.push(BABYLON.VertexBuffer.MatricesWeightsKind);
                 defines.push("#define BONES");
@@ -333,3 +333,4 @@ var BABYLON;
     })();
     BABYLON.ShadowGenerator = ShadowGenerator;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.shadowGenerator.js.map

+ 2 - 2
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -192,7 +192,7 @@
                     }
 
                     // Bones
-                    if (mesh.useBones) {
+                    if (mesh.useBones && mesh.computeBonesUsingShaders) {
                         this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
                     }
 
@@ -258,7 +258,7 @@
             }
 
             // Bones
-            if (mesh.useBones) {
+            if (mesh.useBones && mesh.computeBonesUsingShaders) {
                 attribs.push(VertexBuffer.MatricesIndicesKind);
                 attribs.push(VertexBuffer.MatricesWeightsKind);
                 defines.push("#define BONES");

+ 1 - 0
src/Lights/babylon.directionalLight.js

@@ -93,3 +93,4 @@ var BABYLON;
     })(BABYLON.Light);
     BABYLON.DirectionalLight = DirectionalLight;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.directionalLight.js.map

+ 1 - 0
src/Lights/babylon.hemisphericLight.js

@@ -35,3 +35,4 @@ var BABYLON;
     })(BABYLON.Light);
     BABYLON.HemisphericLight = HemisphericLight;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.hemisphericLight.js.map

+ 1 - 0
src/Lights/babylon.light.js

@@ -76,3 +76,4 @@ var BABYLON;
     })(BABYLON.Node);
     BABYLON.Light = Light;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.light.js.map

+ 1 - 0
src/Lights/babylon.pointLight.js

@@ -40,3 +40,4 @@ var BABYLON;
     })(BABYLON.Light);
     BABYLON.PointLight = PointLight;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.pointLight.js.map

+ 1 - 0
src/Lights/babylon.spotLight.js

@@ -70,3 +70,4 @@ var BABYLON;
     })(BABYLON.Light);
     BABYLON.SpotLight = SpotLight;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.spotLight.js.map

+ 4 - 0
src/Loading/Plugins/babylon.babylonFileLoader.js

@@ -111,6 +111,9 @@ var BABYLON;
             material.emissiveColor = BABYLON.Color3.FromArray(parsedMaterial.emissive);
             material.alpha = parsedMaterial.alpha;
             material.id = parsedMaterial.id;
+            if (parsedMaterial.disableDepthWrite) {
+                material.disableDepthWrite = parsedMaterial.disableDepthWrite;
+            }
             BABYLON.Tags.AddTagsTo(material, parsedMaterial.tags);
             material.backFaceCulling = parsedMaterial.backFaceCulling;
             material.wireframe = parsedMaterial.wireframe;
@@ -1422,3 +1425,4 @@ var BABYLON;
         });
     })(Internals = BABYLON.Internals || (BABYLON.Internals = {}));
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.babylonFileLoader.js.map

+ 4 - 0
src/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -133,6 +133,10 @@
 
         material.id = parsedMaterial.id;
 
+        if (parsedMaterial.disableDepthWrite) {
+            material.disableDepthWrite = parsedMaterial.disableDepthWrite;
+        }
+
         BABYLON.Tags.AddTagsTo(material, parsedMaterial.tags);
         material.backFaceCulling = parsedMaterial.backFaceCulling;
         material.wireframe = parsedMaterial.wireframe;

+ 2 - 2
src/Loading/babylon.sceneLoader.js

@@ -60,7 +60,7 @@ var BABYLON;
                     try {
                         if (!plugin.importMesh(meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons)) {
                             if (onerror) {
-                                onerror(scene, 'unable to load the scene');
+                                onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename);
                             }
                             scene._removePendingData(loadingToken);
                             return;
@@ -68,7 +68,7 @@ var BABYLON;
                     }
                     catch (e) {
                         if (onerror) {
-                            onerror(scene, e);
+                            onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename + ' (Exception: ' + e + ')');
                         }
                         scene._removePendingData(loadingToken);
                         return;

+ 2 - 2
src/Loading/babylon.sceneLoader.ts

@@ -79,14 +79,14 @@
                     try {
                         if (!plugin.importMesh(meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons)) {
                             if (onerror) {
-                                onerror(scene, 'unable to load the scene');
+                                onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename);
                             }
                             scene._removePendingData(loadingToken);
                             return;
                         }
                     } catch (e) {
                         if (onerror) {
-                            onerror(scene, e);
+                            onerror(scene, 'Unable to import meshes from ' + rootUrl + sceneFilename + ' (Exception: ' + e + ')');
                         }
                         scene._removePendingData(loadingToken);
                         return;

+ 1 - 0
src/Materials/Textures/Procedurals/babylon.customProceduralTexture.js

@@ -123,3 +123,4 @@ var BABYLON;
     })(BABYLON.ProceduralTexture);
     BABYLON.CustomProceduralTexture = CustomProceduralTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.customProceduralTexture.js.map

+ 1 - 0
src/Materials/Textures/Procedurals/babylon.proceduralTexture.js

@@ -247,3 +247,4 @@ var BABYLON;
     })(BABYLON.Texture);
     BABYLON.ProceduralTexture = ProceduralTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.proceduralTexture.js.map

+ 1 - 0
src/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js

@@ -418,3 +418,4 @@ var BABYLON;
     })(BABYLON.ProceduralTexture);
     BABYLON.MarbleProceduralTexture = MarbleProceduralTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.standardProceduralTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.baseTexture.js

@@ -125,3 +125,4 @@ var BABYLON;
     })();
     BABYLON.BaseTexture = BaseTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.baseTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.cubeTexture.js

@@ -59,3 +59,4 @@ var BABYLON;
     })(BABYLON.BaseTexture);
     BABYLON.CubeTexture = CubeTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.cubeTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.dynamicTexture.js

@@ -92,3 +92,4 @@ var BABYLON;
     })(BABYLON.Texture);
     BABYLON.DynamicTexture = DynamicTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.dynamicTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.mirrorTexture.js

@@ -43,3 +43,4 @@ var BABYLON;
     })(BABYLON.RenderTargetTexture);
     BABYLON.MirrorTexture = MirrorTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.mirrorTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.renderTargetTexture.js

@@ -165,3 +165,4 @@ var BABYLON;
     })(BABYLON.Texture);
     BABYLON.RenderTargetTexture = RenderTargetTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.renderTargetTexture.js.map

+ 1 - 0
src/Materials/Textures/babylon.texture.js

@@ -212,3 +212,4 @@ var BABYLON;
     })(BABYLON.BaseTexture);
     BABYLON.Texture = Texture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.texture.js.map

+ 1 - 0
src/Materials/Textures/babylon.videoTexture.js

@@ -57,3 +57,4 @@ var BABYLON;
     })(BABYLON.Texture);
     BABYLON.VideoTexture = VideoTexture;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.videoTexture.js.map

+ 16 - 0
src/Materials/babylon.effect.js

@@ -287,6 +287,14 @@ var BABYLON;
             this._engine.setMatrix(this.getUniform(uniformName), matrix);
             return this;
         };
+        Effect.prototype.setMatrix3x3 = function (uniformName, matrix) {
+            this._engine.setMatrix3x3(this.getUniform(uniformName), matrix);
+            return this;
+        };
+        Effect.prototype.setMatrix2x2 = function (uniformname, matrix) {
+            this._engine.setMatrix2x2(this.getUniform(uniformname), matrix);
+            return this;
+        };
         Effect.prototype.setFloat = function (uniformName, value) {
             if (this._valueCache[uniformName] && this._valueCache[uniformName] === value)
                 return this;
@@ -329,6 +337,13 @@ var BABYLON;
             this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
             return this;
         };
+        Effect.prototype.setVector4 = function (uniformName, vector4) {
+            if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === vector4.x && this._valueCache[uniformName][1] === vector4.y && this._valueCache[uniformName][2] === vector4.z && this._valueCache[uniformName][3] === vector4.w)
+                return this;
+            this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);
+            this._engine.setFloat4(this.getUniform(uniformName), vector4.x, vector4.y, vector4.z, vector4.w);
+            return this;
+        };
         Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
             if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
                 return this;
@@ -356,3 +371,4 @@ var BABYLON;
     })();
     BABYLON.Effect = Effect;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.effect.js.map

+ 23 - 0
src/Materials/babylon.effect.ts

@@ -361,6 +361,18 @@
             return this;
         }
 
+        public setMatrix3x3(uniformName: string, matrix: Float32Array): Effect {
+            this._engine.setMatrix3x3(this.getUniform(uniformName), matrix);
+
+            return this;
+        }
+
+        public setMatrix2x2(uniformname: string, matrix: Float32Array): Effect {
+            this._engine.setMatrix2x2(this.getUniform(uniformname), matrix);
+
+            return this;
+        }
+
         public setFloat(uniformName: string, value: number): Effect {
             if (this._valueCache[uniformName] && this._valueCache[uniformName] === value)
                 return this;
@@ -424,6 +436,17 @@
             return this;
         }
 
+        public setVector4(uniformName: string, vector4: Vector4): Effect {
+            if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === vector4.x && this._valueCache[uniformName][1] === vector4.y && this._valueCache[uniformName][2] === vector4.z && this._valueCache[uniformName][3] === vector4.w)
+                return this;
+
+            this._cacheFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);
+
+            this._engine.setFloat4(this.getUniform(uniformName), vector4.x, vector4.y, vector4.z, vector4.w);
+
+            return this;
+        }
+
         public setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect {
             if (this._valueCache[uniformName] && this._valueCache[uniformName][0] === x && this._valueCache[uniformName][1] === y && this._valueCache[uniformName][2] === z && this._valueCache[uniformName][3] === w)
                 return this;

+ 11 - 0
src/Materials/babylon.material.js

@@ -9,6 +9,7 @@ var BABYLON;
             this.alpha = 1.0;
             this.backFaceCulling = true;
             this.alphaMode = BABYLON.Engine.ALPHA_COMBINE;
+            this.disableDepthWrite = false;
             this._wasPreviouslyReady = false;
             this._fillMode = Material.TriangleFillMode;
             this.pointSize = 1.0;
@@ -100,10 +101,19 @@ var BABYLON;
             if (this.onBind) {
                 this.onBind(this, mesh);
             }
+            if (this.disableDepthWrite) {
+                var engine = this._scene.getEngine();
+                this._cachedDepthWriteState = engine.getDepthWrite();
+                engine.setDepthWrite(false);
+            }
         };
         Material.prototype.bindOnlyWorldMatrix = function (world) {
         };
         Material.prototype.unbind = function () {
+            if (this.disableDepthWrite) {
+                var engine = this._scene.getEngine();
+                engine.setDepthWrite(this._cachedDepthWriteState);
+            }
         };
         Material.prototype.clone = function (name) {
             return null;
@@ -129,3 +139,4 @@ var BABYLON;
     })();
     BABYLON.Material = Material;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.material.js.map

+ 12 - 0
src/Materials/babylon.material.ts

@@ -28,11 +28,13 @@
         public onBind: (material: Material, mesh: Mesh) => void;
         public getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
         public alphaMode = Engine.ALPHA_COMBINE;
+        public disableDepthWrite = false;
 
         public _effect: Effect;
         public _wasPreviouslyReady = false;
         private _scene: Scene;
         private _fillMode = Material.TriangleFillMode;
+        private _cachedDepthWriteState: boolean;
 
         public pointSize = 1.0;
 
@@ -112,12 +114,22 @@
             if (this.onBind) {
                 this.onBind(this, mesh);
             }
+
+            if (this.disableDepthWrite) {
+                var engine = this._scene.getEngine();
+                this._cachedDepthWriteState = engine.getDepthWrite();
+                engine.setDepthWrite(false);
+            }
         }
 
         public bindOnlyWorldMatrix(world: Matrix): void {
         }
 
         public unbind(): void {
+            if (this.disableDepthWrite) {
+                var engine = this._scene.getEngine();
+                engine.setDepthWrite(this._cachedDepthWriteState);
+            }
         }
 
         public clone(name: string): Material {

+ 1 - 0
src/Materials/babylon.multiMaterial.js

@@ -44,3 +44,4 @@ var BABYLON;
     })(BABYLON.Material);
     BABYLON.MultiMaterial = MultiMaterial;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.multiMaterial.js.map

+ 33 - 2
src/Materials/babylon.shaderMaterial.js

@@ -17,7 +17,10 @@ var BABYLON;
             this._colors4 = new Array();
             this._vectors2 = new Array();
             this._vectors3 = new Array();
+            this._vectors4 = new Array();
             this._matrices = new Array();
+            this._matrices3x3 = new Array();
+            this._matrices2x2 = new Array();
             this._cachedWorldViewMatrix = new BABYLON.Matrix();
             this._shaderPath = shaderPath;
             options.needAlphaBlending = options.needAlphaBlending || false;
@@ -75,11 +78,26 @@ var BABYLON;
             this._vectors3[name] = value;
             return this;
         };
+        ShaderMaterial.prototype.setVector4 = function (name, value) {
+            this._checkUniform(name);
+            this._vectors4[name] = value;
+            return this;
+        };
         ShaderMaterial.prototype.setMatrix = function (name, value) {
             this._checkUniform(name);
             this._matrices[name] = value;
             return this;
         };
+        ShaderMaterial.prototype.setMatrix3x3 = function (name, value) {
+            this._checkUniform(name);
+            this._matrices3x3[name] = value;
+            return this;
+        };
+        ShaderMaterial.prototype.setMatrix2x2 = function (name, value) {
+            this._checkUniform(name);
+            this._matrices2x2[name] = value;
+            return this;
+        };
         ShaderMaterial.prototype.isReady = function (mesh, useInstances) {
             var scene = this.getScene();
             var engine = scene.getEngine();
@@ -95,7 +113,7 @@ var BABYLON;
                 defines.push("#define INSTANCES");
             }
             // Bones
-            if (mesh && mesh.useBones) {
+            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                 defines.push("#define BONES");
                 defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1));
                 defines.push("#define BONES4");
@@ -144,7 +162,7 @@ var BABYLON;
                     this._effect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
                 }
                 // Bones
-                if (mesh && mesh.useBones) {
+                if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                     this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
                 }
                 // Texture
@@ -176,10 +194,22 @@ var BABYLON;
                 for (name in this._vectors3) {
                     this._effect.setVector3(name, this._vectors3[name]);
                 }
+                // Vector4        
+                for (name in this._vectors4) {
+                    this._effect.setVector4(name, this._vectors4[name]);
+                }
                 // Matrix      
                 for (name in this._matrices) {
                     this._effect.setMatrix(name, this._matrices[name]);
                 }
+                // Matrix 3x3
+                for (name in this._matrices3x3) {
+                    this._effect.setMatrix3x3(name, this._matrices3x3[name]);
+                }
+                // Matrix 2x2
+                for (name in this._matrices2x2) {
+                    this._effect.setMatrix2x2(name, this._matrices2x2[name]);
+                }
             }
             _super.prototype.bind.call(this, world, mesh);
         };
@@ -198,3 +228,4 @@ var BABYLON;
     })(BABYLON.Material);
     BABYLON.ShaderMaterial = ShaderMaterial;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.shaderMaterial.js.map

+ 41 - 2
src/Materials/babylon.shaderMaterial.ts

@@ -9,7 +9,10 @@
         private _colors4 = new Array<Color4>();
         private _vectors2 = new Array<Vector2>();
         private _vectors3 = new Array<Vector3>();
+        private _vectors4 = new Array<Vector4>();
         private _matrices = new Array<Matrix>();
+        private _matrices3x3 = new Array<Float32Array>();
+        private _matrices2x2 = new Array<Float32Array>();
         private _cachedWorldViewMatrix = new Matrix();
         private _renderId: number;
 
@@ -91,6 +94,13 @@
             return this;
         }
 
+        public setVector4(name: string, value: Vector4): ShaderMaterial {
+            this._checkUniform(name);
+            this._vectors4[name] = value;
+
+            return this;
+        }
+
         public setMatrix(name: string, value: Matrix): ShaderMaterial {
             this._checkUniform(name);
             this._matrices[name] = value;
@@ -98,6 +108,20 @@
             return this;
         }
 
+        public setMatrix3x3(name: string, value: Float32Array): ShaderMaterial {
+            this._checkUniform(name);
+            this._matrices3x3[name] = value;
+
+            return this;
+        }
+
+        public setMatrix2x2(name: string, value: Float32Array): ShaderMaterial {
+            this._checkUniform(name);
+            this._matrices2x2[name] = value;
+
+            return this;
+        }
+
         public isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean {
             var scene = this.getScene();
             var engine = scene.getEngine();
@@ -116,7 +140,7 @@
             }
 
             // Bones
-            if (mesh && mesh.useBones) {
+            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                 defines.push("#define BONES");
                 defines.push("#define BonesPerMesh " + (mesh.skeleton.bones.length + 1));
                 defines.push("#define BONES4");
@@ -185,7 +209,7 @@
                 }
 
                 // Bones
-                if (mesh && mesh.useBones) {
+                if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                     this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
                 }
 
@@ -225,10 +249,25 @@
                     this._effect.setVector3(name, this._vectors3[name]);
                 }
 
+                // Vector4        
+                for (name in this._vectors4) {
+                    this._effect.setVector4(name, this._vectors4[name]);
+                }
+
                 // Matrix      
                 for (name in this._matrices) {
                     this._effect.setMatrix(name, this._matrices[name]);
                 }
+
+                // Matrix 3x3
+                for (name in this._matrices3x3) {
+                    this._effect.setMatrix3x3(name, this._matrices3x3[name]);
+                }
+
+                // Matrix 2x2
+                for (name in this._matrices2x2) {
+                    this._effect.setMatrix2x2(name, this._matrices2x2[name]);
+                }
             }
 
             super.bind(world, mesh);

+ 7 - 2
src/Materials/babylon.standardMaterial.js

@@ -78,6 +78,7 @@ var BABYLON;
             this.BONES4 = false;
             this.BonesPerMesh = 0;
             this.INSTANCES = false;
+            this.GLOSSINESS = false;
             this._keys = Object.keys(this);
         }
         StandardMaterialDefines.prototype.isEqual = function (other) {
@@ -134,6 +135,7 @@ var BABYLON;
             this.useAlphaFromDiffuseTexture = false;
             this.useSpecularOverAlpha = true;
             this.fogEnabled = true;
+            this.useGlossinessFromSpecularMapAlpha = false;
             this._renderTargets = new BABYLON.SmartArray(16);
             this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
@@ -237,6 +239,7 @@ var BABYLON;
                     else {
                         needUVs = true;
                         this._defines.SPECULAR = true;
+                        this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha;
                     }
                 }
             }
@@ -377,7 +380,7 @@ var BABYLON;
                         this._defines.VERTEXALPHA = true;
                     }
                 }
-                if (mesh.useBones) {
+                if (mesh.useBones && mesh.computeBonesUsingShaders) {
                     this._defines.BONES = true;
                     this._defines.BonesPerMesh = (mesh.skeleton.bones.length + 1);
                     this._defines.BONES4 = true;
@@ -502,6 +505,7 @@ var BABYLON;
             if (this.reflectionTexture && this.reflectionTexture.isRenderTarget) {
                 this._effect.setTexture("reflection2DSampler", null);
             }
+            _super.prototype.unbind.call(this);
         };
         StandardMaterial.prototype.bindOnlyWorldMatrix = function (world) {
             this._effect.setMatrix("world", world);
@@ -512,7 +516,7 @@ var BABYLON;
             this.bindOnlyWorldMatrix(world);
             this._effect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
-            if (mesh && mesh.useBones) {
+            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                 this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
             }
             if (scene.getCachedMaterial() !== this) {
@@ -758,3 +762,4 @@ var BABYLON;
     })(BABYLON.Material);
     BABYLON.StandardMaterial = StandardMaterial;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.standardMaterial.js.map

+ 8 - 2
src/Materials/babylon.standardMaterial.ts

@@ -68,6 +68,7 @@
         public BONES4 = false;
         public BonesPerMesh = 0;
         public INSTANCES = false;
+        public GLOSSINESS = false;
 
         _keys: string[];
 
@@ -150,6 +151,8 @@
         public reflectionFresnelParameters: FresnelParameters;
         public emissiveFresnelParameters: FresnelParameters;
 
+        public useGlossinessFromSpecularMapAlpha = false;
+
         private _renderTargets = new SmartArray<RenderTargetTexture>(16);
         private _worldViewProjectionMatrix = Matrix.Zero();
         private _globalAmbientColor = new Color3(0, 0, 0);
@@ -272,6 +275,7 @@
                     } else {
                         needUVs = true;
                         this._defines.SPECULAR = true;
+                        this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha;    
                     }
                 }
             }
@@ -441,7 +445,7 @@
                         this._defines.VERTEXALPHA = true
                     }
                 }
-                if (mesh.useBones) {
+                if (mesh.useBones && mesh.computeBonesUsingShaders) {
                     this._defines.BONES = true;
                     this._defines.BonesPerMesh = (mesh.skeleton.bones.length + 1);
                     this._defines.BONES4 = true;
@@ -601,6 +605,8 @@
             if (this.reflectionTexture && this.reflectionTexture.isRenderTarget) {
                 this._effect.setTexture("reflection2DSampler", null);
             }
+
+            super.unbind();
         }
 
         public bindOnlyWorldMatrix(world: Matrix): void {
@@ -615,7 +621,7 @@
             this._effect.setMatrix("viewProjection", scene.getTransformMatrix());
 
             // Bones
-            if (mesh && mesh.useBones) {
+            if (mesh && mesh.useBones && mesh.computeBonesUsingShaders) {
                 this._effect.setMatrices("mBones", mesh.skeleton.getTransformMatrices());
             }
 

+ 82 - 0
src/Math/babylon.math.js

@@ -91,7 +91,23 @@ var BABYLON;
             this.b = b;
             return this;
         };
+        Color3.prototype.toHexString = function () {
+            var intR = (this.r * 255) | 0;
+            var intG = (this.g * 255) | 0;
+            var intB = (this.b * 255) | 0;
+            return "#" + BABYLON.Tools.ToHex(intR) + BABYLON.Tools.ToHex(intG) + BABYLON.Tools.ToHex(intB);
+        };
         // Statics
+        Color3.FromHexString = function (hex) {
+            if (hex.substring(0, 1) !== "#" || hex.length != 7) {
+                BABYLON.Tools.Warn("Color3.FromHexString must be called with a string like #FFFFFF");
+                return new Color3(0, 0, 0);
+            }
+            var r = parseInt(hex.substring(1, 3), 16);
+            var g = parseInt(hex.substring(3, 5), 16);
+            var b = parseInt(hex.substring(5, 7), 16);
+            return Color3.FromInts(r, g, b);
+        };
         Color3.FromArray = function (array, offset) {
             if (offset === void 0) { offset = 0; }
             return new Color3(array[offset], array[offset + 1], array[offset + 2]);
@@ -183,7 +199,25 @@ var BABYLON;
             this.a = source.a;
             return this;
         };
+        Color4.prototype.toHexString = function () {
+            var intR = (this.r * 255) | 0;
+            var intG = (this.g * 255) | 0;
+            var intB = (this.b * 255) | 0;
+            var intA = (this.a * 255) | 0;
+            return "#" + BABYLON.Tools.ToHex(intR) + BABYLON.Tools.ToHex(intG) + BABYLON.Tools.ToHex(intB) + BABYLON.Tools.ToHex(intA);
+        };
         // Statics
+        Color4.FromHexString = function (hex) {
+            if (hex.substring(0, 1) !== "#" || hex.length != 9) {
+                BABYLON.Tools.Warn("Color4.FromHexString must be called with a string like #FFFFFFFF");
+                return new Color4(0, 0, 0, 0);
+            }
+            var r = parseInt(hex.substring(1, 3), 16);
+            var g = parseInt(hex.substring(3, 5), 16);
+            var b = parseInt(hex.substring(5, 7), 16);
+            var a = parseInt(hex.substring(7, 9), 16);
+            return Color4.FromInts(r, g, b, a);
+        };
         Color4.Lerp = function (left, right, amount) {
             var result = new Color4(0, 0, 0, 0);
             Color4.LerpToRef(left, right, amount, result);
@@ -586,6 +620,12 @@ var BABYLON;
             }
             return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
         };
+        Vector3.FromFloatArray = function (array, offset) {
+            if (!offset) {
+                offset = 0;
+            }
+            return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
+        };
         Vector3.FromArrayToRef = function (array, offset, result) {
             result.x = array[offset];
             result.y = array[offset + 1];
@@ -1453,6 +1493,29 @@ var BABYLON;
             this.invertToRef(this);
             return this;
         };
+        Matrix.prototype.reset = function () {
+            for (var index = 0; index < 16; index++) {
+                this.m[index] = 0;
+            }
+            return this;
+        };
+        Matrix.prototype.add = function (other) {
+            var result = new Matrix();
+            this.addToRef(other, result);
+            return result;
+        };
+        Matrix.prototype.addToRef = function (other, result) {
+            for (var index = 0; index < 16; index++) {
+                result.m[index] = this.m[index] + other.m[index];
+            }
+            return this;
+        };
+        Matrix.prototype.addToSelf = function (other) {
+            for (var index = 0; index < 16; index++) {
+                this.m[index] += other.m[index];
+            }
+            return this;
+        };
         Matrix.prototype.invertToRef = function (other) {
             var l1 = this.m[0];
             var l2 = this.m[1];
@@ -1758,6 +1821,11 @@ var BABYLON;
                 result.m[index] = array[index + offset];
             }
         };
+        Matrix.FromFloat32ArrayToRefScaled = function (array, offset, scale, result) {
+            for (var index = 0; index < 16; index++) {
+                result.m[index] = array[index + offset] * scale;
+            }
+        };
         Matrix.FromValuesToRef = function (initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) {
             result.m[0] = initialM11;
             result.m[1] = initialM12;
@@ -2102,6 +2170,19 @@ var BABYLON;
             var viewportMatrix = Matrix.FromValues(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, zmax - zmin, 0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1);
             return world.multiply(view).multiply(projection).multiply(viewportMatrix);
         };
+        Matrix.GetAsMatrix2x2 = function (matrix) {
+            return new Float32Array([
+                matrix.m[0], matrix.m[1],
+                matrix.m[4], matrix.m[5]
+            ]);
+        };
+        Matrix.GetAsMatrix3x3 = function (matrix) {
+            return new Float32Array([
+                matrix.m[0], matrix.m[1], matrix.m[2],
+                matrix.m[4], matrix.m[5], matrix.m[6],
+                matrix.m[8], matrix.m[9], matrix.m[10]
+            ]);
+        };
         Matrix.Transpose = function (matrix) {
             var result = new Matrix();
             result.m[0] = matrix.m[0];
@@ -3011,3 +3092,4 @@ var BABYLON;
     })();
     BABYLON.SIMDHelper = SIMDHelper;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.math.js.map

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

@@ -115,7 +115,28 @@
             return this;
         }
 
+        public toHexString(): string {
+            var intR = (this.r * 255) | 0;
+            var intG = (this.g * 255) | 0;
+            var intB = (this.b * 255) | 0;
+
+            return "#" + Tools.ToHex(intR) + Tools.ToHex(intG) + Tools.ToHex(intB);
+        }
+
         // Statics
+        public static FromHexString(hex: string): Color3 {
+            if (hex.substring(0, 1) !== "#" || hex.length != 7) {
+                Tools.Warn("Color3.FromHexString must be called with a string like #FFFFFF");
+                return new Color3(0, 0, 0);
+            }
+
+            var r = parseInt(hex.substring(1, 3), 16);
+            var g = parseInt(hex.substring(3, 5), 16);
+            var b = parseInt(hex.substring(5, 7), 16);
+
+            return Color3.FromInts(r, g, b);
+        }
+
         public static FromArray(array: number[], offset: number = 0): Color3 {
             return new Color3(array[offset], array[offset + 1], array[offset + 2]);
         }
@@ -224,7 +245,30 @@
             return this;
         }
 
+        public toHexString(): string {
+            var intR = (this.r * 255) | 0;
+            var intG = (this.g * 255) | 0;
+            var intB = (this.b * 255) | 0;
+            var intA = (this.a * 255) | 0;
+
+            return "#" + Tools.ToHex(intR) + Tools.ToHex(intG) + Tools.ToHex(intB) + Tools.ToHex(intA);
+        }
+
         // Statics
+        public static FromHexString(hex: string): Color4 {
+            if (hex.substring(0, 1) !== "#" || hex.length != 9) {
+                Tools.Warn("Color4.FromHexString must be called with a string like #FFFFFFFF");
+                return new Color4(0, 0, 0, 0);
+            }
+
+            var r = parseInt(hex.substring(1, 3), 16);
+            var g = parseInt(hex.substring(3, 5), 16);
+            var b = parseInt(hex.substring(5, 7), 16);
+            var a = parseInt(hex.substring(7, 9), 16);
+
+            return Color4.FromInts(r, g, b, a);
+        }
+
         public static Lerp(left: Color4, right: Color4, amount: number): Color4 {
             var result = new Color4(0, 0, 0, 0);
 
@@ -739,6 +783,14 @@
             return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
         }
 
+        public static FromFloatArray(array: Float32Array, offset?: number): Vector3 {
+            if (!offset) {
+                offset = 0;
+            }
+
+            return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
+        }
+
         public static FromArrayToRef(array: number[], offset: number, result: Vector3): void {
             result.x = array[offset];
             result.y = array[offset + 1];
@@ -1791,6 +1843,38 @@
             return this;
         }
 
+        public reset(): Matrix {
+            for (var index = 0; index < 16; index++) {
+                this.m[index] = 0;
+            }
+
+            return this;
+        }
+
+        public add(other: Matrix): Matrix {
+            var result = new Matrix();
+
+            this.addToRef(other, result);
+
+            return result;
+        }
+
+        public addToRef(other: Matrix, result: Matrix): Matrix {
+            for (var index = 0; index < 16; index++) {
+                result.m[index] = this.m[index] + other.m[index];
+            }
+
+            return this;
+        }
+
+        public addToSelf(other: Matrix): Matrix {
+            for (var index = 0; index < 16; index++) {
+                this.m[index] += other.m[index];
+            }
+
+            return this;
+        }
+
         public invertToRef(other: Matrix): Matrix {
             var l1 = this.m[0];
             var l2 = this.m[1];
@@ -2179,12 +2263,17 @@
         }
 
         public static FromArrayToRef(array: number[], offset: number, result: Matrix) {
-
             for (var index = 0; index < 16; index++) {
                 result.m[index] = array[index + offset];
             }
         }
 
+        public static FromFloat32ArrayToRefScaled(array: Float32Array, offset: number, scale: number, result: Matrix) {
+            for (var index = 0; index < 16; index++) {
+                result.m[index] = array[index + offset] * scale;
+            }
+        }
+
         public static FromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number,
             initialM21: number, initialM22: number, initialM23: number, initialM24: number,
             initialM31: number, initialM32: number, initialM33: number, initialM34: number,
@@ -2653,6 +2742,21 @@
             return world.multiply(view).multiply(projection).multiply(viewportMatrix);
         }
 
+        public static GetAsMatrix2x2(matrix: Matrix): Float32Array {
+            return new Float32Array([
+                matrix.m[0], matrix.m[1],
+                matrix.m[4], matrix.m[5]
+            ]);
+        }
+
+        public static GetAsMatrix3x3(matrix: Matrix): Float32Array {
+            return new Float32Array([
+                matrix.m[0], matrix.m[1], matrix.m[2],
+                matrix.m[4], matrix.m[5], matrix.m[6],
+                matrix.m[8], matrix.m[9], matrix.m[10]
+            ]);
+        }
+
         public static Transpose(matrix: Matrix): Matrix {
             var result = new Matrix();
 

+ 2 - 0
src/Mesh/babylon.abstractMesh.js

@@ -37,6 +37,7 @@ var BABYLON;
             this.hasVertexAlpha = false;
             this.useVertexColors = true;
             this.applyFog = true;
+            this.computeBonesUsingShaders = true;
             this.useOctreeForRenderingSelection = true;
             this.useOctreeForPicking = true;
             this.useOctreeForCollisions = true;
@@ -860,3 +861,4 @@ var BABYLON;
     })(BABYLON.Node);
     BABYLON.AbstractMesh = AbstractMesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.abstractMesh.js.map

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

@@ -57,6 +57,7 @@
         public hasVertexAlpha = false;
         public useVertexColors = true;
         public applyFog = true;
+        public computeBonesUsingShaders = true;
 
         public useOctreeForRenderingSelection = true;
         public useOctreeForPicking = true;

+ 1 - 0
src/Mesh/babylon.csg.js

@@ -508,3 +508,4 @@ var BABYLON;
     })();
     BABYLON.CSG = CSG;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.csg.js.map

+ 1 - 0
src/Mesh/babylon.geometry.js

@@ -609,3 +609,4 @@ var BABYLON;
         })(Primitives = Geometry.Primitives || (Geometry.Primitives = {}));
     })(Geometry = BABYLON.Geometry || (BABYLON.Geometry = {}));
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.geometry.js.map

+ 1 - 0
src/Mesh/babylon.groundMesh.js

@@ -40,3 +40,4 @@ var BABYLON;
     })(BABYLON.Mesh);
     BABYLON.GroundMesh = GroundMesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.groundMesh.js.map

+ 1 - 0
src/Mesh/babylon.instancedMesh.js

@@ -151,3 +151,4 @@ var BABYLON;
     })(BABYLON.AbstractMesh);
     BABYLON.InstancedMesh = InstancedMesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.instancedMesh.js.map

+ 1 - 0
src/Mesh/babylon.linesMesh.js

@@ -68,3 +68,4 @@ var BABYLON;
     })(BABYLON.Mesh);
     BABYLON.LinesMesh = LinesMesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.linesMesh.js.map

+ 74 - 0
src/Mesh/babylon.mesh.js

@@ -1674,6 +1674,79 @@ var BABYLON;
             decal.rotation = new BABYLON.Vector3(pitch, yaw, angle);
             return decal;
         };
+        // Skeletons
+        /**
+         * Update the vertex buffers by applying transformation from the bones
+         * @param {skeleton} skeleton to apply
+         */
+        Mesh.prototype.applySkeleton = function (skeleton) {
+            if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) {
+                return this;
+            }
+            if (!this._sourcePositions) {
+                var source = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
+                this._sourcePositions = new Float32Array(source);
+                if (!this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable()) {
+                    this.setVerticesData(BABYLON.VertexBuffer.PositionKind, source, true);
+                }
+            }
+            if (!this._sourceNormals) {
+                var source = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
+                this._sourceNormals = new Float32Array(source);
+                if (!this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable()) {
+                    this.setVerticesData(BABYLON.VertexBuffer.NormalKind, source, true);
+                }
+            }
+            var positionsData = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
+            var normalsData = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
+            var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind);
+            var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind);
+            var skeletonMatrices = skeleton.getTransformMatrices();
+            var tempVector3 = BABYLON.Vector3.Zero();
+            var finalMatrix = new BABYLON.Matrix();
+            var tempMatrix = new BABYLON.Matrix();
+            for (var index = 0; index < positionsData.length; index += 3) {
+                var index4 = (index / 3) * 4;
+                var matricesWeight0 = matricesWeightsData[index4];
+                var matricesWeight1 = matricesWeightsData[index4 + 1];
+                var matricesWeight2 = matricesWeightsData[index4 + 2];
+                var matricesWeight3 = matricesWeightsData[index4 + 3];
+                if (matricesWeight0 > 0) {
+                    var matricesIndex0 = matricesIndicesData[index4];
+                    BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4] * 16, matricesWeight0, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+                if (matricesWeight1 > 0) {
+                    BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 1] * 16, matricesWeight1, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+                if (matricesWeight2 > 0) {
+                    BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 2] * 16, matricesWeight2, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+                if (matricesWeight3 > 0) {
+                    BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 3] * 16, matricesWeight3, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+                BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[index], this._sourcePositions[index + 1], this._sourcePositions[index + 2], finalMatrix, tempVector3);
+                tempVector3.toArray(positionsData, index);
+                BABYLON.Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[index], this._sourceNormals[index + 1], this._sourceNormals[index + 2], finalMatrix, tempVector3);
+                tempVector3.toArray(normalsData, index);
+                finalMatrix.reset();
+            }
+            this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positionsData);
+            this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normalsData);
+            return this;
+        };
         // Tools
         Mesh.MinMax = function (meshes) {
             var minVector = null;
@@ -1768,3 +1841,4 @@ var BABYLON;
     })(BABYLON.AbstractMesh);
     BABYLON.Mesh = Mesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.mesh.js.map

+ 98 - 4
src/Mesh/babylon.mesh.ts

@@ -69,6 +69,9 @@
         private _sideOrientation: number = Mesh._DEFAULTSIDE;
         private _areNormalsFrozen: boolean = false; // Will be used by ribbons mainly
 
+        private _sourcePositions: Float32Array; // Will be used to save original positions when using software skinning
+        private _sourceNormals: Float32Array; // Will be used to save original normals when using software skinning
+
         /**
          * @constructor
          * @param {string} name - The value used by scene.getMeshByName() to do a lookup.
@@ -1013,10 +1016,8 @@
         public applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number): void {
             if (!this.isVerticesDataPresent(VertexBuffer.PositionKind)
                 || !this.isVerticesDataPresent(VertexBuffer.NormalKind)
-                || !this.isVerticesDataPresent(VertexBuffer.UVKind)
-                || !this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable()
-                || !this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable()) {
-                Tools.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing or not updatable");
+                || !this.isVerticesDataPresent(VertexBuffer.UVKind)) {
+                Tools.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing");
                 return;
             }
 
@@ -1955,6 +1956,99 @@
             return decal;
         }
 
+        // Skeletons
+
+        /**
+         * Update the vertex buffers by applying transformation from the bones
+         * @param {skeleton} skeleton to apply
+         */
+        public applySkeleton(skeleton: Skeleton): Mesh {
+            if (!this.isVerticesDataPresent(VertexBuffer.PositionKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(VertexBuffer.NormalKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind)) {
+                return this;
+            }
+            if (!this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)) {
+                return this;
+            }
+
+            if (!this._sourcePositions) {
+                var source = this.getVerticesData(VertexBuffer.PositionKind);
+                this._sourcePositions = new Float32Array(source);
+
+                if (!this.getVertexBuffer(VertexBuffer.PositionKind).isUpdatable()) {
+                    this.setVerticesData(VertexBuffer.PositionKind, source, true);
+                }
+            }
+
+            if (!this._sourceNormals) {
+                var source = this.getVerticesData(VertexBuffer.NormalKind);
+                this._sourceNormals = new Float32Array(source);
+
+                if (!this.getVertexBuffer(VertexBuffer.NormalKind).isUpdatable()) {
+                    this.setVerticesData(VertexBuffer.NormalKind, source, true);
+                }
+            }
+
+            var positionsData = this.getVerticesData(VertexBuffer.PositionKind);
+            var normalsData = this.getVerticesData(VertexBuffer.NormalKind);
+
+            var matricesIndicesData = this.getVerticesData(VertexBuffer.MatricesIndicesKind);
+            var matricesWeightsData = this.getVerticesData(VertexBuffer.MatricesWeightsKind);
+
+            var skeletonMatrices = skeleton.getTransformMatrices();
+
+            var tempVector3 = Vector3.Zero();
+            var finalMatrix = new Matrix();
+            var tempMatrix = new Matrix();
+
+            for (var index = 0; index < positionsData.length; index += 3) {
+                var index4 = (index / 3) * 4;
+                var matricesWeight0 = matricesWeightsData[index4];
+                var matricesWeight1 = matricesWeightsData[index4 + 1];
+                var matricesWeight2 = matricesWeightsData[index4 + 2];
+                var matricesWeight3 = matricesWeightsData[index4 + 3];
+                
+                if (matricesWeight0 > 0) {
+                    var matricesIndex0 = matricesIndicesData[index4];
+                    Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4] * 16, matricesWeight0, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+
+                if (matricesWeight1> 0) {
+                    Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 1] * 16, matricesWeight1, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+
+                if (matricesWeight2 > 0) {
+                    Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 2] * 16, matricesWeight2, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+
+                if (matricesWeight3 > 0) {
+                    Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[index4 + 3] * 16, matricesWeight3, tempMatrix);
+                    finalMatrix.addToSelf(tempMatrix);
+                }
+
+                Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[index], this._sourcePositions[index + 1], this._sourcePositions[index + 2], finalMatrix, tempVector3);
+                tempVector3.toArray(positionsData, index);
+
+                Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[index], this._sourceNormals[index + 1], this._sourceNormals[index + 2], finalMatrix, tempVector3);
+                tempVector3.toArray(normalsData, index);
+
+                finalMatrix.reset();
+            }
+
+            this.updateVerticesData(VertexBuffer.PositionKind, positionsData);
+            this.updateVerticesData(VertexBuffer.NormalKind, normalsData);
+
+            return this;
+        }
+
         // Tools
         public static MinMax(meshes: AbstractMesh[]): { min: Vector3; max: Vector3 } {
             var minVector: Vector3 = null;

+ 6 - 4
src/Mesh/babylon.mesh.vertexData.js

@@ -600,7 +600,7 @@ var BABYLON;
                 pathArray[i] = [];
                 for (var j = 0; j < tessellation; j++) {
                     angle = j * angle_step;
-                    ringVertex = BABYLON.Vector3.TransformCoordinates(normals[i], BABYLON.Matrix.RotationAxis(tangents[i], angle));
+                    ringVertex = new BABYLON.Vector3(Math.cos(-angle), 0, Math.sin(-angle));
                     ringVertex.scaleInPlace(radiusFunction(i, distances[i])).addInPlace(path[i]);
                     pathArray[i].push(ringVertex);
                 }
@@ -617,9 +617,10 @@ var BABYLON;
                 var textureScale = new BABYLON.Vector2(0.5, 0.5);
                 // Positions, normals & uvs
                 var angle;
+                var circleVector;
                 for (var i = 0; i < tessellation; i++) {
                     angle = Math.PI * 2 * i / tessellation;
-                    var circleVector = new BABYLON.Vector3(Math.cos(angle), 0, Math.sin(angle));
+                    circleVector = new BABYLON.Vector3(Math.cos(-angle), 0, Math.sin(-angle));
                     var position = circleVector.scale(radius).add(offset);
                     var textureCoordinate = new BABYLON.Vector2(circleVector.x * textureScale.x + 0.5, circleVector.z * textureScale.y + 0.5);
                     vertexdata.positions.push(position.x, position.y, position.z);
@@ -630,13 +631,13 @@ var BABYLON;
                 for (i = 0; i < tessellation - 2; i++) {
                     if (!isTop) {
                         vertexdata.indices.push(vbase);
-                        vertexdata.indices.push(vbase + (i + 2) % tessellation);
                         vertexdata.indices.push(vbase + (i + 1) % tessellation);
+                        vertexdata.indices.push(vbase + (i + 2) % tessellation);
                     }
                     else {
                         vertexdata.indices.push(vbase);
-                        vertexdata.indices.push(vbase + (i + 1) % tessellation);
                         vertexdata.indices.push(vbase + (i + 2) % tessellation);
+                        vertexdata.indices.push(vbase + (i + 1) % tessellation);
                     }
                 }
             };
@@ -1164,3 +1165,4 @@ var BABYLON;
     })();
     BABYLON.VertexData = VertexData;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.mesh.vertexData.js.map

+ 6 - 4
src/Mesh/babylon.mesh.vertexData.ts

@@ -741,7 +741,7 @@
 
                 for (var j = 0; j < tessellation; j++) {
                     angle = j * angle_step;
-                    ringVertex = Vector3.TransformCoordinates(normals[i], Matrix.RotationAxis(tangents[i], angle));
+                    ringVertex = new Vector3(Math.cos(-angle), 0, Math.sin(-angle));
                     ringVertex.scaleInPlace(radiusFunction(i, distances[i])).addInPlace(path[i]);
                     pathArray[i].push(ringVertex);
                 }
@@ -760,9 +760,10 @@
                 var textureScale = new Vector2(0.5, 0.5);
                 // Positions, normals & uvs
                 var angle;
+                var circleVector;
                 for (var i = 0; i < tessellation; i++) {
                     angle = Math.PI * 2 * i / tessellation;
-                    var circleVector = new Vector3(Math.cos(angle), 0, Math.sin(angle));
+                    circleVector = new Vector3(Math.cos(-angle), 0, Math.sin(-angle));
                     var position = circleVector.scale(radius).add(offset);
                     var textureCoordinate = new Vector2(circleVector.x * textureScale.x + 0.5, circleVector.z * textureScale.y + 0.5);
                     vertexdata.positions.push(position.x, position.y, position.z);
@@ -773,13 +774,13 @@
                 for (i = 0; i < tessellation - 2; i++) {
                     if (!isTop) {
                         vertexdata.indices.push(vbase);
-                        vertexdata.indices.push(vbase + (i + 2) % tessellation);
                         vertexdata.indices.push(vbase + (i + 1) % tessellation);
+                        vertexdata.indices.push(vbase + (i + 2) % tessellation);
                     }
                     else {
                         vertexdata.indices.push(vbase);
-                        vertexdata.indices.push(vbase + (i + 1) % tessellation);
                         vertexdata.indices.push(vbase + (i + 2) % tessellation);
+                        vertexdata.indices.push(vbase + (i + 1) % tessellation);
                     }
                 }
             };
@@ -1421,3 +1422,4 @@
 } 
 
 
+

+ 1 - 0
src/Mesh/babylon.meshLODLevel.js

@@ -12,3 +12,4 @@ var BABYLON;
         Internals.MeshLODLevel = MeshLODLevel;
     })(Internals = BABYLON.Internals || (BABYLON.Internals = {}));
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.meshLODLevel.js.map

+ 1 - 0
src/Mesh/babylon.meshSimplification.js

@@ -656,3 +656,4 @@ var BABYLON;
     })();
     BABYLON.QuadraticErrorSimplification = QuadraticErrorSimplification;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.meshSimplification.js.map

+ 1 - 0
src/Mesh/babylon.polygonMesh.js

@@ -244,3 +244,4 @@ var BABYLON;
     })();
     BABYLON.PolygonMeshBuilder = PolygonMeshBuilder;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.polygonMesh.js.map

+ 1 - 0
src/Mesh/babylon.subMesh.js

@@ -143,3 +143,4 @@ var BABYLON;
     })();
     BABYLON.SubMesh = SubMesh;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.subMesh.js.map

+ 1 - 0
src/Mesh/babylon.vertexBuffer.js

@@ -190,3 +190,4 @@ var BABYLON;
     })();
     BABYLON.VertexBuffer = VertexBuffer;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.vertexBuffer.js.map

+ 1 - 0
src/Particles/babylon.particle.js

@@ -27,3 +27,4 @@ var BABYLON;
     })();
     BABYLON.Particle = Particle;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.particle.js.map

+ 1 - 0
src/Particles/babylon.particleSystem.js

@@ -334,3 +334,4 @@ var BABYLON;
     })();
     BABYLON.ParticleSystem = ParticleSystem;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.particleSystem.js.map

+ 1 - 0
src/Physics/Plugins/babylon.cannonJSPlugin.js

@@ -251,3 +251,4 @@ var BABYLON;
     })();
     BABYLON.CannonJSPlugin = CannonJSPlugin;
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.cannonJSPlugin.js.map

+ 0 - 0
src/Physics/Plugins/babylon.oimoJSPlugin.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.