|
@@ -2580,6 +2580,7 @@ declare module BABYLON {
|
|
getCompilationError(): string;
|
|
getCompilationError(): string;
|
|
_loadVertexShader(vertex: any, callback: (data: any) => void): void;
|
|
_loadVertexShader(vertex: any, callback: (data: any) => void): void;
|
|
_loadFragmentShader(fragment: any, callback: (data: any) => void): void;
|
|
_loadFragmentShader(fragment: any, callback: (data: any) => void): void;
|
|
|
|
+ private _dumpShadersName();
|
|
private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?);
|
|
private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?);
|
|
isSupported: boolean;
|
|
isSupported: boolean;
|
|
_bindTexture(channel: string, texture: WebGLTexture): void;
|
|
_bindTexture(channel: string, texture: WebGLTexture): void;
|
|
@@ -3347,268 +3348,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
- layerMask: number;
|
|
|
|
- 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 {
|
|
|
|
- class SolidParticle {
|
|
|
|
- idx: number;
|
|
|
|
- color: Color4;
|
|
|
|
- position: Vector3;
|
|
|
|
- rotation: Vector3;
|
|
|
|
- quaternion: Vector4;
|
|
|
|
- scale: Vector3;
|
|
|
|
- uvs: Vector4;
|
|
|
|
- velocity: Vector3;
|
|
|
|
- alive: boolean;
|
|
|
|
- _pos: number;
|
|
|
|
- _model: ModelShape;
|
|
|
|
- shapeId: number;
|
|
|
|
- idxInShape: number;
|
|
|
|
- constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
|
- }
|
|
|
|
- class ModelShape {
|
|
|
|
- shapeID: number;
|
|
|
|
- _shape: Vector3[];
|
|
|
|
- _shapeUV: number[];
|
|
|
|
- _positionFunction: (particle: SolidParticle, i: number, s: number) => void;
|
|
|
|
- _vertexFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void;
|
|
|
|
- constructor(id: number, shape: Vector3[], shapeUV: number[], posFunction: (particle: SolidParticle, i: number, s: number) => void, vtxFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class SolidParticleSystem implements IDisposable {
|
|
|
|
- particles: SolidParticle[];
|
|
|
|
- nbParticles: number;
|
|
|
|
- billboard: boolean;
|
|
|
|
- counter: number;
|
|
|
|
- name: string;
|
|
|
|
- mesh: Mesh;
|
|
|
|
- private _scene;
|
|
|
|
- private _positions;
|
|
|
|
- private _indices;
|
|
|
|
- private _normals;
|
|
|
|
- private _colors;
|
|
|
|
- private _uvs;
|
|
|
|
- private _positions32;
|
|
|
|
- private _normals32;
|
|
|
|
- private _colors32;
|
|
|
|
- private _uvs32;
|
|
|
|
- private _index;
|
|
|
|
- private _updatable;
|
|
|
|
- private _shapeCounter;
|
|
|
|
- private _copy;
|
|
|
|
- private _shape;
|
|
|
|
- private _shapeUV;
|
|
|
|
- private _color;
|
|
|
|
- private _computeParticleColor;
|
|
|
|
- private _computeParticleTexture;
|
|
|
|
- private _computeParticleRotation;
|
|
|
|
- private _computeParticleVertex;
|
|
|
|
- private _cam_axisZ;
|
|
|
|
- private _cam_axisY;
|
|
|
|
- private _cam_axisX;
|
|
|
|
- private _axisX;
|
|
|
|
- private _axisY;
|
|
|
|
- private _axisZ;
|
|
|
|
- private _camera;
|
|
|
|
- private _particle;
|
|
|
|
- private _fakeCamPos;
|
|
|
|
- private _rotMatrix;
|
|
|
|
- private _invertedMatrix;
|
|
|
|
- private _rotated;
|
|
|
|
- private _quaternion;
|
|
|
|
- private _vertex;
|
|
|
|
- private _yaw;
|
|
|
|
- private _pitch;
|
|
|
|
- private _roll;
|
|
|
|
- private _halfroll;
|
|
|
|
- private _halfpitch;
|
|
|
|
- private _halfyaw;
|
|
|
|
- private _sinRoll;
|
|
|
|
- private _cosRoll;
|
|
|
|
- private _sinPitch;
|
|
|
|
- private _cosPitch;
|
|
|
|
- private _sinYaw;
|
|
|
|
- private _cosYaw;
|
|
|
|
- constructor(name: string, scene: Scene, options?: {
|
|
|
|
- updatable?: boolean;
|
|
|
|
- });
|
|
|
|
- buildMesh(): Mesh;
|
|
|
|
- private _resetCopy();
|
|
|
|
- private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options);
|
|
|
|
- private _posToShape(positions);
|
|
|
|
- private _uvsToShapeUV(uvs);
|
|
|
|
- private _addParticle(p, idxpos, model, shapeId, idxInShape);
|
|
|
|
- addShape(mesh: Mesh, nb: number, options?: {
|
|
|
|
- positionFunction?: any;
|
|
|
|
- vertexFunction?: any;
|
|
|
|
- }): number;
|
|
|
|
- private _rebuildParticle(particle);
|
|
|
|
- rebuildMesh(): void;
|
|
|
|
- setParticles(start?: number, end?: number, update?: boolean): void;
|
|
|
|
- private _quaternionRotationYPR();
|
|
|
|
- private _quaternionToRotationMatrix();
|
|
|
|
- dispose(): void;
|
|
|
|
- computeParticleRotation: boolean;
|
|
|
|
- computeParticleColor: boolean;
|
|
|
|
- computeParticleTexture: boolean;
|
|
|
|
- computeParticleVertex: boolean;
|
|
|
|
- initParticles(): void;
|
|
|
|
- recycleParticle(particle: SolidParticle): SolidParticle;
|
|
|
|
- updateParticle(particle: SolidParticle): SolidParticle;
|
|
|
|
- updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3;
|
|
|
|
- beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
- afterUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-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;
|
|
|
|
- getWorldObject(): any;
|
|
|
|
- getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
|
- }
|
|
|
|
- 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;
|
|
|
|
- getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
|
- 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 HeightmapImpostor: number;
|
|
|
|
- static Epsilon: number;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class AbstractMesh extends Node implements IDisposable {
|
|
class AbstractMesh extends Node implements IDisposable {
|
|
private static _BILLBOARDMODE_NONE;
|
|
private static _BILLBOARDMODE_NONE;
|
|
private static _BILLBOARDMODE_X;
|
|
private static _BILLBOARDMODE_X;
|
|
@@ -4831,71 +4570,312 @@ declare module BABYLON {
|
|
intersects(ray: Ray, positions: Vector3[], indices: number[], fastCheck?: boolean): IntersectionInfo;
|
|
intersects(ray: Ray, positions: Vector3[], indices: number[], fastCheck?: boolean): IntersectionInfo;
|
|
clone(newMesh: AbstractMesh, newRenderingMesh?: Mesh): SubMesh;
|
|
clone(newMesh: AbstractMesh, newRenderingMesh?: Mesh): SubMesh;
|
|
dispose(): void;
|
|
dispose(): void;
|
|
- static CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh): SubMesh;
|
|
|
|
|
|
+ static CreateFromIndices(materialIndex: number, startIndex: number, indexCount: number, mesh: AbstractMesh, renderingMesh?: Mesh): SubMesh;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class VertexBuffer {
|
|
|
|
+ private _mesh;
|
|
|
|
+ private _engine;
|
|
|
|
+ private _buffer;
|
|
|
|
+ private _data;
|
|
|
|
+ private _updatable;
|
|
|
|
+ private _kind;
|
|
|
|
+ private _strideSize;
|
|
|
|
+ constructor(engine: any, data: number[] | Float32Array, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number);
|
|
|
|
+ isUpdatable(): boolean;
|
|
|
|
+ getData(): number[] | Float32Array;
|
|
|
|
+ getBuffer(): WebGLBuffer;
|
|
|
|
+ getStrideSize(): number;
|
|
|
|
+ create(data?: number[] | Float32Array): void;
|
|
|
|
+ update(data: number[] | Float32Array): void;
|
|
|
|
+ updateDirectly(data: Float32Array, offset: number): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ private static _PositionKind;
|
|
|
|
+ private static _NormalKind;
|
|
|
|
+ private static _UVKind;
|
|
|
|
+ private static _UV2Kind;
|
|
|
|
+ private static _UV3Kind;
|
|
|
|
+ private static _UV4Kind;
|
|
|
|
+ private static _UV5Kind;
|
|
|
|
+ private static _UV6Kind;
|
|
|
|
+ private static _ColorKind;
|
|
|
|
+ private static _MatricesIndicesKind;
|
|
|
|
+ private static _MatricesWeightsKind;
|
|
|
|
+ static PositionKind: string;
|
|
|
|
+ static NormalKind: string;
|
|
|
|
+ static UVKind: string;
|
|
|
|
+ static UV2Kind: string;
|
|
|
|
+ static UV3Kind: string;
|
|
|
|
+ static UV4Kind: string;
|
|
|
|
+ static UV5Kind: string;
|
|
|
|
+ static UV6Kind: string;
|
|
|
|
+ static ColorKind: string;
|
|
|
|
+ static MatricesIndicesKind: string;
|
|
|
|
+ static MatricesWeightsKind: string;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+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;
|
|
|
|
+ layerMask: number;
|
|
|
|
+ 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 {
|
|
declare module BABYLON {
|
|
- class VertexBuffer {
|
|
|
|
- private _mesh;
|
|
|
|
- private _engine;
|
|
|
|
- private _buffer;
|
|
|
|
- private _data;
|
|
|
|
- private _updatable;
|
|
|
|
- private _kind;
|
|
|
|
- private _strideSize;
|
|
|
|
- constructor(engine: any, data: number[] | Float32Array, kind: string, updatable: boolean, postponeInternalCreation?: boolean, stride?: number);
|
|
|
|
- isUpdatable(): boolean;
|
|
|
|
- getData(): number[] | Float32Array;
|
|
|
|
- getBuffer(): WebGLBuffer;
|
|
|
|
- getStrideSize(): number;
|
|
|
|
- create(data?: number[] | Float32Array): void;
|
|
|
|
- update(data: number[] | Float32Array): void;
|
|
|
|
- updateDirectly(data: Float32Array, offset: number): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- private static _PositionKind;
|
|
|
|
- private static _NormalKind;
|
|
|
|
- private static _UVKind;
|
|
|
|
- private static _UV2Kind;
|
|
|
|
- private static _UV3Kind;
|
|
|
|
- private static _UV4Kind;
|
|
|
|
- private static _UV5Kind;
|
|
|
|
- private static _UV6Kind;
|
|
|
|
- private static _ColorKind;
|
|
|
|
- private static _MatricesIndicesKind;
|
|
|
|
- private static _MatricesWeightsKind;
|
|
|
|
- static PositionKind: string;
|
|
|
|
- static NormalKind: string;
|
|
|
|
- static UVKind: string;
|
|
|
|
- static UV2Kind: string;
|
|
|
|
- static UV3Kind: string;
|
|
|
|
- static UV4Kind: string;
|
|
|
|
- static UV5Kind: string;
|
|
|
|
- static UV6Kind: string;
|
|
|
|
- static ColorKind: string;
|
|
|
|
- static MatricesIndicesKind: string;
|
|
|
|
- static MatricesWeightsKind: string;
|
|
|
|
|
|
+ class SolidParticle {
|
|
|
|
+ idx: number;
|
|
|
|
+ color: Color4;
|
|
|
|
+ position: Vector3;
|
|
|
|
+ rotation: Vector3;
|
|
|
|
+ quaternion: Vector4;
|
|
|
|
+ scale: Vector3;
|
|
|
|
+ uvs: Vector4;
|
|
|
|
+ velocity: Vector3;
|
|
|
|
+ alive: boolean;
|
|
|
|
+ _pos: number;
|
|
|
|
+ _model: ModelShape;
|
|
|
|
+ shapeId: number;
|
|
|
|
+ idxInShape: number;
|
|
|
|
+ constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
|
+ }
|
|
|
|
+ class ModelShape {
|
|
|
|
+ shapeID: number;
|
|
|
|
+ _shape: Vector3[];
|
|
|
|
+ _shapeUV: number[];
|
|
|
|
+ _positionFunction: (particle: SolidParticle, i: number, s: number) => void;
|
|
|
|
+ _vertexFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void;
|
|
|
|
+ constructor(id: number, shape: Vector3[], shapeUV: number[], posFunction: (particle: SolidParticle, i: number, s: number) => void, vtxFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class ReflectionProbe {
|
|
|
|
|
|
+ class SolidParticleSystem implements IDisposable {
|
|
|
|
+ particles: SolidParticle[];
|
|
|
|
+ nbParticles: number;
|
|
|
|
+ billboard: boolean;
|
|
|
|
+ counter: number;
|
|
name: string;
|
|
name: string;
|
|
|
|
+ mesh: Mesh;
|
|
private _scene;
|
|
private _scene;
|
|
- private _renderTargetTexture;
|
|
|
|
- private _projectionMatrix;
|
|
|
|
- private _viewMatrix;
|
|
|
|
- private _target;
|
|
|
|
- private _add;
|
|
|
|
- private _attachedMesh;
|
|
|
|
- position: Vector3;
|
|
|
|
- constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
|
- refreshRate: number;
|
|
|
|
- getScene(): Scene;
|
|
|
|
- cubeTexture: RenderTargetTexture;
|
|
|
|
- renderList: AbstractMesh[];
|
|
|
|
- attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
|
|
+ private _positions;
|
|
|
|
+ private _indices;
|
|
|
|
+ private _normals;
|
|
|
|
+ private _colors;
|
|
|
|
+ private _uvs;
|
|
|
|
+ private _positions32;
|
|
|
|
+ private _normals32;
|
|
|
|
+ private _colors32;
|
|
|
|
+ private _uvs32;
|
|
|
|
+ private _index;
|
|
|
|
+ private _updatable;
|
|
|
|
+ private _shapeCounter;
|
|
|
|
+ private _copy;
|
|
|
|
+ private _shape;
|
|
|
|
+ private _shapeUV;
|
|
|
|
+ private _color;
|
|
|
|
+ private _computeParticleColor;
|
|
|
|
+ private _computeParticleTexture;
|
|
|
|
+ private _computeParticleRotation;
|
|
|
|
+ private _computeParticleVertex;
|
|
|
|
+ private _cam_axisZ;
|
|
|
|
+ private _cam_axisY;
|
|
|
|
+ private _cam_axisX;
|
|
|
|
+ private _axisX;
|
|
|
|
+ private _axisY;
|
|
|
|
+ private _axisZ;
|
|
|
|
+ private _camera;
|
|
|
|
+ private _particle;
|
|
|
|
+ private _fakeCamPos;
|
|
|
|
+ private _rotMatrix;
|
|
|
|
+ private _invertedMatrix;
|
|
|
|
+ private _rotated;
|
|
|
|
+ private _quaternion;
|
|
|
|
+ private _vertex;
|
|
|
|
+ private _yaw;
|
|
|
|
+ private _pitch;
|
|
|
|
+ private _roll;
|
|
|
|
+ private _halfroll;
|
|
|
|
+ private _halfpitch;
|
|
|
|
+ private _halfyaw;
|
|
|
|
+ private _sinRoll;
|
|
|
|
+ private _cosRoll;
|
|
|
|
+ private _sinPitch;
|
|
|
|
+ private _cosPitch;
|
|
|
|
+ private _sinYaw;
|
|
|
|
+ private _cosYaw;
|
|
|
|
+ constructor(name: string, scene: Scene, options?: {
|
|
|
|
+ updatable?: boolean;
|
|
|
|
+ });
|
|
|
|
+ buildMesh(): Mesh;
|
|
|
|
+ private _resetCopy();
|
|
|
|
+ private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options);
|
|
|
|
+ private _posToShape(positions);
|
|
|
|
+ private _uvsToShapeUV(uvs);
|
|
|
|
+ private _addParticle(p, idxpos, model, shapeId, idxInShape);
|
|
|
|
+ addShape(mesh: Mesh, nb: number, options?: {
|
|
|
|
+ positionFunction?: any;
|
|
|
|
+ vertexFunction?: any;
|
|
|
|
+ }): number;
|
|
|
|
+ private _rebuildParticle(particle);
|
|
|
|
+ rebuildMesh(): void;
|
|
|
|
+ setParticles(start?: number, end?: number, update?: boolean): void;
|
|
|
|
+ private _quaternionRotationYPR();
|
|
|
|
+ private _quaternionToRotationMatrix();
|
|
|
|
+ dispose(): void;
|
|
|
|
+ computeParticleRotation: boolean;
|
|
|
|
+ computeParticleColor: boolean;
|
|
|
|
+ computeParticleTexture: boolean;
|
|
|
|
+ computeParticleVertex: boolean;
|
|
|
|
+ initParticles(): void;
|
|
|
|
+ recycleParticle(particle: SolidParticle): SolidParticle;
|
|
|
|
+ updateParticle(particle: SolidParticle): SolidParticle;
|
|
|
|
+ updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3;
|
|
|
|
+ beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ afterUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+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;
|
|
|
|
+ getWorldObject(): any;
|
|
|
|
+ getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
|
+ }
|
|
|
|
+ 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;
|
|
dispose(): void;
|
|
|
|
+ isSupported(): boolean;
|
|
|
|
+ getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
|
+ 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 HeightmapImpostor: number;
|
|
|
|
+ static Epsilon: number;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5454,6 +5434,27 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class ReflectionProbe {
|
|
|
|
+ name: string;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _renderTargetTexture;
|
|
|
|
+ private _projectionMatrix;
|
|
|
|
+ private _viewMatrix;
|
|
|
|
+ private _target;
|
|
|
|
+ private _add;
|
|
|
|
+ private _attachedMesh;
|
|
|
|
+ position: Vector3;
|
|
|
|
+ constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
|
+ refreshRate: number;
|
|
|
|
+ getScene(): Scene;
|
|
|
|
+ cubeTexture: RenderTargetTexture;
|
|
|
|
+ renderList: AbstractMesh[];
|
|
|
|
+ attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class BoundingBoxRenderer {
|
|
class BoundingBoxRenderer {
|
|
frontColor: Color3;
|
|
frontColor: Color3;
|
|
backColor: Color3;
|
|
backColor: Color3;
|