|
@@ -247,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;
|
|
@@ -767,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;
|
|
|
/**
|
|
@@ -1905,66 +1908,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class BoundingBox {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- vectors: Vector3[];
|
|
|
- center: Vector3;
|
|
|
- extendSize: Vector3;
|
|
|
- directions: Vector3[];
|
|
|
- vectorsWorld: Vector3[];
|
|
|
- minimumWorld: Vector3;
|
|
|
- maximumWorld: Vector3;
|
|
|
- private _worldMatrix;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- getWorldMatrix(): Matrix;
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
- intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
- static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
- static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
- static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
- static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class BoundingInfo {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- boundingBox: BoundingBox;
|
|
|
- boundingSphere: BoundingSphere;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- _checkCollision(collider: Collider): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class BoundingSphere {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- center: Vector3;
|
|
|
- radius: number;
|
|
|
- centerWorld: Vector3;
|
|
|
- radiusWorld: number;
|
|
|
- private _tempRadiusVector;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class Collider {
|
|
|
radius: Vector3;
|
|
|
retry: number;
|
|
@@ -2203,21 +2146,62 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Layer {
|
|
|
- name: string;
|
|
|
- texture: Texture;
|
|
|
- isBackground: boolean;
|
|
|
- color: Color4;
|
|
|
- onDispose: () => void;
|
|
|
- private _scene;
|
|
|
- private _vertexDeclaration;
|
|
|
- private _vertexStrideSize;
|
|
|
- private _vertexBuffer;
|
|
|
- private _indexBuffer;
|
|
|
- private _effect;
|
|
|
- constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4);
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
+ class BoundingBox {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ vectors: Vector3[];
|
|
|
+ center: Vector3;
|
|
|
+ extendSize: Vector3;
|
|
|
+ directions: Vector3[];
|
|
|
+ vectorsWorld: Vector3[];
|
|
|
+ minimumWorld: Vector3;
|
|
|
+ maximumWorld: Vector3;
|
|
|
+ private _worldMatrix;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ getWorldMatrix(): Matrix;
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
+ intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
+ static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
+ static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
+ static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingInfo {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ boundingBox: BoundingBox;
|
|
|
+ boundingSphere: BoundingSphere;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ _checkCollision(collider: Collider): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingSphere {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ center: Vector3;
|
|
|
+ radius: number;
|
|
|
+ centerWorld: Vector3;
|
|
|
+ radiusWorld: number;
|
|
|
+ private _tempRadiusVector;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2309,6 +2293,7 @@ declare module BABYLON {
|
|
|
isEnabled: boolean;
|
|
|
getScene(): Scene;
|
|
|
getEmitter(): any;
|
|
|
+ setEmitter(newEmitter: any): void;
|
|
|
getEmitterPosition(): Vector3;
|
|
|
computeEffectivePosition(globalViewport: Viewport): boolean;
|
|
|
_isVisible(): boolean;
|
|
@@ -2318,34 +2303,21 @@ 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;
|
|
|
+ class Layer {
|
|
|
+ name: string;
|
|
|
+ texture: Texture;
|
|
|
+ isBackground: boolean;
|
|
|
+ color: Color4;
|
|
|
+ onDispose: () => void;
|
|
|
+ private _scene;
|
|
|
+ private _vertexDeclaration;
|
|
|
+ private _vertexStrideSize;
|
|
|
+ private _vertexBuffer;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _effect;
|
|
|
+ constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4);
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2454,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;
|
|
@@ -2505,6 +2509,8 @@ 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;
|
|
@@ -2591,6 +2597,8 @@ declare module BABYLON {
|
|
|
private _vectors3;
|
|
|
private _vectors4;
|
|
|
private _matrices;
|
|
|
+ private _matrices3x3;
|
|
|
+ private _matrices2x2;
|
|
|
private _cachedWorldViewMatrix;
|
|
|
private _renderId;
|
|
|
constructor(name: string, scene: Scene, shaderPath: any, options: any);
|
|
@@ -2606,6 +2614,8 @@ declare module BABYLON {
|
|
|
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;
|
|
@@ -2698,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;
|
|
@@ -2728,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;
|
|
@@ -3001,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;
|
|
@@ -3176,149 +3192,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Particle {
|
|
|
- position: Vector3;
|
|
|
- direction: Vector3;
|
|
|
- color: Color4;
|
|
|
- colorStep: Color4;
|
|
|
- lifeTime: number;
|
|
|
- age: number;
|
|
|
- size: number;
|
|
|
- angle: number;
|
|
|
- angularSpeed: number;
|
|
|
- copyTo(other: Particle): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ParticleSystem implements IDisposable {
|
|
|
- name: string;
|
|
|
- static BLENDMODE_ONEONE: number;
|
|
|
- static BLENDMODE_STANDARD: number;
|
|
|
- id: string;
|
|
|
- renderingGroupId: number;
|
|
|
- emitter: any;
|
|
|
- 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;
|
|
|
- updateFunction: (particles: Particle[]) => void;
|
|
|
- blendMode: number;
|
|
|
- forceDepthWrite: boolean;
|
|
|
- gravity: Vector3;
|
|
|
- direction1: Vector3;
|
|
|
- direction2: Vector3;
|
|
|
- minEmitBox: Vector3;
|
|
|
- maxEmitBox: Vector3;
|
|
|
- color1: Color4;
|
|
|
- color2: Color4;
|
|
|
- colorDead: Color4;
|
|
|
- textureMask: Color4;
|
|
|
- startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3) => void;
|
|
|
- startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3) => void;
|
|
|
- private particles;
|
|
|
- private _capacity;
|
|
|
- private _scene;
|
|
|
- private _vertexDeclaration;
|
|
|
- private _vertexStrideSize;
|
|
|
- private _stockParticles;
|
|
|
- private _newPartsExcess;
|
|
|
- private _vertexBuffer;
|
|
|
- private _indexBuffer;
|
|
|
- private _vertices;
|
|
|
- private _effect;
|
|
|
- private _customEffect;
|
|
|
- private _cachedDefines;
|
|
|
- private _scaledColorStep;
|
|
|
- private _colorDiff;
|
|
|
- private _scaledDirection;
|
|
|
- private _scaledGravity;
|
|
|
- private _currentRenderId;
|
|
|
- private _alive;
|
|
|
- private _started;
|
|
|
- private _stopped;
|
|
|
- private _actualFrame;
|
|
|
- private _scaledUpdateSpeed;
|
|
|
- constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect);
|
|
|
- recycleParticle(particle: Particle): void;
|
|
|
- getCapacity(): number;
|
|
|
- isAlive(): boolean;
|
|
|
- isStarted(): boolean;
|
|
|
- start(): void;
|
|
|
- stop(): void;
|
|
|
- _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
|
|
|
- private _update(newParticles);
|
|
|
- private _getEffect();
|
|
|
- animate(): void;
|
|
|
- render(): number;
|
|
|
- dispose(): void;
|
|
|
- clone(name: string, newEmitter: any): ParticleSystem;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- interface IPhysicsEnginePlugin {
|
|
|
- initialize(iterations?: number): any;
|
|
|
- setGravity(gravity: Vector3): void;
|
|
|
- runOneStep(delta: number): void;
|
|
|
- registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
- registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- unregisterMesh(mesh: AbstractMesh): any;
|
|
|
- applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
- }
|
|
|
- interface PhysicsBodyCreationOptions {
|
|
|
- mass: number;
|
|
|
- friction: number;
|
|
|
- restitution: number;
|
|
|
- }
|
|
|
- interface PhysicsCompoundBodyPart {
|
|
|
- mesh: Mesh;
|
|
|
- impostor: number;
|
|
|
- }
|
|
|
- class PhysicsEngine {
|
|
|
- gravity: Vector3;
|
|
|
- private _currentPlugin;
|
|
|
- constructor(plugin?: IPhysicsEnginePlugin);
|
|
|
- _initialize(gravity?: Vector3): void;
|
|
|
- _runOneStep(delta: number): void;
|
|
|
- _setGravity(gravity: Vector3): void;
|
|
|
- _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
- _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- _unregisterMesh(mesh: AbstractMesh): void;
|
|
|
- _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
- _updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- static NoImpostor: number;
|
|
|
- static SphereImpostor: number;
|
|
|
- static BoxImpostor: number;
|
|
|
- static PlaneImpostor: number;
|
|
|
- static MeshImpostor: number;
|
|
|
- static CapsuleImpostor: number;
|
|
|
- static ConeImpostor: number;
|
|
|
- static CylinderImpostor: number;
|
|
|
- static ConvexHullImpostor: number;
|
|
|
- static Epsilon: number;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class AbstractMesh extends Node implements IDisposable {
|
|
|
private static _BILLBOARDMODE_NONE;
|
|
|
private static _BILLBOARDMODE_X;
|
|
@@ -4244,84 +4117,150 @@ declare module BABYLON {
|
|
|
static UV6Kind: string;
|
|
|
static ColorKind: string;
|
|
|
static MatricesIndicesKind: string;
|
|
|
- static MatricesWeightsKind: string;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class BoundingBoxRenderer {
|
|
|
- frontColor: Color3;
|
|
|
- backColor: Color3;
|
|
|
- showBackLines: boolean;
|
|
|
- renderList: SmartArray<BoundingBox>;
|
|
|
- private _scene;
|
|
|
- private _colorShader;
|
|
|
- private _vb;
|
|
|
- private _ib;
|
|
|
- constructor(scene: Scene);
|
|
|
- private _prepareRessources();
|
|
|
- reset(): void;
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
+ static MatricesWeightsKind: string;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class DepthRenderer {
|
|
|
- private _scene;
|
|
|
- private _depthMap;
|
|
|
- private _effect;
|
|
|
- private _viewMatrix;
|
|
|
- private _projectionMatrix;
|
|
|
- private _transformMatrix;
|
|
|
- private _worldViewProjection;
|
|
|
- private _cachedDefines;
|
|
|
- constructor(scene: Scene, type?: number);
|
|
|
- isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
- getDepthMap(): RenderTargetTexture;
|
|
|
+ interface IPhysicsEnginePlugin {
|
|
|
+ initialize(iterations?: number): any;
|
|
|
+ setGravity(gravity: Vector3): void;
|
|
|
+ runOneStep(delta: number): void;
|
|
|
+ registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
+ registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ unregisterMesh(mesh: AbstractMesh): any;
|
|
|
+ applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class OutlineRenderer {
|
|
|
- private _scene;
|
|
|
- private _effect;
|
|
|
- private _cachedDefines;
|
|
|
- constructor(scene: Scene);
|
|
|
- render(subMesh: SubMesh, batch: _InstancesBatch, useOverlay?: boolean): void;
|
|
|
- isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
+ interface PhysicsBodyCreationOptions {
|
|
|
+ mass: number;
|
|
|
+ friction: number;
|
|
|
+ restitution: number;
|
|
|
+ }
|
|
|
+ interface PhysicsCompoundBodyPart {
|
|
|
+ mesh: Mesh;
|
|
|
+ impostor: number;
|
|
|
+ }
|
|
|
+ class PhysicsEngine {
|
|
|
+ gravity: Vector3;
|
|
|
+ private _currentPlugin;
|
|
|
+ constructor(plugin?: IPhysicsEnginePlugin);
|
|
|
+ _initialize(gravity?: Vector3): void;
|
|
|
+ _runOneStep(delta: number): void;
|
|
|
+ _setGravity(gravity: Vector3): void;
|
|
|
+ _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
+ _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ _unregisterMesh(mesh: AbstractMesh): void;
|
|
|
+ _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
+ _updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
+ dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ static NoImpostor: number;
|
|
|
+ static SphereImpostor: number;
|
|
|
+ static BoxImpostor: number;
|
|
|
+ static PlaneImpostor: number;
|
|
|
+ static MeshImpostor: number;
|
|
|
+ static CapsuleImpostor: number;
|
|
|
+ static ConeImpostor: number;
|
|
|
+ static CylinderImpostor: number;
|
|
|
+ static ConvexHullImpostor: number;
|
|
|
+ static Epsilon: number;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class RenderingGroup {
|
|
|
- index: number;
|
|
|
- private _scene;
|
|
|
- private _opaqueSubMeshes;
|
|
|
- private _transparentSubMeshes;
|
|
|
- private _alphaTestSubMeshes;
|
|
|
- private _activeVertices;
|
|
|
- constructor(index: number, scene: Scene);
|
|
|
- render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
- prepare(): void;
|
|
|
- dispatch(subMesh: SubMesh): void;
|
|
|
+ class Particle {
|
|
|
+ position: Vector3;
|
|
|
+ direction: Vector3;
|
|
|
+ color: Color4;
|
|
|
+ colorStep: Color4;
|
|
|
+ lifeTime: number;
|
|
|
+ age: number;
|
|
|
+ size: number;
|
|
|
+ angle: number;
|
|
|
+ angularSpeed: number;
|
|
|
+ copyTo(other: Particle): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class RenderingManager {
|
|
|
- static MAX_RENDERINGGROUPS: number;
|
|
|
+ class ParticleSystem implements IDisposable {
|
|
|
+ name: string;
|
|
|
+ static BLENDMODE_ONEONE: number;
|
|
|
+ static BLENDMODE_STANDARD: number;
|
|
|
+ id: string;
|
|
|
+ renderingGroupId: number;
|
|
|
+ emitter: any;
|
|
|
+ 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;
|
|
|
+ updateFunction: (particles: Particle[]) => void;
|
|
|
+ blendMode: number;
|
|
|
+ forceDepthWrite: boolean;
|
|
|
+ gravity: Vector3;
|
|
|
+ direction1: Vector3;
|
|
|
+ direction2: Vector3;
|
|
|
+ minEmitBox: Vector3;
|
|
|
+ maxEmitBox: Vector3;
|
|
|
+ color1: Color4;
|
|
|
+ color2: Color4;
|
|
|
+ colorDead: Color4;
|
|
|
+ textureMask: Color4;
|
|
|
+ startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3) => void;
|
|
|
+ startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3) => void;
|
|
|
+ private particles;
|
|
|
+ private _capacity;
|
|
|
private _scene;
|
|
|
- private _renderingGroups;
|
|
|
- private _depthBufferAlreadyCleaned;
|
|
|
- constructor(scene: Scene);
|
|
|
- private _renderParticles(index, activeMeshes);
|
|
|
- private _renderSprites(index);
|
|
|
- private _clearDepthBuffer();
|
|
|
- render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void, activeMeshes: AbstractMesh[], renderParticles: boolean, renderSprites: boolean): void;
|
|
|
- reset(): void;
|
|
|
- dispatch(subMesh: SubMesh): void;
|
|
|
+ private _vertexDeclaration;
|
|
|
+ private _vertexStrideSize;
|
|
|
+ private _stockParticles;
|
|
|
+ private _newPartsExcess;
|
|
|
+ private _vertexBuffer;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _vertices;
|
|
|
+ private _effect;
|
|
|
+ private _customEffect;
|
|
|
+ private _cachedDefines;
|
|
|
+ private _scaledColorStep;
|
|
|
+ private _colorDiff;
|
|
|
+ private _scaledDirection;
|
|
|
+ private _scaledGravity;
|
|
|
+ private _currentRenderId;
|
|
|
+ private _alive;
|
|
|
+ private _started;
|
|
|
+ private _stopped;
|
|
|
+ private _actualFrame;
|
|
|
+ private _scaledUpdateSpeed;
|
|
|
+ constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect);
|
|
|
+ recycleParticle(particle: Particle): void;
|
|
|
+ getCapacity(): number;
|
|
|
+ isAlive(): boolean;
|
|
|
+ isStarted(): boolean;
|
|
|
+ start(): void;
|
|
|
+ stop(): void;
|
|
|
+ _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
|
|
|
+ private _update(newParticles);
|
|
|
+ private _getEffect();
|
|
|
+ animate(): void;
|
|
|
+ render(): number;
|
|
|
+ dispose(): void;
|
|
|
+ clone(name: string, newEmitter: any): ParticleSystem;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -4865,6 +4804,83 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class BoundingBoxRenderer {
|
|
|
+ frontColor: Color3;
|
|
|
+ backColor: Color3;
|
|
|
+ showBackLines: boolean;
|
|
|
+ renderList: SmartArray<BoundingBox>;
|
|
|
+ private _scene;
|
|
|
+ private _colorShader;
|
|
|
+ private _vb;
|
|
|
+ private _ib;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ private _prepareRessources();
|
|
|
+ reset(): void;
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class DepthRenderer {
|
|
|
+ private _scene;
|
|
|
+ private _depthMap;
|
|
|
+ private _effect;
|
|
|
+ private _viewMatrix;
|
|
|
+ private _projectionMatrix;
|
|
|
+ private _transformMatrix;
|
|
|
+ private _worldViewProjection;
|
|
|
+ private _cachedDefines;
|
|
|
+ constructor(scene: Scene, type?: number);
|
|
|
+ isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
+ getDepthMap(): RenderTargetTexture;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class OutlineRenderer {
|
|
|
+ private _scene;
|
|
|
+ private _effect;
|
|
|
+ private _cachedDefines;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ render(subMesh: SubMesh, batch: _InstancesBatch, useOverlay?: boolean): void;
|
|
|
+ isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class RenderingGroup {
|
|
|
+ index: number;
|
|
|
+ private _scene;
|
|
|
+ private _opaqueSubMeshes;
|
|
|
+ private _transparentSubMeshes;
|
|
|
+ private _alphaTestSubMeshes;
|
|
|
+ private _activeVertices;
|
|
|
+ constructor(index: number, scene: Scene);
|
|
|
+ render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
+ prepare(): void;
|
|
|
+ dispatch(subMesh: SubMesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class RenderingManager {
|
|
|
+ static MAX_RENDERINGGROUPS: number;
|
|
|
+ private _scene;
|
|
|
+ private _renderingGroups;
|
|
|
+ private _depthBufferAlreadyCleaned;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ private _renderParticles(index, activeMeshes);
|
|
|
+ private _renderSprites(index);
|
|
|
+ private _clearDepthBuffer();
|
|
|
+ render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void, activeMeshes: AbstractMesh[], renderParticles: boolean, renderSprites: boolean): void;
|
|
|
+ reset(): void;
|
|
|
+ dispatch(subMesh: SubMesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class Sprite {
|
|
|
name: string;
|
|
|
position: Vector3;
|
|
@@ -5369,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;
|
|
@@ -5638,9 +5655,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-declare module BABYLON.Internals {
|
|
|
-}
|
|
|
-
|
|
|
declare module BABYLON {
|
|
|
class ShadowGenerator {
|
|
|
private static _FILTER_NONE;
|
|
@@ -5694,6 +5708,9 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+declare module BABYLON.Internals {
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON {
|
|
|
class BaseTexture {
|
|
|
name: string;
|