|
@@ -416,6 +416,7 @@ declare module BABYLON {
|
|
|
uniqueId: number;
|
|
|
state: string;
|
|
|
animations: Animation[];
|
|
|
+ private _ranges;
|
|
|
onReady: (node: Node) => void;
|
|
|
private _childrenFlag;
|
|
|
private _isEnabled;
|
|
@@ -475,6 +476,12 @@ declare module BABYLON {
|
|
|
getDescendants(): Node[];
|
|
|
_setReady(state: boolean): void;
|
|
|
getAnimationByName(name: string): Animation;
|
|
|
+ createAnimationRange(name: string, from: number, to: number): void;
|
|
|
+ deleteAnimationRange(name: string, deleteFrames?: boolean): void;
|
|
|
+ getAnimationRange(name: string): AnimationRange;
|
|
|
+ beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): void;
|
|
|
+ serializeAnimationRanges(): any;
|
|
|
+ static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1310,11 +1317,12 @@ declare module BABYLON {
|
|
|
*/
|
|
|
removeEvents(frame: number): void;
|
|
|
createRange(name: string, from: number, to: number): void;
|
|
|
- deleteRange(name: string): void;
|
|
|
+ deleteRange(name: string, deleteFrames?: boolean): void;
|
|
|
getRange(name: string): AnimationRange;
|
|
|
reset(): void;
|
|
|
isStopped(): boolean;
|
|
|
getKeys(): any[];
|
|
|
+ getHighestFrame(): number;
|
|
|
getEasingFunction(): IEasingFunction;
|
|
|
setEasingFunction(easingFunction: EasingFunction): void;
|
|
|
floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number;
|
|
@@ -1621,6 +1629,7 @@ declare module BABYLON {
|
|
|
updateMatrix(matrix: Matrix): void;
|
|
|
private _updateDifferenceMatrix();
|
|
|
markAsDirty(): void;
|
|
|
+ copyAnimationRange(source: Bone, rangeName: string, frameOffset: number, rescaleAsRequired?: boolean): boolean;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1639,8 +1648,13 @@ declare module BABYLON {
|
|
|
getTransformMatrices(): Float32Array;
|
|
|
getScene(): Scene;
|
|
|
createAnimationRange(name: string, from: number, to: number): void;
|
|
|
- deleteAnimationRange(name: string): void;
|
|
|
+ deleteAnimationRange(name: string, deleteFrames?: boolean): void;
|
|
|
getAnimationRange(name: string): AnimationRange;
|
|
|
+ /**
|
|
|
+ * note: This is not for a complete retargeting, only between very similar skeleton's with only possible bone length differences
|
|
|
+ */
|
|
|
+ copyAnimationRange(source: Skeleton, name: string, rescaleAsRequired?: boolean): boolean;
|
|
|
+ private _getHighestAnimationFrame();
|
|
|
beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): void;
|
|
|
_markAsDirty(): void;
|
|
|
prepare(): void;
|
|
@@ -2052,6 +2066,63 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class DebugLayer {
|
|
|
+ private _scene;
|
|
|
+ private _camera;
|
|
|
+ private _transformationMatrix;
|
|
|
+ private _enabled;
|
|
|
+ private _labelsEnabled;
|
|
|
+ private _displayStatistics;
|
|
|
+ private _displayTree;
|
|
|
+ private _displayLogs;
|
|
|
+ private _globalDiv;
|
|
|
+ private _statsDiv;
|
|
|
+ private _statsSubsetDiv;
|
|
|
+ private _optionsDiv;
|
|
|
+ private _optionsSubsetDiv;
|
|
|
+ private _logDiv;
|
|
|
+ private _logSubsetDiv;
|
|
|
+ private _treeDiv;
|
|
|
+ private _treeSubsetDiv;
|
|
|
+ private _drawingCanvas;
|
|
|
+ private _drawingContext;
|
|
|
+ private _rootElement;
|
|
|
+ _syncPositions: () => void;
|
|
|
+ private _syncData;
|
|
|
+ private _syncUI;
|
|
|
+ private _onCanvasClick;
|
|
|
+ private _clickPosition;
|
|
|
+ private _ratio;
|
|
|
+ private _identityMatrix;
|
|
|
+ private _showUI;
|
|
|
+ private _needToRefreshMeshesTree;
|
|
|
+ shouldDisplayLabel: (node: Node) => boolean;
|
|
|
+ shouldDisplayAxis: (mesh: Mesh) => boolean;
|
|
|
+ axisRatio: number;
|
|
|
+ accentColor: string;
|
|
|
+ customStatsFunction: () => string;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ private _refreshMeshesTreeContent();
|
|
|
+ private _renderSingleAxis(zero, unit, unitText, label, color);
|
|
|
+ private _renderAxis(projectedPosition, mesh, globalViewport);
|
|
|
+ private _renderLabel(text, projectedPosition, labelOffset, onClick, getFillStyle);
|
|
|
+ private _isClickInsideRect(x, y, width, height);
|
|
|
+ isVisible(): boolean;
|
|
|
+ hide(): void;
|
|
|
+ show(showUI?: boolean, camera?: Camera, rootElement?: HTMLElement): void;
|
|
|
+ private _clearLabels();
|
|
|
+ private _generateheader(root, text);
|
|
|
+ private _generateTexBox(root, title, color);
|
|
|
+ private _generateAdvancedCheckBox(root, leftTitle, rightTitle, initialState, task, tag?);
|
|
|
+ private _generateCheckBox(root, title, initialState, task, tag?);
|
|
|
+ private _generateButton(root, title, task, tag?);
|
|
|
+ private _generateRadio(root, title, name, initialState, task, tag?);
|
|
|
+ private _generateDOMelements();
|
|
|
+ private _displayStats();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class Collider {
|
|
|
radius: Vector3;
|
|
|
retry: number;
|
|
@@ -2293,6 +2364,26 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class Layer {
|
|
|
+ name: string;
|
|
|
+ texture: Texture;
|
|
|
+ isBackground: boolean;
|
|
|
+ color: Color4;
|
|
|
+ onDispose: () => void;
|
|
|
+ alphaBlendingMode: number;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class BoundingBox {
|
|
|
minimum: Vector3;
|
|
|
maximum: Vector3;
|
|
@@ -2353,83 +2444,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class DebugLayer {
|
|
|
- private _scene;
|
|
|
- private _camera;
|
|
|
- private _transformationMatrix;
|
|
|
- private _enabled;
|
|
|
- private _labelsEnabled;
|
|
|
- private _displayStatistics;
|
|
|
- private _displayTree;
|
|
|
- private _displayLogs;
|
|
|
- private _globalDiv;
|
|
|
- private _statsDiv;
|
|
|
- private _statsSubsetDiv;
|
|
|
- private _optionsDiv;
|
|
|
- private _optionsSubsetDiv;
|
|
|
- private _logDiv;
|
|
|
- private _logSubsetDiv;
|
|
|
- private _treeDiv;
|
|
|
- private _treeSubsetDiv;
|
|
|
- private _drawingCanvas;
|
|
|
- private _drawingContext;
|
|
|
- private _rootElement;
|
|
|
- _syncPositions: () => void;
|
|
|
- private _syncData;
|
|
|
- private _syncUI;
|
|
|
- private _onCanvasClick;
|
|
|
- private _clickPosition;
|
|
|
- private _ratio;
|
|
|
- private _identityMatrix;
|
|
|
- private _showUI;
|
|
|
- private _needToRefreshMeshesTree;
|
|
|
- shouldDisplayLabel: (node: Node) => boolean;
|
|
|
- shouldDisplayAxis: (mesh: Mesh) => boolean;
|
|
|
- axisRatio: number;
|
|
|
- accentColor: string;
|
|
|
- customStatsFunction: () => string;
|
|
|
- constructor(scene: Scene);
|
|
|
- private _refreshMeshesTreeContent();
|
|
|
- private _renderSingleAxis(zero, unit, unitText, label, color);
|
|
|
- private _renderAxis(projectedPosition, mesh, globalViewport);
|
|
|
- private _renderLabel(text, projectedPosition, labelOffset, onClick, getFillStyle);
|
|
|
- private _isClickInsideRect(x, y, width, height);
|
|
|
- isVisible(): boolean;
|
|
|
- hide(): void;
|
|
|
- show(showUI?: boolean, camera?: Camera, rootElement?: HTMLElement): void;
|
|
|
- private _clearLabels();
|
|
|
- private _generateheader(root, text);
|
|
|
- private _generateTexBox(root, title, color);
|
|
|
- private _generateAdvancedCheckBox(root, leftTitle, rightTitle, initialState, task, tag?);
|
|
|
- private _generateCheckBox(root, title, initialState, task, tag?);
|
|
|
- private _generateButton(root, title, task, tag?);
|
|
|
- private _generateRadio(root, title, name, initialState, task, tag?);
|
|
|
- private _generateDOMelements();
|
|
|
- private _displayStats();
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class Layer {
|
|
|
- name: string;
|
|
|
- texture: Texture;
|
|
|
- isBackground: boolean;
|
|
|
- color: Color4;
|
|
|
- onDispose: () => void;
|
|
|
- alphaBlendingMode: number;
|
|
|
- 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;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class LensFlare {
|
|
|
size: number;
|
|
|
position: number;
|
|
@@ -2600,38 +2614,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- interface ISceneLoaderPlugin {
|
|
|
- extensions: string;
|
|
|
- importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
|
|
|
- load: (scene: Scene, data: string, rootUrl: string) => boolean;
|
|
|
- }
|
|
|
- class SceneLoader {
|
|
|
- private static _ForceFullSceneLoadingForIncremental;
|
|
|
- private static _ShowLoadingScreen;
|
|
|
- static ForceFullSceneLoadingForIncremental: boolean;
|
|
|
- static ShowLoadingScreen: boolean;
|
|
|
- private static _registeredPlugins;
|
|
|
- private static _getPluginForFilename(sceneFilename);
|
|
|
- static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
|
|
|
- static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
|
|
|
- /**
|
|
|
- * Load a scene
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
- * @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
- */
|
|
|
- static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
- /**
|
|
|
- * Append a scene
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
- * @param scene is the instance of BABYLON.Scene to append to
|
|
|
- */
|
|
|
- static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class EffectFallbacks {
|
|
|
private _defines;
|
|
|
private _currentRank;
|
|
@@ -2907,6 +2889,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 SIMDVector3 {
|
|
|
static TransformCoordinatesToRefSIMD(vector: Vector3, transformation: Matrix, result: Vector3): void;
|
|
|
static TransformCoordinatesFromFloatsToRefSIMD(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
|
|
@@ -3105,7 +3119,7 @@ declare module BABYLON {
|
|
|
static DistanceSquared(value1: Vector3, value2: Vector3): number;
|
|
|
static Center(value1: Vector3, value2: Vector3): Vector3;
|
|
|
/**
|
|
|
- * Given three orthogonal left-handed oriented Vector3 axis in space (target system),
|
|
|
+ * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
|
|
|
* RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
|
|
|
* to something in order to rotate it from its local system to the given target system.
|
|
|
*/
|
|
@@ -3441,6 +3455,334 @@ 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, particle: Particle) => void;
|
|
|
+ startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => 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;
|
|
|
+ serialize(): any;
|
|
|
+ static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): 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 {
|
|
|
+ /**
|
|
|
+ * Full documentation here : http://doc.babylonjs.com/tutorials/Solid_Particle_System
|
|
|
+ */
|
|
|
+ class SolidParticleSystem implements IDisposable {
|
|
|
+ particles: SolidParticle[];
|
|
|
+ nbParticles: number;
|
|
|
+ billboard: boolean;
|
|
|
+ counter: number;
|
|
|
+ name: string;
|
|
|
+ mesh: Mesh;
|
|
|
+ vars: any;
|
|
|
+ pickedParticles: {
|
|
|
+ idx: number;
|
|
|
+ faceId: number;
|
|
|
+ }[];
|
|
|
+ private _scene;
|
|
|
+ private _positions;
|
|
|
+ private _indices;
|
|
|
+ private _normals;
|
|
|
+ private _colors;
|
|
|
+ private _uvs;
|
|
|
+ private _positions32;
|
|
|
+ private _normals32;
|
|
|
+ private _fixedNormal32;
|
|
|
+ private _colors32;
|
|
|
+ private _uvs32;
|
|
|
+ private _index;
|
|
|
+ private _updatable;
|
|
|
+ private _pickable;
|
|
|
+ private _alwaysVisible;
|
|
|
+ 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 _invertMatrix;
|
|
|
+ private _rotated;
|
|
|
+ private _quaternion;
|
|
|
+ private _vertex;
|
|
|
+ private _normal;
|
|
|
+ private _yaw;
|
|
|
+ private _pitch;
|
|
|
+ private _roll;
|
|
|
+ private _halfroll;
|
|
|
+ private _halfpitch;
|
|
|
+ private _halfyaw;
|
|
|
+ private _sinRoll;
|
|
|
+ private _cosRoll;
|
|
|
+ private _sinPitch;
|
|
|
+ private _cosPitch;
|
|
|
+ private _sinYaw;
|
|
|
+ private _cosYaw;
|
|
|
+ private _w;
|
|
|
+ /**
|
|
|
+ * Creates a SPS (Solid Particle System) object.
|
|
|
+ * @param name the SPS name, this will be the underlying mesh name
|
|
|
+ * @param updatable (default true) if the SPS must be updatable or immutable
|
|
|
+ * @param isPickable (default false) if the solid particles must be pickable
|
|
|
+ */
|
|
|
+ constructor(name: string, scene: Scene, options?: {
|
|
|
+ updatable?: boolean;
|
|
|
+ isPickable?: boolean;
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
|
+ * If no model shape was added to the SPS, the return mesh is only a single triangular plane.
|
|
|
+ */
|
|
|
+ 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(idx, idxpos, model, shapeId, idxInShape);
|
|
|
+ /**
|
|
|
+ * Adds some particles to the SPS from the model shape.
|
|
|
+ * Please read the doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#create-an-immutable-sps
|
|
|
+ * @param mesh any Mesh object that will be used as a model for the solid particles.
|
|
|
+ * @param nb the number of particles to be created from this model
|
|
|
+ * @param positionFunction an optional javascript function to called for each particle on SPS creation
|
|
|
+ * @param vertexFunction an optional javascript function to called for each vertex of each particle on SPS creation
|
|
|
+ */
|
|
|
+ addShape(mesh: Mesh, nb: number, options?: {
|
|
|
+ positionFunction?: any;
|
|
|
+ vertexFunction?: any;
|
|
|
+ }): number;
|
|
|
+ private _rebuildParticle(particle);
|
|
|
+ /**
|
|
|
+ * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
|
|
|
+ */
|
|
|
+ rebuildMesh(): void;
|
|
|
+ /**
|
|
|
+ * Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
|
|
|
+ * This method calls updateParticle() for each particles of the SPS.
|
|
|
+ * For an animated SPS, it is usually called within the render loop.
|
|
|
+ * @param start (default 0) the particle index in the particle array where to start to compute the particle property values
|
|
|
+ * @param end (default nbParticle - 1) the particle index in the particle array where to stop to compute the particle property values
|
|
|
+ * @param update (default true) if the mesh must be finally updated on this call after all the particle computations.
|
|
|
+ */
|
|
|
+ setParticles(start?: number, end?: number, update?: boolean): void;
|
|
|
+ private _quaternionRotationYPR();
|
|
|
+ private _quaternionToRotationMatrix();
|
|
|
+ /**
|
|
|
+ * Disposes the SPS
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ refreshVisibleSize(): void;
|
|
|
+ /**
|
|
|
+ * True if the SPS is set as always visible
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the SPS as always visible or not
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ isAlwaysVisible: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticle() to compute the particle rotations or not.
|
|
|
+ * Default value : true. The SPS is faster when it's set to false.
|
|
|
+ * Note : the particle rotations aren't stored values, so setting computeParticleRotation to false will prevents the particle to rotate.
|
|
|
+ */
|
|
|
+ computeParticleRotation: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticle() to compute the particle colors or not.
|
|
|
+ * Default value : true. The SPS is faster when it's set to false.
|
|
|
+ * Note : the particle colors are stored values, so setting computeParticleColor to false will keep yet the last colors set.
|
|
|
+ */
|
|
|
+ computeParticleColor: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticle() to compute the particle textures or not.
|
|
|
+ * Default value : true. The SPS is faster when it's set to false.
|
|
|
+ * Note : the particle textures are stored values, so setting computeParticleTexture to false will keep yet the last colors set.
|
|
|
+ */
|
|
|
+ computeParticleTexture: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticle() to call the vertex function for each vertex of each particle, or not.
|
|
|
+ * Default value : false. The SPS is faster when it's set to false.
|
|
|
+ * Note : the particle custom vertex positions aren't stored values.
|
|
|
+ */
|
|
|
+ computeParticleVertex: boolean;
|
|
|
+ /**
|
|
|
+ * This function does nothing. It may be overwritten to set all the particles first values.
|
|
|
+ * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ */
|
|
|
+ initParticles(): void;
|
|
|
+ /**
|
|
|
+ * This function does nothing. It may be overwritten to recycle a particle.
|
|
|
+ * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ */
|
|
|
+ recycleParticle(particle: SolidParticle): SolidParticle;
|
|
|
+ /**
|
|
|
+ * Updates a particle : this function should be overwritten by the user.
|
|
|
+ * It is called on each particle by setParticles(). This is the place to code each particle behavior.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ * ex : just set a particle position or velocity and recycle conditions
|
|
|
+ */
|
|
|
+ updateParticle(particle: SolidParticle): SolidParticle;
|
|
|
+ /**
|
|
|
+ * Updates a vertex of a particle : it can be overwritten by the user.
|
|
|
+ * This will be called on each vertex particle by setParticles() if computeParticleVertex is set to true only.
|
|
|
+ * @param particle the current particle
|
|
|
+ * @param vertex the current index of the current particle
|
|
|
+ * @param pt the index of the current vertex in the particle shape
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#update-each-particle-shape
|
|
|
+ * ex : just set a vertex particle position
|
|
|
+ */
|
|
|
+ updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3;
|
|
|
+ /**
|
|
|
+ * This will be called before any other treatment by setParticles() and will be passed three parameters.
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
+ * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
+ */
|
|
|
+ beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
+ /**
|
|
|
+ * This will be called by setParticles() after all the other treatments and just before the actual mesh update.
|
|
|
+ * This will be passed three parameters.
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
+ * @param start the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
+ */
|
|
|
+ afterUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class AbstractMesh extends Node implements IDisposable {
|
|
|
private static _BILLBOARDMODE_NONE;
|
|
|
private static _BILLBOARDMODE_X;
|
|
@@ -3877,8 +4219,26 @@ declare module BABYLON {
|
|
|
constructor(name: string, scene: Scene);
|
|
|
subdivisions: number;
|
|
|
optimize(chunksCount: number, octreeBlocksSize?: number): void;
|
|
|
+ /**
|
|
|
+ * Returns a height (y) value in the Worl system :
|
|
|
+ * the ground altitude at the coordinates (x, z) expressed in the World system.
|
|
|
+ * Returns the ground y position if (x, z) are outside the ground surface.
|
|
|
+ * Not pertinent if the ground is rotated.
|
|
|
+ */
|
|
|
getHeightAtCoordinates(x: number, z: number): number;
|
|
|
+ /**
|
|
|
+ * Returns a normalized vector (Vector3) orthogonal to the ground
|
|
|
+ * at the ground coordinates (x, z) expressed in the World system.
|
|
|
+ * Returns Vector3(0, 1, 0) if (x, z) are outside the ground surface.
|
|
|
+ * Not pertinent if the ground is rotated.
|
|
|
+ */
|
|
|
getNormalAtCoordinates(x: number, z: number): Vector3;
|
|
|
+ /**
|
|
|
+ * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground
|
|
|
+ * at the ground coordinates (x, z) expressed in the World system.
|
|
|
+ * Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface.
|
|
|
+ * Not pertinent if the ground is rotated.
|
|
|
+ */
|
|
|
getNormalAtCoordinatesToRef(x: number, z: number, ref: Vector3): void;
|
|
|
private _getFacetAt(x, z);
|
|
|
private _computeHeightQuads();
|
|
@@ -4769,228 +5129,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;
|
|
|
- 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, particle: Particle) => void;
|
|
|
- startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => 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;
|
|
|
- serialize(): any;
|
|
|
- static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): 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;
|
|
|
- vars: any;
|
|
|
- pickedParticles: {
|
|
|
- idx: number;
|
|
|
- faceId: number;
|
|
|
- }[];
|
|
|
- private _scene;
|
|
|
- private _positions;
|
|
|
- private _indices;
|
|
|
- private _normals;
|
|
|
- private _colors;
|
|
|
- private _uvs;
|
|
|
- private _positions32;
|
|
|
- private _normals32;
|
|
|
- private _fixedNormal32;
|
|
|
- private _colors32;
|
|
|
- private _uvs32;
|
|
|
- private _index;
|
|
|
- private _updatable;
|
|
|
- private _pickable;
|
|
|
- private _alwaysVisible;
|
|
|
- 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 _invertMatrix;
|
|
|
- private _rotated;
|
|
|
- private _quaternion;
|
|
|
- private _vertex;
|
|
|
- private _normal;
|
|
|
- private _yaw;
|
|
|
- private _pitch;
|
|
|
- private _roll;
|
|
|
- private _halfroll;
|
|
|
- private _halfpitch;
|
|
|
- private _halfyaw;
|
|
|
- private _sinRoll;
|
|
|
- private _cosRoll;
|
|
|
- private _sinPitch;
|
|
|
- private _cosPitch;
|
|
|
- private _sinYaw;
|
|
|
- private _cosYaw;
|
|
|
- private _w;
|
|
|
- constructor(name: string, scene: Scene, options?: {
|
|
|
- updatable?: boolean;
|
|
|
- isPickable?: 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(idx, 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;
|
|
|
- refreshVisibleSize(): void;
|
|
|
- isAlwaysVisible: boolean;
|
|
|
- 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 {
|
|
|
name: string;
|
|
|
initialize(iterations?: number): any;
|
|
@@ -6613,9 +6751,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-declare module BABYLON.Internals {
|
|
|
-}
|
|
|
-
|
|
|
declare module BABYLON {
|
|
|
class BaseTexture {
|
|
|
name: string;
|
|
@@ -6823,6 +6958,9 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+declare module BABYLON.Internals {
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON {
|
|
|
class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
|
private _world;
|