浏览代码

huge commit; basically all updated

Justin Oblak 12 年之前
父节点
当前提交
76da625e60
共有 44 个文件被更改,包括 1552 次插入523 次删除
  1. 2 0
      Typescript/Animations/babylon.animatable.d.ts
  2. 1 1
      Typescript/Bones/babylon.bone.d.ts
  3. 8 14
      Typescript/Collisions/babylon.collider.d.ts
  4. 16 0
      Typescript/Collisions/babylon.collisionPlane.d.ts
  5. 17 0
      Typescript/Culling/Octrees/babylon.octree.d.ts
  6. 18 0
      Typescript/Culling/Octrees/babylon.octreeBlock.d.ts
  7. 10 33
      Typescript/Culling/babylon.bounding.d.ts
  8. 21 0
      Typescript/Culling/babylon.boundingInfo.d.ts
  9. 20 0
      Typescript/Culling/babylon.boundingSphere.d.ts
  10. 8 2
      Typescript/Layer/babylon.layer.d.ts
  11. 22 0
      Typescript/Lights/Shadows/babylon.shadowGenerator.d.ts
  12. 13 0
      Typescript/Lights/babylon.directionalLight.d.ts
  13. 15 0
      Typescript/Lights/babylon.hemisphericLight.d.ts
  14. 4 17
      Typescript/Lights/babylon.light.d.ts
  15. 12 0
      Typescript/Lights/babylon.pointLight.d.ts
  16. 15 0
      Typescript/Lights/babylon.spotLight.d.ts
  17. 8 4
      Typescript/Materials/babylon.effect.d.ts
  18. 7 29
      Typescript/Materials/babylon.material.d.ts
  19. 11 0
      Typescript/Materials/babylon.multiMaterial.d.ts
  20. 23 0
      Typescript/Materials/babylon.standardMaterial.d.ts
  21. 23 0
      Typescript/Materials/textures/babylon.baseTexture.d.ts
  22. 10 0
      Typescript/Materials/textures/babylon.cubeTexture.d.ts
  23. 14 0
      Typescript/Materials/textures/babylon.dynamicTexture.d.ts
  24. 12 0
      Typescript/Materials/textures/babylon.mirrorTexture.d.ts
  25. 18 0
      Typescript/Materials/textures/babylon.renderTargetTexture.d.ts
  26. 12 57
      Typescript/Materials/textures/babylon.texture.d.ts
  27. 13 0
      Typescript/Materials/textures/babylon.videoTexture.d.ts
  28. 50 44
      Typescript/Mesh/babylon.mesh.d.ts
  29. 26 0
      Typescript/Mesh/babylon.subMesh.d.ts
  30. 21 0
      Typescript/Mesh/babylon.vertexBuffer.d.ts
  31. 0 50
      Typescript/Particles/babylon.particle.d.ts
  32. 60 0
      Typescript/Particles/babylon.particleSystem.d.ts
  33. 6 0
      Typescript/PostProcess/babylon.postProcess.d.ts
  34. 8 0
      Typescript/PostProcess/babylon.postProcessManager.d.ts
  35. 4 14
      Typescript/Sprites/Babylon.Sprite.d.ts
  36. 20 0
      Typescript/Sprites/Babylon.spriteManager.d.ts
  37. 31 0
      Typescript/Tools/babylon.database.d.ts
  38. 92 16
      Typescript/Tools/babylon.math.d.ts
  39. 19 3
      Typescript/Tools/babylon.sceneLoader.d.ts
  40. 21 0
      Typescript/Tools/babylon.tools.d.ts
  41. 34 3
      Typescript/babylon.d.ts
  42. 37 15
      Typescript/babylon.engine.d.ts
  43. 719 217
      Typescript/babylon.min.d.ts
  44. 51 4
      Typescript/babylon.scene.d.ts

+ 2 - 0
Typescript/Animations/babylon.animatable.d.ts

@@ -12,6 +12,8 @@ declare module BABYLON {
 
         constructor(target: Object, from: number, to: number, loop: boolean, speedRatio: number, onAnimationEnd: Function);
 
+        animationStarted: boolean;
+
         _animate(delay: number): boolean;
     }
 }

+ 1 - 1
Typescript/Bones/babylon.bone.d.ts

@@ -12,7 +12,7 @@ declare module BABYLON {
         children: Bone[];
         animation: Animation[];
 
-        constructor(name: string, skeleton: Skeleton; parentBone: Bone, matrix: Matrix);
+        constructor(name: string, skeleton: Skeleton, parentBone: Bone, matrix: Matrix);
 
         getParent(): Bone;
         getLocalMatrix: Matrix;

+ 8 - 14
Typescript/Collisions/babylon.collider.d.ts

@@ -10,25 +10,19 @@ declare module BABYLON {
         radius: Vector3;
         retry: number;
 
+        basePointWorld: Vector3;
+        velocityWorld: Vector3;
+        normalizedVelocity: Vector3;
+
         constructor();
 
         _initialize(source: Vector3, dir: Vector3, e: number): void;
-        _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): bool;
+        _checkPontInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean;
+        intersectBoxAASphere(boxMin: Vector3, boxMax: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
+        getLowestRoot(a: number, b: number, c: number, maxR: number): Object;
+        _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean;
         _testTriangle(subMesh: SubMesh, p1: Vector3, p2: Vector3, p3: Vector3): void;
         _collide(subMesh: SubMesh, pts: VertexBuffer, indices: IndexBuffer, indexStart: number, indexEnd: number, decal: number);
         _getResponse(pos: Vector3, vel: Vector3): CollisionResponse;
     }
-
-    class CollisionPlane {
-        normal: Vector3;
-        origin: Vector3;
-        equation: number[];
-
-        constructor(origin: Vector3, normal: Vector3);
-
-        isFrontFactingTo(direction: Vector3, epsilon: number): bool;
-        signedDistanceTo(point: Vector3): number;
-
-        static CreateFromPoints(p1: Vector3, p2: Vector3, p3: Vector3): CollisionPlane;
-    }
 }

+ 16 - 0
Typescript/Collisions/babylon.collisionPlane.d.ts

@@ -0,0 +1,16 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class CollisionPlane {
+        normal: Vector3;
+        origin: Vector3;
+        equation: number[];
+
+        constructor(origin: Vector3, normal: Vector3);
+
+        isFrontFactingTo(direction: Vector3, epsilon: number): boolean;
+        signedDistanceTo(point: Vector3): number;
+
+        static CreateFromPoints(p1: Vector3, p2: Vector3, p3: Vector3): CollisionPlane;
+    }
+}

+ 17 - 0
Typescript/Culling/Octrees/babylon.octree.d.ts

@@ -0,0 +1,17 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class Octree {
+        blocks: OctreeBlock[];
+        _maxBlockCapacity: number;
+        _selection: Tools.SmartArray;
+
+        constructor(maxBlockCapacity: number);
+
+        update(worldMin: Vector3, worldMax: Vector3, meshes: Mesh[]): void;
+        addMesh(mesh: Mesh): void;
+        select(frustrumPlanes: Plane[]): void;
+
+        static _CreateBlocks(worldMin: Vector3, worldMax: Vector3, meshes: Mesh[], maxBlockCapacity: number, target: OctreeBlock): void;
+    }
+}

+ 18 - 0
Typescript/Culling/Octrees/babylon.octreeBlock.d.ts

@@ -0,0 +1,18 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class OctreeBlock {
+        subMeshes: Mesh[];
+        meshes: Mesh[];
+        _capacity: number;
+        _minPoint: Vector3;
+        _maxPoint: Vector3;
+        _boundingVector: Vector3[];
+
+        constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number)
+
+        addMesh(mesh: Mesh): void;
+        addEntries(meshes: Mesh[]): void;
+        select(frustrumPlanes: Plane[], selection: Tools.SmartArray): void;
+    }
+}

+ 10 - 33
Typescript/Culling/babylon.bounding.d.ts

@@ -8,42 +8,19 @@ declare module BABYLON {
         center: Vector3;
         extends: Vector3;
         directions: Vector3[];
+        vectorsWorld: Vector3[];
+        minimumWorld: Vector3;
+        maximumWorld: Vector3;
 
-        constructor(vertices: VertexBuffer, stride: number, start: number, count: number);
+        constructor(minimum: Vector3, maximum: Vector3);
 
         _update(world: Matrix): void;
-        isInFrustrum(frustrumPlanes: Plane[]): bool;
-        intersectsPoint(point: Vector3): bool;
-        
-        static intersects(box0: BoundingBox, box1: BoundingBox): bool;
-    }
-
-    class BoundingSphere {
-        minimum: Vector3;
-        maximum: Vector3;
-        center: Vector3;
-        radius: number;
-
-        constructor(vertices: VertexBuffer, stride: number, start: number, count: number);
-
-        _update(world: Matrix, scale: number): void;
-        isInFrustrum(frustrumPlanes: Plane[]): bool;
-        intersectsPoint(point: Vector3): bool;
-
-        static intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): bool;
-    }
-
-    class BoundingInfo {
-        boundingBox: BoundingBox;
-        boundingSphere: BoundingSphere;
-
-        constructor(vertices: VertexBuffer, stride: number, start: number, count: number);
-
-        _update(world: Matrix, scale: number): void;
-        isInFrustrum(frustrumPlanes: Plane[]): bool;
-        _checkCollision(collider: Collider): bool;
-        intersectsPoint(point: Vector3): bool;
-        intersects(boundingInfo: BoundingInfo, precise: bool): bool;
+        isInFrustrum(frustrumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersectsSphere(sphere: Sphere): boolean;
+        intersectsMinMax(min: Vector3, max: Vector3): boolean;
+        IsInFrustrum(boundingVectors: Vector3[], frustrumPlanes: Plane[]): boolean;
 
+        static intersects(box0: BoundingBox, box1: BoundingBox): boolean;
     }
 }

+ 21 - 0
Typescript/Culling/babylon.boundingInfo.d.ts

@@ -0,0 +1,21 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class BoundingInfo {
+        boundingBox: BoundingBox;
+        boundingSphere: BoundingSphere;
+
+        constructor(minimum: Vector3, maximum, Vector3);
+
+        _update(world: Matrix, scale: number): void;
+
+        extentsOverlap(min0, max0, min1, max1): boolean;
+        computeBoxExtents(axis: Vector3, box: BoundingBox): Object;
+        axisOverlap(axis: Vector3, box0: BoundingBox, box1: BoundingBox): boolean;
+        isInFrustrum(frustrumPlanes: Plane[]): boolean;
+        _checkCollision(collider: Collider): boolean;
+        intersectsPoint(point: Vector3): boolean;
+        intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
+
+    }
+}

+ 20 - 0
Typescript/Culling/babylon.boundingSphere.d.ts

@@ -0,0 +1,20 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class BoundingSphere {
+        minimum: Vector3;
+        maximum: Vector3;
+        center: Vector3;
+        radius: number;
+        distance: number;
+        centerWorld: Vector3;
+
+        constructor(minimum: Vector3, maximum: Vector3);
+
+        _update(world: Matrix, scale: number): void;
+        isInFrustrum(frustrumPlanes: Plane[]): boolean;
+        intersectsPoint(point: Vector3): boolean;
+
+        static intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
+    }
+}

+ 8 - 2
Typescript/Layer/babylon.layer.d.ts

@@ -4,9 +4,15 @@ declare module BABYLON {
     class Layer {
         name: string;
         texture: Texture;
-        isBackground: bool;
+        isBackground: boolean;
+        color: Color4;
+        _scene: Scene;
+        vertices: number[];
+        indicies: number[];
+        _indexBuffer: IndexBuffer;
+        _effect: Effect;
 
-        constructor(name: string, imgUrl: string, scene: Scene, isBackground: bool);
+        constructor(name: string, imgUrl: string, scene: Scene, isBackground: boolean, color: Color4);
 
         onDispose: () => void;
         render(): void;

+ 22 - 0
Typescript/Lights/Shadows/babylon.shadowGenerator.d.ts

@@ -0,0 +1,22 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class ShadowGenerator {
+        _light: Light;
+        _scene: Scene;
+
+        _shadowMap: RenderTargetTexture;
+
+        constructor(mapSize: number, light: Light);
+
+        renderSubMesh(subMesh: Mesh): void;
+
+        useVarianceShadowMap: boolean;
+
+        isReady(mesh: Mesh): boolean;
+        getShadowMap(): RenderTargetTexture;
+        getLight(): Light;
+        getTransformMatrix(): Matrix;
+        dispose(): void;
+    }
+}

+ 13 - 0
Typescript/Lights/babylon.directionalLight.d.ts

@@ -0,0 +1,13 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class DirectionalLight extends Light {
+        direction: Vector3;
+        animations: Animation[];
+        position: Vector3;
+        diffuse: Color3;
+        specular: Color3;
+
+        constructor(name: string, direction: Vector3, scene: Scene);
+    }
+}

+ 15 - 0
Typescript/Lights/babylon.hemisphericLight.d.ts

@@ -0,0 +1,15 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class HemisphericLight {
+        direction: Vector3;
+        diffuse: Color3;
+        specular: Color3;
+        groundColor: Color3;
+        animations: Animation[];
+
+        constructor(name: string, direction: Vector3, scene: Scene);
+
+        getShadowGenerator(): void;
+    }
+}

+ 4 - 17
Typescript/Lights/babylon.light.d.ts

@@ -4,27 +4,14 @@ declare module BABYLON {
     class Light {
         name: string;
         id: string;
-        diffuse: Color3;
-        specular: Color3;
-        private _scene: Scene;
 
         constructor(name: string, scene: Scene);
 
         intensity: number;
-        isEnabled: bool;
-    }
-
-    class PointLight extends Light {
-        position: Vector3;
-        animations: Animation[]; 
-
-        constructor(name: string, position: Vector3, scene: Scene);
-    }
-
-    class DirectionalLight extends Light {
-        direction: Vector3;
-        animations: Animation[]; 
+        isEnabled: boolean;
 
-        constructor(name: string, direction: Vector3, scene: Scene);
+        getScene(): Scene;
+        getShadowGenerator: ShadowGenerator;
+        dispose(): void;
     }
 }

+ 12 - 0
Typescript/Lights/babylon.pointLight.d.ts

@@ -0,0 +1,12 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class PointLight extends Light {
+        position: Vector3;
+        diffuse: Color3;
+        specular: Color3;
+        animations: Animation[];
+
+        constructor(name: string, position: Vector3, scene: Scene)
+    }
+}

+ 15 - 0
Typescript/Lights/babylon.spotLight.d.ts

@@ -0,0 +1,15 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class SpotLight {
+        position: Vector3;
+        direction: Vector3;
+        angle: number;
+        exponent: number;
+        diffuse: Color3;
+        specular: Color3;
+        animations: Animation[];
+
+        constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponsent: number, scene: Scene);
+    }
+}

+ 8 - 4
Typescript/Materials/babylon.effect.d.ts

@@ -7,21 +7,25 @@ declare module BABYLON {
 
         constructor(baseName: string, attributesNames: string[], uniformsNames: string[], samplers: WebGLUniformLocation[], engine: Engine, defines: string);
 
-        isReady(): bool;
+        isReady(): boolean;
         getProgram(): WebGLProgram;
         getAttribute(index: number): string;
+        getAttributesNames(): string;
         getAttributesCount(): number;
         getUniformIndex(uniformName: string): number;
         getUniform(uniformName: string): string;
         getSamplers(): WebGLUniformLocation[];
+        getCompilationError(): string;
 
         _prepareEffect(vertexSourceCode: string, fragmentSourceCode: string, attributeNames: string[], defines: string): void;
         setTexture(channel: string, texture: Texture): void;
+        setMatrices(uniformName: string, matrices: Matrix[]): void;
         setMatrix(uniformName: string, matrix: Matrix): void;
-        setBool(uniformName: string, val: bool): void;
-        setVector2(uniformName: string, x: number, y: number): void;
+        setBool(uniformName: string, val: boolean): void;
         setVector3(uniformName: string, val: Vector3): void;
-        setVector4(uniformName: string, x: number, y: number, z: number, w: number): void;
+        setFloat2(uniformName: string, x: number, y: number);
+        setFloat3(uniformName: string, x: number, y: number, z: number);
+        setFloat4(uniformName: string, x: number, y: number, z: number, w: number);
         setColor3(uniformName: string, color: Color3): void;
         setColor4(uniformName: string, color: Color4): void;
 

+ 7 - 29
Typescript/Materials/babylon.material.d.ts

@@ -4,49 +4,27 @@ declare module BABYLON {
     class Material {
         name: string;
         id: string;
-        private _scene: Scene;
 
         constructor(name: string, scene: Scene);
 
+        checkReadyOnEveryCall: boolean;
         alpha: number;
-        wireframe: bool;
-        backFaceCulling: bool;
+        wireframe: boolean;
+        backFaceCulling: boolean;
         _effect: Effect;
 
         onDispose: () => void;
 
-        isReady(): bool;
+        isReady(): boolean;
         getEffect(): Effect;
-        needAlphaBlending(): bool;
-        needAlphaTesting(): bool;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
 
         _preBind(): void;
         bind(world: Matrix, mesh: Mesh): void;
         unbind(): void;
+        baseDispose(): void;
 
         dispose(): void;
     }
-
-    class MultiMaterial extends Material {
-        constructor(name: string, scene: Scene);
-
-        getSubMaterial(index: number): Material;
-    }
-
-    class StandardMaterial extends Material {
-        diffuseTexture: Texture;
-        ambientTexture: Texture;
-        opacityTexture: Texture;
-        reflectionTexture: Texture;
-        emissiveTexture: Texture;
-        specularTexture: Texture;
-        ambientColor: Color3;
-        diffuseColor: Color3;
-        specularColor: Color3;
-        specularPower: number;
-        emissiveColor: Color3;
-
-        getRenderTargetTextures(): Texture[];
-        getAnimatables(): Texture[];
-    }
 }

+ 11 - 0
Typescript/Materials/babylon.multiMaterial.d.ts

@@ -0,0 +1,11 @@
+//// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class MultiMaterial extends Material {
+        subMaterials: Material[];
+
+        constructor(name: string, scene: Scene);
+
+        getSubMaterial(index: number): Material;
+    }
+}

+ 23 - 0
Typescript/Materials/babylon.standardMaterial.d.ts

@@ -0,0 +1,23 @@
+//// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class StandardMaterial extends Material {
+        diffuseTexture: Texture;
+        ambientTexture: Texture;
+        opacityTexture: Texture;
+        reflectionTexture: Texture;
+        emissiveTexture: Texture;
+        specularTexture: Texture;
+        bumpTexture: Texture;
+
+        ambientColor: Color3;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        emissiveColor: Color3;
+
+        getRenderTargetTextures(): Texture[];
+        getAnimatables(): Texture[];
+        clone(name: string): StandardMaterial;
+    }
+}

+ 23 - 0
Typescript/Materials/textures/babylon.baseTexture.d.ts

@@ -0,0 +1,23 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class BaseTexture {
+        _scene: Scene;
+
+        constructor(url: string, scene: Scene);
+
+        delayLoadState: number;
+        hasAlpha: boolean;
+        level: number;
+        onDispose: () => void;
+
+        getInternalTexture(): BaseTexture;
+        isReady(): boolean;
+        getSize(): Size2D;
+        getBaseSize(): Size2D;
+        _getFromCache(url: string, noMipmap: boolean): BaseTexture;
+        delayLoad(): void;
+        releaseInternalTexture(): void;
+        dispose(): void;
+    }
+}

+ 10 - 0
Typescript/Materials/textures/babylon.cubeTexture.d.ts

@@ -0,0 +1,10 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class CubeTexture extends BaseTexture {
+        constructor(rootUrl: string, scene: Scene);
+
+        isCube: boolean;
+        _computeReflectionTextureMatrix(): Matrix;
+    }
+}

+ 14 - 0
Typescript/Materials/textures/babylon.dynamicTexture.d.ts

@@ -0,0 +1,14 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class DynamicTexture extends Texture {
+        _canvas: HTMLCanvasElement;
+        _context: CanvasRenderingContext2D;
+
+        constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: boolean);
+
+        getContext(): CanvasRenderingContext2D;
+        drawText(text: string, x: number, y: number, font: string, color: string, clearColor: string, invertY: boolean): void;
+        update(): void;
+    }
+}

+ 12 - 0
Typescript/Materials/textures/babylon.mirrorTexture.d.ts

@@ -0,0 +1,12 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class MirrorTexture extends RenderTargetTexture {
+        constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: boolean);
+
+        mirrorPlane: Plane;
+
+        onBeforeRender(): void;
+        onAfterRender(): void;
+    }
+}

+ 18 - 0
Typescript/Materials/textures/babylon.renderTargetTexture.d.ts

@@ -0,0 +1,18 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+   class RenderTargetTexture extends Texture {
+       constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: boolean);
+
+       renderList: any[];
+       isRenderTarget: boolean;
+       coordinatesMode: number;
+       renderParticles: boolean;
+
+       _onBeforeRender: () => void;
+       _onAfterRender: () => void;
+
+       resize(size: Size2D, generateMipMaps: boolean): void;
+       render(): void;
+    }
+}

+ 12 - 57
Typescript/Materials/textures/babylon.texture.d.ts

@@ -1,32 +1,23 @@
 /// <reference path="../../babylon.d.ts" />
 
 declare module BABYLON {
-    class BaseTexture {
-        _scene: Scene;
-
-        constructor(url: string, scene: Scene);
-
-        hasAlpha: bool;
-        level: number;
-        onDispose: () => void;
-        getInternalTexture(): BaseTexture;
-        isReady(): bool;
-        getSize(): Size2D;
-        getBaseSize(): Size2D;
-        _getFromCache(url: string, noMipmap: bool): BaseTexture;
-        dispose(): void;
-    }
-
     class Texture extends BaseTexture {
         name: string;
+        url: string
+        animations: Animation[];
 
-        constructor(url: string, scene: Scene, noMipmap: bool, invertY: bool);
+        constructor(url: string, scene: Scene, noMipmap: boolean, invertY: boolean);
 
         static EXPLICIT_MODE: number;
         static SPHERICAL_MODE: number;
         static PLANAR_MODE: number;
         static CUBIC_MODE: number;
         static PROJECTION_MODE: number;
+        static SKYBOX_MODE: number;
+
+        static CLAMP_ADDRESSMODE: number;
+        static WRAP_ADDRESSMODE: number;
+        static MIRROR_ADDRESSMODE: number;
 
         uOffset: number;
         vOffset: number;
@@ -35,50 +26,14 @@ declare module BABYLON {
         uAng: number;
         vAng: number;
         wAng: number;
-        wrapU: bool;
-        wrapV: bool;
+        wrapU: number;
+        wrapV: number;
         coordinatesIndex: number;
         coordinatesMode: number;
 
         _prepareRowForTextureGeneration(t: Vector3): Vector3;
         _computeTextureMatrix(): Matrix;
-    }
-
-    class CubeTexture extends BaseTexture {
-        constructor(rootUrl: string, scene: Scene);
-    }
-
-    class DynamicTexture extends Texture {
-        wrapU: bool;
-        wrapV: bool;
-        _canvas: HTMLCanvasElement;
-        _context: CanvasRenderingContext2D;
-
-        constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: bool);
-
-        getContext(): CanvasRenderingContext2D;
-        update(): void;
-    }
-
-    class RenderTargetTexture extends Texture {
-        constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: bool);
-
-        renderList: any[];
-        isRenderTarget: bool;
-        coordinatesMode: number;
-
-        _onBeforeRender: () => void;
-        _onAfterRender: () => void;
-
-        render(): void;
-    }
-
-    class MirrorTexture extends RenderTargetTexture {
-        constructor(name: string, size: Size2D, scene: Scene, generateMipMaps: bool);
-
-        mirrorPlane: Plane;
-
-        _onBeforeRender: () => void;
-        _onAfterRender: () => void;
+        _computeReflectionTextureMatrix: Matrix;
+        clone(): Texture;
     }
 }

+ 13 - 0
Typescript/Materials/textures/babylon.videoTexture.d.ts

@@ -0,0 +1,13 @@
+/// <reference path="../../babylon.d.ts" />
+
+declare module BABYLON {
+    class VideoTexture extends Texture {
+        constructor(name: string, urls: string[], size: Size2D, scene: Scene, generateMipMaps: boolean);
+
+        video: HTMLVideoElement;
+        _autoLaunch: boolean;
+        textureSize: Size2D;
+
+        _update(): boolean;
+    }
+}

+ 50 - 44
Typescript/Mesh/babylon.mesh.d.ts

@@ -1,19 +1,16 @@
 /// <reference path="../babylon.d.ts" />
 
 declare module BABYLON {
-    interface MeshRayHitTest { hit: bool; distance: number };
+    interface MeshRayHitTest { hit: boolean; distance: number }
 
     class Mesh {
         name: string;
         id: string;
-        private _scene: Scene;
-        private _vertexDeclaration: number[];
-        private _vertexStrideSize: number;
-        private _totalVertices: number;
-        private _worldMatrix: Matrix;
+
         position: Vector3;
         rotation: Vector3;
         scaling: Vector3;
+        rotationQuaternion: Quaternion;
         subMeshes: SubMesh[];
         animations: Animation[];
 
@@ -25,69 +22,78 @@ declare module BABYLON {
         static BILLBOARDMODE_Z: number;
         static BILLBOARDMODE_ALL: number;
 
+        delayLoadState: boolean;
         material: Material;
         parent: Mesh;
-        _isEnabled: bool;
-        isVisible: bool;
+        _isReady: boolean;
+        _isEnabled: boolean;
+        isVisible: boolean;
+        isPickable: boolean;
         visibility: number;
         billboardMode: number;
-        checkCollisions: bool;
+        checkCollisions: boolean;
+        receiveShadows: boolean;
 
+        isDisposed: boolean;
         onDispose: () => void;
+        skeleton: Skeleton;
+        renderingGroupId: number;
 
+        getBoundingInfo(): BoundingInfo;
         getScene(): Scene;
         getWorldMatrix: Matrix;
         getTotalVertices: number;
-        getVertices: VertexBuffer;
-        getVertexStride(): number;
-        getFloatVertexStrideSize(): number;
-        _needToSynchronizeChildren(): bool;
-        isSynchronized(): bool;
-        isEnabled(): bool;
-        setEnabled(value: bool): void;
-        isAnimated(): bool;
+        getVerticesData(kind: string): any[];
+        isVerticesDataPresent(kind: string): boolean;
+        getTotalIndicies(): number;
+        getIndices(): number[];
+        getVertexStrideSize(): number;
+        _needToSynchronizeChildren(): boolean;
+        setPivotMatrix(matrix: Matrix): void;
+        getPivotMatrix(): Matrix;
+        isSynchronized(): boolean;
+        isReady(): boolean;
+        isEnabled(): boolean;
+        setEnabled(value: boolean): void;
+        isAnimated(): boolean;
+        markAsDirty(property: string): void;
+        refreshBoudningInfo(): void;
         computeWorldMatrix(): Matrix;
         _createGlobalSubMesh(): SubMesh;
-        setVertices(vertices: VertexBuffer, uvCount: number): void;
+        subdivide(count: number): void;
+        setVerticesData(data: any[], kind: string, updatable: boolean): void;
+        updateVerticesData(kind: string, data: any[]);
         setIndices(indices: number[]): void;
+        bindAndDraw(subMesh: SubMesh, effect: Effect, wireframe: boolean): void;
+        registerBeforeRender(func: Function): void;
+        unregisterBeforeRender(func: Function): void;
         render(subMesh: SubMesh): void;
-        isDescendantOf(ancestor: Mesh): bool;
+        isDescendantOf(ancestor: Mesh): boolean;
         getDescendants(): Mesh[];
         getEmittedParticleSystems(): ParticleSystem[];
         getHierarchyEmittedParticleSystems(): ParticleSystem[];
         getChildren(): Mesh[];
-        isInFrustrum(frustumPlanes: Plane[]): bool;
+        isInFrustrum(frustumPlanes: Plane[]): boolean;
         setMaterialByID(id: string);
         getAnimatables(): Material;
+        setLocalTranslation(vector3: Vector3): void;
+        getLocalTranslation(): Vector3;
+        bakeTransformIntoVertices(transform: Matrix): void;
 
-        intersectsMesh(mesh: Mesh, precise: bool): bool;
-        intersectsPoint(point: Vector3): bool;
+        intersectsMesh(mesh: Mesh, precise: boolean): boolean;
+        intersectsPoint(point: Vector3): boolean;
         intersects(ray: Ray): MeshRayHitTest;
         clone(name: string, newParent: Mesh): Mesh;
 
         dispose(): void;
 
-        static createBox(name: string, size: number, scene: Scene): Mesh;
-        static createSphere(name: string, segments: number, diameter: number, scene: Scene): Mesh;
-        static createPlane(name: string, size: number, scene: Scene): Mesh;
-    }
-
-    class SubMesh {
-        materialIndex: number;
-        verticesStart: number;
-        verticesCount: number;
-        indexStart: number;
-        indexCount: number;
-
-        constructor(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: number, indexCount: number, mesh: Mesh);
-
-        getMaterial(): Material;
-        updateBoundingInfo(world: Matrix, scale: Vector3): void;
-        isInFrustrum(frustumPlanes: Plane[]): bool;
-        render(): void;
-        getLinesIndexBuffer(indices: number[], engine: Engine): IndexBuffer;
-        canIntersects(ray: Ray): bool;
-        intersects(ray: Ray, positions: Vector3[], indices: number[]): MeshRayHitTest;
-        clone(newMesh: Mesh): SubMesh;
+        static CreateBox(name: string, size: number, scene: Scene): Mesh;
+        static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, scene: Scene, updatable: boolean): Mesh;
+        static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable: boolean): Mesh;
+        static CreateSphere(name: string, segments: number, diameter: number, scene: Scene): Mesh;
+        static CreatePlane(name: string, size: number, scene: Scene): Mesh;
+        static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable: boolean): Mesh;
+        static CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable: boolean): Mesh;
+        static ComputeNormal(positions: number[], normals: number[], indices: number[]);
     }
 }

+ 26 - 0
Typescript/Mesh/babylon.subMesh.d.ts

@@ -0,0 +1,26 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class SubMesh {
+        materialIndex: number;
+        verticesStart: number;
+        verticesCount: number;
+        indexStart: number;
+        indexCount: number;
+
+        constructor(materialIndex: number, verticesStart: number, verticesCount: number, indexStart: number, indexCount: number, mesh: Mesh);
+
+        getBoundingInfo(): BoundingInfo;
+        getMaterial(): Material;
+        refreshBoundingInfo(): void;
+        updateBoundingInfo(world: Matrix, scale: Vector3): void;
+        isInFrustrum(frustumPlanes: Plane[]): boolean;
+        render(): void;
+        getLinesIndexBuffer(indices: number[], engine: Engine): IndexBuffer;
+        canIntersects(ray: Ray): boolean;
+        intersects(ray: Ray, positions: Vector3[], indices: number[]): MeshRayHitTest;
+        clone(newMesh: Mesh): SubMesh;
+
+        static CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: Mesh): SubMesh;
+    }
+}

+ 21 - 0
Typescript/Mesh/babylon.vertexBuffer.d.ts

@@ -0,0 +1,21 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class VertexBuffer {
+        constructor(mesh: Mesh, data: any[], kind: string, updatable: boolean);
+
+        isUpdatable(): boolean;
+        getData(): any[];
+        getStrideSize(): number;
+        update(data: any[]): void;
+        dispose(): void;
+
+        PositionKind: string;
+        NormalKind: string;
+        UVKind: string;
+        UV2Kind: string;
+        ColorKind: string;
+        MatricesIndicesKind: string;
+        MatricesWeightsKind: string;
+    }
+}

+ 0 - 50
Typescript/Particles/babylon.particle.d.ts

@@ -15,54 +15,4 @@ declare module BABYLON {
         constructor();
 
     }
-
-    class ParticleSystem {
-        name: string;
-        id: string;
-        gravity: Vector3;
-        direction1: Vector3;
-        direction2: Vector3;
-        minEmitBox: Vector3;
-        maxEmitBox: Vector3;
-        color1: Color4;
-        color2: Color4;
-        colorDead: Color4;
-        deadAlpha: number;
-        textureMask: Color4;
-        particles: Particle[];
-
-        emitter: any; // needs update
-        emitRate: number;
-        manualEmitCount: number;
-        updateSpeed: number;
-        targetStopDuration: number;
-        disposeOnStop: bool;
-        minEmitPower: number;
-        maxEmitPower: number;
-        minLifeTime: number;
-        maxLifeTime: number;
-        minSize: number;
-        maxSize: number;
-        minAngularSpeed: number;
-        maxAngularSpeed: number;
-
-        particleTexture: Texture;
-
-        onDispose: () => void;
-
-        blendMode: number;
-
-        constructor(name: string, capacity: number, scene: Scene);
-
-        isAlive(): bool;
-        start(): void;
-        stop(): void;
-        animate(): void;
-        render(): number;
-        dispose(): void;
-        clone(name: string, newEmitter: any): ParticleSystem; // needs update (newEmitter)
-
-        static BLENDMODE_ONEONE: number;
-        static BLENDMODE_STANDARD: number;
-    }
 }

+ 60 - 0
Typescript/Particles/babylon.particleSystem.d.ts

@@ -0,0 +1,60 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class ParticleSystem {
+        name: string;
+        id: string;
+
+        gravity: Vector3;
+        direction1: Vector3;
+        direction2: Vector3;
+        minEmitBox: Vector3;
+        maxEmitBox: Vector3;
+        color1: Color4;
+        color2: Color4;
+        colorDead: Color4;
+        deadAlpha: number;
+        textureMask: Color4;
+
+        particles: Particle[];
+        indices: number[];
+
+        renderingGroupId: number;
+        emitter: any; // needs update
+        emitRate: number;
+        manualEmitCount: number;
+        updateSpeed: number;
+        targetStopDuration: number;
+        disposeOnStop: boolean;
+
+        minEmitPower: number;
+        maxEmitPower: number;
+
+        minLifeTime: number;
+        maxLifeTime: number;
+
+        minSize: number;
+        maxSize: number;
+        minAngularSpeed: number;
+        maxAngularSpeed: number;
+
+        particleTexture: Texture;
+
+        onDispose: () => void;
+
+        blendMode: number;
+
+        constructor(name: string, capacity: number, scene: Scene);
+
+        isAlive(): boolean;
+        start(): void;
+        stop(): void;
+        animate(): void;
+        render(): number;
+        dispose(): void;
+        clone(name: string, newEmitter: any): ParticleSystem; // needs update (newEmitter)
+
+        static BLENDMODE_ONEONE: number;
+        static BLENDMODE_STANDARD: number;
+    }
+}

+ 6 - 0
Typescript/PostProcess/babylon.postProcess.d.ts

@@ -0,0 +1,6 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class PostProcess {
+    }
+}

+ 8 - 0
Typescript/PostProcess/babylon.postProcessManager.d.ts

@@ -0,0 +1,8 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class PostProcessManager {
+        constructor();
+        postProcesses: any[];
+    }
+}

+ 4 - 14
Typescript/Sprites/Babylon.Sprite.d.ts

@@ -3,30 +3,20 @@
 declare module BABYLON {
     class Sprite {
         name: string;
+        color: Color4;
+
         position: Vector3;
         size: number;
         angle: number;
         cellIndex: number;
         invertU: number;
         invertV: number;
+        disposeWhenFinishedAnimating: boolean;
 
         constructor(name: string, manager: SpriteManager);
 
-        playAnimation(from: number, to: number, loop: bool, delay: number);
+        playAnimation(from: number, to: number, loop: boolean, delay: number);
         stopAnimation(): void;
-
-    }
-
-    class SpriteManager {
-        name: string;
-        cellSize: number;
-
-        constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon: number);
-
-        onDispose: () => void;
-
-        render(): void;
         dispose(): void;
-
     }
 }

+ 20 - 0
Typescript/Sprites/Babylon.spriteManager.d.ts

@@ -0,0 +1,20 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class SpriteManager {
+        name: string;
+        cellSize: number;
+
+        constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon: number);
+
+        indicies: number[];
+        index: number;
+        sprites: Sprite[];
+
+        onDispose: () => void;
+
+        render(): void;
+        dispose(): void;
+
+    }
+}

+ 31 - 0
Typescript/Tools/babylon.database.d.ts

@@ -0,0 +1,31 @@
+/// <reference path="../babylon.d.ts" />
+
+declare module BABYLON {
+    class Database {
+        currentSceneUrl: string;
+        db: Database;
+        enableSceneOffline: boolean;
+        enableTexturesOffline: boolean;
+        manifestVersionFound: number;
+        mustUpdateRessources: boolean;
+        hasReachedQuota: boolean;
+
+        constructor(urlToScene: string);
+
+        isUASupportingBlobStorage: boolean;
+
+        parseURL(url: string): string;
+        ReturnFullUrlLocation(url: string): string;
+        checkManifestFile(): void;
+        openAsync(successCallback: Function, errorCallback: Function): void;
+        loadImageFromDB(url: string, image: HTMLImageElement): void;
+        _loadImageFromDBAsync(url: string, image: HTMLImageElement, notInDBCallback: Function);
+        _saveImageIntoDBAsync(url: string, image: HTMLImageElement): void;
+        _checkVersionFromDB(url: string, versionLoaded: number): void;
+        _loadVersionFromDBAsync(url: string, callback, updateInDBCallback: Function): void;
+        _saveVersionIntoDBAsync(url: string, callback: Function): void;
+        loadSceneFromDB(url: string, sceneLoaded: Scene, progressCallBack: Function): void;
+        _loadSceneFromDBAsync(url: string, callback: Function, notInDBCallback: Function): void;
+        _saveSceneFromDBAsync(url: string, callback: Function, progressCallback: Function): void;
+    }
+}

+ 92 - 16
Typescript/Tools/babylon.math.d.ts

@@ -2,7 +2,7 @@
 
 declare module BABYLON {
     interface RayTriangleIntersection {
-        hit: bool;
+        hit: boolean;
         distance: number;
         bu: number;
         bv: number;
@@ -31,7 +31,8 @@ declare module BABYLON {
 
         constructor(origin: Vector3, direction: Vector3);
 
-        intersectsSphere(sphere: Sphere): bool;
+        intersectsBox(box: BoundingBox): boolean;
+        intersectsSphere(sphere: Sphere): boolean;
         intersectsTriangle(vertex0: Vector3,
             vertex1: Vector3,
             vertex2: Vector3): RayTriangleIntersection;
@@ -53,15 +54,19 @@ declare module BABYLON {
 
         constructor(intialR: number, initialG: number, initialB: number);
 
-        equals(otherColor: Color3): bool;
-        equals(otherColor: Color4): bool;
+        equals(otherColor: Color3): boolean;
+        equals(otherColor: Color4): boolean;
         toString(): string;
         clone(): Color3;
 
         multiply(otherColor: Color3): Color3;
+        mutilplyToRef(otherColor: Color3, result: Color3): void;
         scale(scale: number): Color3;
+        scaleToRef(scale: number, result: Color3): void;
+        copyFrom(source: Color3): void;
+        copyFromFloats(r: number, g: number, b: number): void;
         
-        static FromArray(number[]): Color3;
+        static FromArray(array: number[]): Color3;
     }
 
     class Color4 implements IColor3 {
@@ -72,15 +77,18 @@ declare module BABYLON {
 
         constructor(initialR: number, initialG: number, initialB: number, initialA: number);
 
+        addInPlace(right: Color4): void;
         add(right: Color4): Color4;
         subtract(right: Color4): Color4;
+        subtractToRef(right: Color4, result: Color4): void;
         scale(factor: number): Color4;
+        scale(factor: number, result: Color4): void;
 
         toString(): string;
         clone(): Color4;
 
         static Lerp(left: number, right: number, amount: number): Color4;
-        static FromArray(number[]): Color4;
+        static FromArray(array: number[]): Color4;
 
     }
 
@@ -95,8 +103,9 @@ declare module BABYLON {
         add(other: Vector2): Vector2;
         subtract(other: Vector2): Vector2;
         negate(): Vector2;
-        scale(factor: number): Vector2;
-        equals(other: Vector2): bool;
+        scaleInPlace(scale: number): void;
+        scale(scale: number): Vector2;
+        equals(other: Vector2): boolean;
         length(): number;
         lengthSquared(): number;
         normalize();
@@ -125,30 +134,54 @@ declare module BABYLON {
 
         toString(): string;
 
+        addInPlace(otherVector: Vector3): void;
         add(other: Vector3): Vector3;
+        addToRef(otherVector: Vector3, result: Vector3): void;
+        suntractInPlace(otherVector: Vector3): void;
         subtract(other: Vector3): Vector3;
+        subtractToRef(otherVector: Vector3, result: Vector3): void;
+        subtractFromFloatsTo(x: number, y: number, z: number): Vector3;
+        subtractFromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
         negate(): Vector3;
-        scale(factor: number): Vector3;
-        equals(other: Vector3): bool;
+        scaleInPlace(scale: number): void;
+        scale(scale: number): Vector3;
+        scaleToRef(scale: number, result: Vector3): void;
+        equals(other: Vector3): boolean;
+        equalsToFloats(x: number, y: number, z: number): boolean;
+        multiplyInPlace(other: Vector3): void;
         multiply(other: Vector3): Vector3;
+        multiplyToRef(otherVector: Vector3, result: Vector3): void
+        multiplyByFloats(x: number, y: number, z: number): Vector3;
         divide(other: Vector3): Vector3;
+        divideToRef(otherVector: Vector3, result: Vector3): void; 
         length(): number;
         lengthSquared(): number;
         normalize();
         clone(): Vector3;
+        copyFrom(source: Vector3): void;
+        copyFromFloats(x: number, y: number, z: number): void;
 
-        static FromArray(array: number[], offset?: number = 0);
+        static FromArray(array: number[], offset: number);
+        static FromArrayToRef(array: number[], offset: number, result: Vector3): void;
+        static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
         static Zero(): Vector3;
         static Up(): Vector3;
-        static TransformCoordinates(vector: Vector3, transformation: Matrix);
-        static TransformNormal(vector: Vector3, transformation: Matrix);
+        static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3;
+        static TransformCoordinatesToRef(vector: Vector3, transformation: Matrix, result: Vector3): void;
+        static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
+        static TransformNormal(vector: Vector3, transformation: Matrix): Vector3;
+        static TransformNormalToRef(vector: Vector3, transformation: Matrix, result: Vector3): void;
+        static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
 
         static CatmullRom(value1: Vector3, value2: Vector3, value3: Vector3, value4: Vector3, amount: number): Vector3;
         static Clamp(value: Vector3, min: Vector3, max: Vector3): Vector3;
         static Hermite(value1: Vector3, tangent1: Vector3, value2: Vector3, tangent2: Vector3, amount: number): Vector3;
         static Lerp(start: Vector3, end: Vector3, amount: number): Vector3;
         static Dot(left: Vector3, right: Vector3): number;
+        static Cross(left: Vector3, right: Vector3): Vector3;
+        static CrossToRef(left: Vector3, right: Vector3, result: Vector3): void;
         static Normalize(vector: Vector3): Vector3;
+        static NormalizeToRef(vector: Vector3, result: Vector3): void;
         static Unproject(source: Vector3,
             viewportWidth: number,
             viewportHeight: number,
@@ -168,14 +201,25 @@ declare module BABYLON {
         z: number;
         w: number;
 
+        toString(): string;
+
         constructor(x: number, y: number, z: number, w: number);
 
+        equals(otherQuaternion: Quaternion): boolean;
         clone(): Quaternion;
+        copyFrom(other: Quaternion): void;
         add(other: Quaternion): Quaternion;
         scale(factor: number): Quaternion;
+        multiply(q1: Quaternion): Quaternion;
+        multiplyToRef(q1: Quaternion, result: Quaternion): void;
+        length(): number;
+        normalize(): void;
         toEulerAngles(): Vector3;
+        toRotationMatrix(result: Quaternion): void;
 
-        static FromArray(array: number[], offset?: number = 0): Quaternion;
+        static FromArray(array: number[], offset: number): Quaternion;
+        static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
+        static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void;
         static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion;
     }
 
@@ -184,51 +228,83 @@ declare module BABYLON {
 
         constructor();
 
-        isIdentity(): bool;
+        isIdentity(): boolean;
         determinant(): number;
         toArray(): number[];
         invert(): void;
+        invertToRef(other: Matrix): void;
+        setTranslations(vector3: Vector3): void;
         multiply(other: Matrix): Matrix;
-        equals(other: Matrix): Matrix;
+        copyFrom(other: Matrix): void;
+        multiplyToRef(other: Matrix, result: Matrix): void;
+        multiplyToArray(other: Matrix, result: number[], offset: number): void;
+        equals(other: Matrix): boolean;
         clone(): Matrix;
 
+        static FromArray(array: number[], offset: number): Matrix;
+        static FromArrayToRef(array: number[], offset: number, result: Matrix): void;
         static FromValues(m11: number, m12: number, m13: number, m14: number,
             m21: number, m22: number, m23: number, m24: number,
             m31: number, m32: number, m33: number, m34: number,
             m41: number, m42: number, m43: number, m44: number): Matrix;
+        static FromValuesToRef(m11: number, m12: number, m13: number, m14: number,
+            m21: number, m22: number, m23: number, m24: number,
+            m31: number, m32: number, m33: number, m34: number,
+            m41: number, m42: number, m43: number, m44: number, result: Matrix): void;
         static Identity(): Matrix;
+        static IdentityToRef(result: Matrix): void;
         static Zero(): Matrix;
         static RotationX(angle: number): Matrix;
+        static RotationXToRef(angle: number, result: Matrix): void;
         static RotationY(angle: number): Matrix;
+        static RotationYToRef(angle: number, result: Matrix): void;
         static RotationZ(angle: number): Matrix;
+        static RotationZToRef(angle: number, result: Matrix): void;
         static RotationAxis(axis: Vector3, angle: number): Matrix;
         static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix;
         static Scaling(scaleX: number, scaleY: number, scaleZ: number): Matrix;
+        static ScalingToRef(scaleX: number, scaleY: number, scaleZ: number, result: Matrix): void;
         static Translation(x: number, y: number, z: number): Matrix;
+        static TranslationToRef(x: number, y: number, z: number, result: Matrix): void;
         static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix;
+        static LookAtLHToRef(eye: Vector3, target: Vector3, up: Vector3, result: Matrix): void;
         static OrthoLH(width: number, height: number, znear: number, zfar: number): Matrix;
         static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): Matrix;
+        static OrthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix): void;
         static PerspectiveLH(width: number, height: number, znear: number, zfar: number): Matrix;
         static PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): Matrix;
+        static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix): void;
         static AffineTransformation(scaling: number, rotationCenter: Vector3, rotation: Quaternion, translation: Vector3): Matrix;
         static GetFinalMatrix(viewport: Size2D, world: Matrix, view: Matrix, projection: Matrix): Matrix;
         static Transpose(matrix: Matrix): Matrix;
         static Reflection(plane: Plane): Matrix;
+        static ReflectionToRef(plane: Plane, result: Matrix): void;
     }
 
     class Plane {
         normal: Vector3;
         d: number;
 
+        constructor(a: number, b: number, c: number, d: number);
+
         normalize(): void;
         transform(transformation: Matrix): Plane;
         dotCoordinate(point: Vector3): number;
+        copyFromPoints(point1: Vector3, point2: Vector3, point3: Vector3): void;
+        isFrontFacingTo(direction: Vector3, epsilon: Vector3): boolean;
+        signedDistanceTo(point: Vector3): number;
 
         static FromArray(array: number[]): Plane;
         static FromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane;
+        static FromPositionAndNormal(origin: Vector3, normal: Vector2): Plane;
+        static SignedDistanceToPlaneFromPositionAndNormal(origin: Vector3, normal: Vector3, point): number;
     }
 
     class Frustum {
+        frustrumPlanes: Plane[];
+
+        constructor(transform: Matrix);
+
         static GetPlanes(transform: Matrix): Plane[];
     }
 }

+ 19 - 3
Typescript/Tools/babylon.sceneLoader.d.ts

@@ -1,5 +1,21 @@
 /// <reference path="../babylon.d.ts" />
-declare module BABYLON.SceneLoader {
-    function ImportMesh(meshName: string, rootUrl: string, sceneFilename: string, scene: Scene, then: Function);
-    function Load(rootUrl: string, sceneFilename: string, engine: Engine, then: Function, progressCallback: Function);
+declare module BABYLON {
+    function loadCubeTexture(rootUrl: string, parsedTexture: JSON, scene: Scene): CubeTexture;
+    function loadTexture(rootUrl: string, parsedTexture: JSON, scene: Scene): Texture;
+    function parseSkeleton(parsedSkeleton: JSON, scene: Scene): Skeleton;
+    function parseMaterial(parsedMaterial: JSON, scene: Scene, rootUrl: string): Material;
+    function parseMaterialById(id: number, parsedData: JSON, scene: Scene, rootUrl: string): Material;
+    function parseMultiMaterial(parsedMultiMaterial: JSON, scene: Scene): MultiMaterial;
+    function parseParticleSystem(parsedParticleSystem: JSON, scene: Scene, rootUrl: string): ParticleSystem;
+    function parseShadowGenerator(parsedShadowGenerator: JSON, scene: Scene): ShadowGenerator;
+    function parseAnimation(parsedAnimation: JSON): Animation;
+    function parseLight(parsedLight: JSON, scene: Scene): Light;
+    function parseMesh(parsedMesh: JSON, scene: Scene, rootUrl: string): Mesh;
+    function isDescendantOf(mesh: Mesh, name: string, hierarchyIds: number[]): boolean;
+
+    class SceneLoader {
+        _ImportGeometry(parsedGeometry, mesh): void;
+        ImportMesh(meshName: string, rootUrl: string, sceneFilename: string, scene: Scene, then: Function): void;
+        Load(rootUrl: string, sceneFilename: string, engine: Engine, then: Function, progressCallback: Function): void;
+    }
 }

+ 21 - 0
Typescript/Tools/babylon.tools.d.ts

@@ -1,14 +1,35 @@
 /// <reference path="../babylon.d.ts" />
 
 declare module BABYLON.Tools {
+    function ExtractMinAndMax(positions: number[], start: number, count: number): Object;
+    function GetPointerPrefix(): string;
     function QueueNewFrame(func: Function): void;
     function RequestFullscreen(element: HTMLElement): void;
     function ExitFullscreen(): void;
     var BaseUrl: string;
+    function LoadImage(url: string, onload: Function, onerror: Function, database: Database): HTMLImageElement;
     function LoadFile(url: string, callback: Function, progressCallback: Function): void;
+    function isIE(): boolean;
     function WithinEpsilon(a: number, b: number);
+    function cloneValue(source: Object, destinationObject: Object): void;
     function DeepCopy(source: Object, destination: Object, doNotCopyList: string[], mustCopyList: string[]);
+    var fpsRange: number;
+    var previousFramesDuration: number[];
     function GetFps(): number;
     function GetDeltaTime(): number;
     function _MeasureFps(): void;
+
+    class SmartArray {
+        data: Array;
+        length: number;
+
+        constructor(capacity: number);
+
+        push(value: Object): void;
+        pushNoDuplicate(value: Object): void;
+        reset(): void;
+        concat(array: SmartArray): void;
+        concatWithNoDuplicate(array: SmartArray): void;
+        indexOf(value: Object): number;
+    }
 }

+ 34 - 3
Typescript/babylon.d.ts

@@ -3,16 +3,47 @@
 /// <reference path="tools/babylon.math.d.ts" />
 /// <reference path="tools/babylon.sceneLoader.d.ts" />
 /// <reference path="tools/babylon.tools.d.ts" />
-/// <reference path="tools/babylon.tools.dds.d.ts" />
+/// <reference path="tools/babylon.database.d.ts" />
 /// <reference path="sprites/babylon.sprite.d.ts" />
+/// <reference path="sprites/babylon.spriteManager.d.ts" />
+/// <reference path="postprocess/babylon.postProcess.d.ts" />
+/// <reference path="PostProcess/babylon.postProcessManager.d.ts" />
 /// <reference path="particles/babylon.particle.d.ts" />
+/// <reference path="particles/babylon.particleSystem.d.ts" />
 /// <reference path="mesh/babylon.mesh.d.ts" />
+/// <reference path="mesh/babylon.subMesh.d.ts" />
+/// <reference path="mesh/babylon.vertexBuffer.d.ts" />
 /// <reference path="materials/babylon.effect.d.ts" />
 /// <reference path="materials/babylon.material.d.ts" />
+/// <reference path="materials/babylon.multiMaterial.d.ts" />
+/// <reference path="materials/babylon.standardMaterial.d.ts" />
+/// <reference path="materials/textures/babylon.baseTexture.d.ts" />
 /// <reference path="materials/textures/babylon.texture.d.ts" />
-/// <reference path="mesh/babylon.mesh.d.ts" />
+/// <reference path="materials/textures/babylon.cubeTexture.d.ts" />
+/// <reference path="materials/textures/babylon.renderTargetTexture.d.ts" />
+/// <reference path="materials/textures/babylon.dynamicTexture.d.ts" />
+/// <reference path="materials/textures/babylon.mirrorTexture.d.ts" />
+/// <reference path="materials/textures/babylon.videoTexture.d.ts" />
 /// <reference path="lights/babylon.light.d.ts" />
+/// <reference path="lights/babylon.pointLight.d.ts" />
+/// <reference path="lights/babylon.spotLight.d.ts" />
+/// <reference path="lights/babylon.directionalLight.d.ts" />
+/// <reference path="lights/babylon.hemisphericLight.d.ts" />
+/// <reference path="lights/shadows/babylon.shadowGenerator.d.ts" />
 /// <reference path="layer/babylon.layer.d.ts" />
+/// <reference path="culling/babylon.bounding.d.ts" />
+/// <reference path="culling/babylon.boundingInfo.d.ts" />
+/// <reference path="culling/babylon.boundingSphere.d.ts" />
+/// <reference path="culling/octrees/babylon.octree.d.ts" />
+/// <reference path="culling/octrees/babylon.octreeBlock.d.ts" />
 /// <reference path="collisions/babylon.collider.d.ts" />
+/// <reference path="collisions/babylon.collisionPlane.d.ts" />
 /// <reference path="cameras/babylon.camera.d.ts" />
-/// <reference path="animations/babylon.animation.d.ts" />
+/// <reference path="cameras/babylon.freeCamera.d.ts" />
+/// <reference path="cameras/babylon.arcRotateCamera.d.ts" />
+/// <reference path="cameras/babylon.deviceOrientationCamera.d.ts" />
+/// <reference path="cameras/babylon.touchCamera.d.ts" />
+/// <reference path="bones/babylon.bone.d.ts" />
+/// <reference path="bones/babylon.skeleton.d.ts" />
+/// <reference path="animations/babylon.animation.d.ts" />
+/// <reference path="animations/babylon.animatable.d.ts" />

+ 37 - 15
Typescript/babylon.engine.d.ts

@@ -35,6 +35,11 @@ declare module BABYLON {
     class Engine {
         constructor(canvas: HTMLCanvasElement, antialias: boolean);
 
+        forceWireframe: boolean;
+        cullBackFaces: boolean;
+        scenes: Scene[];
+        isPointerLock: boolean;
+
         getAspectRatio(): number; 
         getRenderWidth(): number;
         getRenderHeight(): number;
@@ -43,8 +48,11 @@ declare module BABYLON {
         getLoadedTexturesCache(): Texture[]; 
         getCaps(): Capabilities;
 
+        stopRenderLoop(): void;
+        runRenderLoop(renderFunction: Function): void;
+
         switchFullscreen(element: HTMLElement);
-        clear(color: IColor3, backBuffer: bool, depthStencil: bool);
+        clear(color: IColor3, backBuffer: boolean, depthStencil: boolean);
 
         beginFrame(): void;
         endFrame(): void;
@@ -63,8 +71,9 @@ declare module BABYLON {
         updateDynamicVertexBuffer(vertexBuffer: VertexBuffer, vertices: ArrayBufferView): void; 
         createIndexBuffer(indices, is32Bits): IndexBuffer;
         bindBuffers(vb: VertexBuffer, ib: IndexBuffer, vdecl: number[], strideSize: number, effect: Effect);
+        bindMultiBuffers(vertexBuffers: VertexBuffer[], indexBuffer: IndexBuffer, effect: Effect): void;
         _releaseBuffer(vb: VertexBuffer);
-        draw(useTriangles: bool, indexStart: number, indexCount: number);
+        draw(useTriangles: boolean, indexStart: number, indexCount: number);
         createEffect(baseName: string, attributesNames: string, uniformsNames: string[],
             samplers: WebGLUniformLocation[],
             defines: string): Effect; 
@@ -72,37 +81,50 @@ declare module BABYLON {
         getUniforms(shaderProgram: WebGLProgram, uniformsNames: string[]): WebGLUniformLocation[];
         getAttributes(shaderProgram: WebGLProgram, attributesNames: string[]): number[]; 
         enableEffect(effect: Effect): void;
+        setMatrices(uniform: string, matrices: Matrix[]): void;
         setMatrix(uniform: string, matrix: Matrix): void; 
         setVector2(uniform: string, x: number, y: number): void;  
         setVector3(uniform: string, v: Vector3): void; 
-        setBool(uniform: string, val: bool): void;
-        setVector4(uniform: string, x: number, y: number, z: number, w: number): void;
+        setFloat2(uniform: string, x: number, y: number): void;
+        setFloat3(uniform: string, x: number, y: number, z: number): void;
+        setBool(uniform: string, val: boolean): void;
+        setFloat4(uniform: string, x: number, y: number, z: number, w: number): void;
         setColor3(uniform: string, color: Color3): void; 
         setColor4(uniform: string, color: Color3, alpha: number): void; 
         setState(cullingMode: number): void;
-        setDepthBuffer(enable: bool): void;
-        setDepthWrite(enable: bool): void;
-        setColorWrite(enable: bool): void;
+        setDepthBuffer(enable: boolean): void;
+        setDepthWrite(enable: boolean): void;
+        setColorWrite(enable: boolean): void;
         setAlphaMode(mode: number): void;
-        setAlphaTesting(enable: bool): void;
-        getAlphaTesting(): bool;
+        setAlphaTesting(enable: boolean): void;
+        getAlphaTesting(): boolean;
         wipeCaches(): void;
-        createTexture(url: string, noMipmap: bool, invertY: bool): Texture;
-        createDynamicTexture(size: number, noMipmap: bool): Texture;
-        updateDynamicTexture(texture: Texture, canvas: HTMLCanvasElement): void;
-        createRenderTargetTexture(size: number, generateMipMaps: bool): Texture;
-        createCubeTexture(rootUrl: string): Texture;
+        getExponantOfTwo(value: number, max: number): number;
+        createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene): Texture;
+        createDynamicTexture(size: number, noMipmap: boolean): Texture;
+        updateDynamicTexture(texture: Texture, canvas: HTMLCanvasElement, invertY: boolean): void;
+        updateVideoTexture(texture: Texture, video: HTMLVideoElement): void;
+        createRenderTargetTexture(size: number, generateMipMaps: boolean): Texture;
+        createCubeTexture(rootUrl: string, scene: Scene): Texture;
         _releaseTexture(tex: Texture): void;
         bindSamplers(effect: Effect): void;
         setTexture(channel: number, texture: Texture): void; 
         dispose(): void;
 
         static ShadersRepository: string;
+
         static ALPHA_DISABLE: number;
         static ALPHA_ADD: number;
         static ALPHA_COMBINE: number;
+
+        static DELAYLOADSTATE_NONE: number;
+        static DELAYLOADSTATE_LOADED: number;
+        static DELAYLOADSTATE_LOADING: number;
+        static DELAYLOADSTATE_NOTLOADED: number;
+
         static epsilon: number;
         static collisionEpsilon: number;
-        static isSupported(): bool;
+
+        static isSupported(): boolean;
     }
 }

文件差异内容过多而无法显示
+ 719 - 217
Typescript/babylon.min.d.ts


+ 51 - 4
Typescript/babylon.scene.d.ts

@@ -2,14 +2,42 @@
 
 declare module BABYLON {
     interface ScenePickResult {
-        hit: bool;
+        hit: boolean;
         distance: number;
         pickedMesh: Mesh;
         pickedPoint: Vector3;
     }
+
     class Scene {
         constructor(engine: Engine);
 
+        autoClear: boolean;
+        clearColor: Color3;
+        ambientColor: Color3;
+
+        fogMode: number;
+        fogColor: Color3;
+        fogDensity: number;
+        fogStart: number;
+        fogEnd: number;
+
+        lights: Light[];
+        cameras: Camera[];
+        activeCamera: Camera;
+        meshes: Mesh[];
+        materials: Material[];
+        multiMaterials: MultiMaterial[];
+        defaultMaterial: StandardMaterial;
+        textures: Texture[];
+        particlesEnabled: boolean;
+        particleSystems: ParticleSystem[];
+        spriteManagers: SpriteManager[];
+        layers: Layer[];
+        skeletons: Skeleton[];
+        collisionsEnabled: boolean;
+        gravity: Vector3;
+        postProcessManager: PostProcessManager;
+
         getEngine(): Engine;
         getTotalVertices(): number;
         getActiveVertices(): number;
@@ -21,27 +49,46 @@ declare module BABYLON {
         getParticlesDuration(): number;
         getSpritesDuration(): number;
         getAnimationRatio(): number;
+        getRenderId: number;
 
-        isReady(): bool;
+        isReady(): boolean;
+        registerBeforeRender(func: Function): void;
+        unregisterBeforeRender(func: Function): void;
         executeWhenReady(func: Function): void;
-        // TODO: Animations
+        getWaitingItemsCount(): number;
+
+        beginAnimation(target: string, from: number, to: number, loop: boolean, speedRatio: number, onAnimationEnd: Function): void;
+        stopAnimation(target: string);
+
         getViewMatrix(): Matrix;
         getProjectionMatrix(): Matrix;
         getTransformMatrix(): Matrix;
         setTransformMatrix(view: Matrix, projection: Matrix);
         activeCameraByID(id: number): void;
         getMaterialByID(id: number): Material;
+        getLightByID(id: number): Light;
         getMeshByID(id: number): Mesh;
         getLastMeshByID(id: number): Mesh;
         getMeshByName(name: string): Mesh;
-        isActiveMesh(mesh: Mesh): bool;
+        isActiveMesh(mesh: Mesh): boolean;
+        getLastSkeletonByID(id: number): Skeleton;
+        getSkeletonByID(id: number): Skeleton;
+        getSkeletonByName(name: string): Skeleton;
+
         _evaluateActiveMeshes(): void;
         _localRender(opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes, activeMeshes);
         render();
         dispose();
         _getNewPosition(position: Vector3, velocity: Vector3, collider: Sphere, maximumRetries: number): Vector3;
         _collideWithWorld(position: Vector3, velocity: Vector3, collider: Sphere, maximumRetries: number): Vector3;
+
+        createOrUpdateSelectionOctree(): void;
         createPickingRay(x: number, y: number, world: Matrix): Ray;
         pick(x: number, y: number): ScenePickResult;
+
+        static FOGMODE_NONE: number;
+        static FOGMODE_EXP: number;
+        static FOGMODE_EXP2: number;
+        static FOGMODE_LINEAR: number;
     }
 }