|
@@ -3317,6 +3317,10 @@ declare module BABYLON {
|
|
|
* Alpha blending mode used to apply the blur. Default is combine.
|
|
|
*/
|
|
|
alphaBlendingMode?: number;
|
|
|
+ /**
|
|
|
+ * The camera attached to the layer.
|
|
|
+ */
|
|
|
+ camera?: Camera;
|
|
|
}
|
|
|
/**
|
|
|
* The highlight layer Helps adding a glow effect around a mesh.
|
|
@@ -3358,6 +3362,7 @@ declare module BABYLON {
|
|
|
private _maxSize;
|
|
|
private _shouldRender;
|
|
|
private _instanceGlowingMeshStencilReference;
|
|
|
+ private _excludedMeshes;
|
|
|
/**
|
|
|
* Specifies whether or not the inner glow is ACTIVE in the layer.
|
|
|
*/
|
|
@@ -3367,10 +3372,6 @@ declare module BABYLON {
|
|
|
*/
|
|
|
outerGlow: boolean;
|
|
|
/**
|
|
|
- * Specifies the listof mesh excluded during the generation of the highlight layer.
|
|
|
- */
|
|
|
- excludedMeshes: Mesh[];
|
|
|
- /**
|
|
|
* Gets the horizontal size of the blur.
|
|
|
*/
|
|
|
/**
|
|
@@ -3385,6 +3386,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
blurVerticalSize: number;
|
|
|
/**
|
|
|
+ * Gets the camera attached to the layer.
|
|
|
+ */
|
|
|
+ camera: Camera;
|
|
|
+ /**
|
|
|
* An event triggered when the highlight layer has been disposed.
|
|
|
* @type {BABYLON.Observable}
|
|
|
*/
|
|
@@ -3443,6 +3448,16 @@ declare module BABYLON {
|
|
|
*/
|
|
|
render(): void;
|
|
|
/**
|
|
|
+ * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.
|
|
|
+ * @param mesh The mesh to exclude from the highlight layer
|
|
|
+ */
|
|
|
+ addExcludedMesh(mesh: Mesh): void;
|
|
|
+ /**
|
|
|
+ * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.
|
|
|
+ * @param mesh The mesh to highlight
|
|
|
+ */
|
|
|
+ removeExcludedMesh(mesh: Mesh): void;
|
|
|
+ /**
|
|
|
* Add a mesh in the highlight layer in order to make it glow with the chosen color.
|
|
|
* @param mesh The mesh to highlight
|
|
|
* @param color The color of the highlight
|
|
@@ -4660,7 +4675,7 @@ declare module BABYLON {
|
|
|
setMatrix(name: string, value: Matrix): ShaderMaterial;
|
|
|
setMatrix3x3(name: string, value: Float32Array): ShaderMaterial;
|
|
|
setMatrix2x2(name: string, value: Float32Array): ShaderMaterial;
|
|
|
- setVector3Array(name: string, value: number[]): ShaderMaterial;
|
|
|
+ setArray3(name: string, value: number[]): ShaderMaterial;
|
|
|
isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
bind(world: Matrix, mesh?: Mesh): void;
|
|
@@ -5639,7 +5654,7 @@ declare module BABYLON {
|
|
|
detachFromBone(): void;
|
|
|
isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsMesh(mesh: AbstractMesh, precise?: boolean): boolean;
|
|
|
+ intersectsMesh(mesh: AbstractMesh | SolidParticle, precise?: boolean): boolean;
|
|
|
intersectsPoint(point: Vector3): boolean;
|
|
|
/**
|
|
|
* @Deprecated. Use new PhysicsImpostor instead.
|
|
@@ -8343,9 +8358,12 @@ declare module BABYLON {
|
|
|
_model: ModelShape;
|
|
|
shapeId: number;
|
|
|
idxInShape: number;
|
|
|
- constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
+ _modelBoundingInfo: BoundingInfo;
|
|
|
+ _boundingInfo: BoundingInfo;
|
|
|
+ constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number, modelBoundingInfo?: BoundingInfo);
|
|
|
scale: Vector3;
|
|
|
quaternion: Quaternion;
|
|
|
+ intersectsMesh(target: Mesh | SolidParticle): boolean;
|
|
|
}
|
|
|
class ModelShape {
|
|
|
shapeID: number;
|
|
@@ -8466,16 +8484,20 @@ declare module BABYLON {
|
|
|
private _maximum;
|
|
|
private _scale;
|
|
|
private _translation;
|
|
|
+ private _particlesIntersect;
|
|
|
+ private _wm;
|
|
|
/**
|
|
|
* Creates a SPS (Solid Particle System) object.
|
|
|
* `name` (String) is the SPS name, this will be the underlying mesh name.
|
|
|
* `scene` (Scene) is the scene in which the SPS is added.
|
|
|
* `updatable` (default true) : if the SPS must be updatable or immutable.
|
|
|
* `isPickable` (default false) : if the solid particles must be pickable.
|
|
|
+ * `particleIntersection` (default false) : if the solid particle intersections must be computed
|
|
|
*/
|
|
|
constructor(name: string, scene: Scene, options?: {
|
|
|
updatable?: boolean;
|
|
|
isPickable?: boolean;
|
|
|
+ particleIntersection?: boolean;
|
|
|
});
|
|
|
/**
|
|
|
* Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
@@ -8500,7 +8522,7 @@ declare module BABYLON {
|
|
|
private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, meshNor, normals, idx, idxInShape, options);
|
|
|
private _posToShape(positions);
|
|
|
private _uvsToShapeUV(uvs);
|
|
|
- private _addParticle(idx, idxpos, model, shapeId, idxInShape);
|
|
|
+ private _addParticle(idx, idxpos, model, shapeId, idxInShape, bInfo?);
|
|
|
/**
|
|
|
* Adds some particles to the SPS from the model shape. Returns the shape id.
|
|
|
* Please read the doc : http://doc.babylonjs.com/overviews/Solid_Particle_System#create-an-immutable-sps
|
|
@@ -8655,6 +8677,237 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class BoundingBoxRenderer {
|
|
|
+ frontColor: Color3;
|
|
|
+ backColor: Color3;
|
|
|
+ showBackLines: boolean;
|
|
|
+ renderList: SmartArray<BoundingBox>;
|
|
|
+ private _scene;
|
|
|
+ private _colorShader;
|
|
|
+ private _vertexBuffers;
|
|
|
+ private _indexBuffer;
|
|
|
+ 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 EdgesRenderer {
|
|
|
+ edgesWidthScalerForOrthographic: number;
|
|
|
+ edgesWidthScalerForPerspective: number;
|
|
|
+ private _source;
|
|
|
+ private _linesPositions;
|
|
|
+ private _linesNormals;
|
|
|
+ private _linesIndices;
|
|
|
+ private _epsilon;
|
|
|
+ private _indicesCount;
|
|
|
+ private _lineShader;
|
|
|
+ private _ib;
|
|
|
+ private _buffers;
|
|
|
+ private _checkVerticesInsteadOfIndices;
|
|
|
+ constructor(source: AbstractMesh, epsilon?: number, checkVerticesInsteadOfIndices?: boolean);
|
|
|
+ private _prepareRessources();
|
|
|
+ dispose(): void;
|
|
|
+ private _processEdgeForAdjacencies(pa, pb, p0, p1, p2);
|
|
|
+ private _processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2);
|
|
|
+ private _checkEdge(faceIndex, edge, faceNormals, p0, p1);
|
|
|
+ _generateEdgesLines(): void;
|
|
|
+ render(): 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;
|
|
|
+ private _opaqueSortCompareFn;
|
|
|
+ private _alphaTestSortCompareFn;
|
|
|
+ private _transparentSortCompareFn;
|
|
|
+ private _renderOpaque;
|
|
|
+ private _renderAlphaTest;
|
|
|
+ private _renderTransparent;
|
|
|
+ onBeforeTransparentRendering: () => void;
|
|
|
+ /**
|
|
|
+ * Set the opaque sort comparison function.
|
|
|
+ * If null the sub meshes will be render in the order they were created
|
|
|
+ */
|
|
|
+ opaqueSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
+ /**
|
|
|
+ * Set the alpha test sort comparison function.
|
|
|
+ * If null the sub meshes will be render in the order they were created
|
|
|
+ */
|
|
|
+ alphaTestSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
+ /**
|
|
|
+ * Set the transparent sort comparison function.
|
|
|
+ * If null the sub meshes will be render in the order they were created
|
|
|
+ */
|
|
|
+ transparentSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
+ /**
|
|
|
+ * Creates a new rendering group.
|
|
|
+ * @param index The rendering group index
|
|
|
+ * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied
|
|
|
+ * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied
|
|
|
+ * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied
|
|
|
+ */
|
|
|
+ constructor(index: number, scene: Scene, opaqueSortCompareFn?: (a: SubMesh, b: SubMesh) => number, alphaTestSortCompareFn?: (a: SubMesh, b: SubMesh) => number, transparentSortCompareFn?: (a: SubMesh, b: SubMesh) => number);
|
|
|
+ /**
|
|
|
+ * Render all the sub meshes contained in the group.
|
|
|
+ * @param customRenderFunction Used to override the default render behaviour of the group.
|
|
|
+ * @returns true if rendered some submeshes.
|
|
|
+ */
|
|
|
+ render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
+ /**
|
|
|
+ * Renders the opaque submeshes in the order from the opaqueSortCompareFn.
|
|
|
+ * @param subMeshes The submeshes to render
|
|
|
+ */
|
|
|
+ private renderOpaqueSorted(subMeshes);
|
|
|
+ /**
|
|
|
+ * Renders the opaque submeshes in the order from the alphatestSortCompareFn.
|
|
|
+ * @param subMeshes The submeshes to render
|
|
|
+ */
|
|
|
+ private renderAlphaTestSorted(subMeshes);
|
|
|
+ /**
|
|
|
+ * Renders the opaque submeshes in the order from the transparentSortCompareFn.
|
|
|
+ * @param subMeshes The submeshes to render
|
|
|
+ */
|
|
|
+ private renderTransparentSorted(subMeshes);
|
|
|
+ /**
|
|
|
+ * Renders the submeshes in a specified order.
|
|
|
+ * @param subMeshes The submeshes to sort before render
|
|
|
+ * @param sortCompareFn The comparison function use to sort
|
|
|
+ * @param cameraPosition The camera position use to preprocess the submeshes to help sorting
|
|
|
+ * @param transparent Specifies to activate blending if true
|
|
|
+ */
|
|
|
+ private static renderSorted(subMeshes, sortCompareFn, cameraPosition, transparent);
|
|
|
+ /**
|
|
|
+ * Renders the submeshes in the order they were dispatched (no sort applied).
|
|
|
+ * @param subMeshes The submeshes to render
|
|
|
+ */
|
|
|
+ private static renderUnsorted(subMeshes);
|
|
|
+ /**
|
|
|
+ * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
+ * are rendered back to front if in the same alpha index.
|
|
|
+ *
|
|
|
+ * @param a The first submesh
|
|
|
+ * @param b The second submesh
|
|
|
+ * @returns The result of the comparison
|
|
|
+ */
|
|
|
+ static defaultTransparentSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
+ /**
|
|
|
+ * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
+ * are rendered back to front.
|
|
|
+ *
|
|
|
+ * @param a The first submesh
|
|
|
+ * @param b The second submesh
|
|
|
+ * @returns The result of the comparison
|
|
|
+ */
|
|
|
+ static backToFrontSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
+ /**
|
|
|
+ * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
+ * are rendered front to back (prevent overdraw).
|
|
|
+ *
|
|
|
+ * @param a The first submesh
|
|
|
+ * @param b The second submesh
|
|
|
+ * @returns The result of the comparison
|
|
|
+ */
|
|
|
+ static frontToBackSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
+ /**
|
|
|
+ * Resets the different lists of submeshes to prepare a new frame.
|
|
|
+ */
|
|
|
+ prepare(): void;
|
|
|
+ /**
|
|
|
+ * Inserts the submesh in its correct queue depending on its material.
|
|
|
+ * @param subMesh The submesh to dispatch
|
|
|
+ */
|
|
|
+ dispatch(subMesh: SubMesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class RenderingManager {
|
|
|
+ /**
|
|
|
+ * The max id used for rendering groups (not included)
|
|
|
+ */
|
|
|
+ static MAX_RENDERINGGROUPS: number;
|
|
|
+ /**
|
|
|
+ * The min id used for rendering groups (included)
|
|
|
+ */
|
|
|
+ static MIN_RENDERINGGROUPS: number;
|
|
|
+ private _scene;
|
|
|
+ private _renderingGroups;
|
|
|
+ private _depthStencilBufferAlreadyCleaned;
|
|
|
+ private _currentIndex;
|
|
|
+ private _currentActiveMeshes;
|
|
|
+ private _currentRenderParticles;
|
|
|
+ private _currentRenderSprites;
|
|
|
+ private _autoClearDepthStencil;
|
|
|
+ private _customOpaqueSortCompareFn;
|
|
|
+ private _customAlphaTestSortCompareFn;
|
|
|
+ private _customTransparentSortCompareFn;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ private _renderParticles(index, activeMeshes);
|
|
|
+ private _renderSprites(index);
|
|
|
+ private _clearDepthStencilBuffer();
|
|
|
+ private _renderSpritesAndParticles();
|
|
|
+ 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;
|
|
|
+ /**
|
|
|
+ * Overrides the default sort function applied in the renderging group to prepare the meshes.
|
|
|
+ * This allowed control for front to back rendering or reversly depending of the special needs.
|
|
|
+ *
|
|
|
+ * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
+ * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
|
|
|
+ * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
|
|
|
+ * @param transparentSortCompareFn The transparent queue comparison function use to sort.
|
|
|
+ */
|
|
|
+ setRenderingOrder(renderingGroupId: number, opaqueSortCompareFn?: (a: SubMesh, b: SubMesh) => number, alphaTestSortCompareFn?: (a: SubMesh, b: SubMesh) => number, transparentSortCompareFn?: (a: SubMesh, b: SubMesh) => number): void;
|
|
|
+ /**
|
|
|
+ * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
+ *
|
|
|
+ * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
+ * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
+ */
|
|
|
+ setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
|
private _passedProcess;
|
|
|
constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
@@ -9329,233 +9582,72 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class BoundingBoxRenderer {
|
|
|
- frontColor: Color3;
|
|
|
- backColor: Color3;
|
|
|
- showBackLines: boolean;
|
|
|
- renderList: SmartArray<BoundingBox>;
|
|
|
- private _scene;
|
|
|
- private _colorShader;
|
|
|
- private _vertexBuffers;
|
|
|
- private _indexBuffer;
|
|
|
- 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 EdgesRenderer {
|
|
|
- edgesWidthScalerForOrthographic: number;
|
|
|
- edgesWidthScalerForPerspective: number;
|
|
|
- private _source;
|
|
|
- private _linesPositions;
|
|
|
- private _linesNormals;
|
|
|
- private _linesIndices;
|
|
|
- private _epsilon;
|
|
|
- private _indicesCount;
|
|
|
- private _lineShader;
|
|
|
- private _ib;
|
|
|
- private _buffers;
|
|
|
- private _checkVerticesInsteadOfIndices;
|
|
|
- constructor(source: AbstractMesh, epsilon?: number, checkVerticesInsteadOfIndices?: boolean);
|
|
|
- private _prepareRessources();
|
|
|
+ class Sprite {
|
|
|
+ name: string;
|
|
|
+ position: Vector3;
|
|
|
+ color: Color4;
|
|
|
+ width: number;
|
|
|
+ height: number;
|
|
|
+ angle: number;
|
|
|
+ cellIndex: number;
|
|
|
+ invertU: number;
|
|
|
+ invertV: number;
|
|
|
+ disposeWhenFinishedAnimating: boolean;
|
|
|
+ animations: Animation[];
|
|
|
+ isPickable: boolean;
|
|
|
+ actionManager: ActionManager;
|
|
|
+ private _animationStarted;
|
|
|
+ private _loopAnimation;
|
|
|
+ private _fromIndex;
|
|
|
+ private _toIndex;
|
|
|
+ private _delay;
|
|
|
+ private _direction;
|
|
|
+ private _frameCount;
|
|
|
+ private _manager;
|
|
|
+ private _time;
|
|
|
+ private _onAnimationEnd;
|
|
|
+ size: number;
|
|
|
+ constructor(name: string, manager: SpriteManager);
|
|
|
+ playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: () => void): void;
|
|
|
+ stopAnimation(): void;
|
|
|
+ _animate(deltaTime: number): void;
|
|
|
dispose(): void;
|
|
|
- private _processEdgeForAdjacencies(pa, pb, p0, p1, p2);
|
|
|
- private _processEdgeForAdjacenciesWithVertices(pa, pb, p0, p1, p2);
|
|
|
- private _checkEdge(faceIndex, edge, faceNormals, p0, p1);
|
|
|
- _generateEdgesLines(): void;
|
|
|
- render(): 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;
|
|
|
- private _opaqueSortCompareFn;
|
|
|
- private _alphaTestSortCompareFn;
|
|
|
- private _transparentSortCompareFn;
|
|
|
- private _renderOpaque;
|
|
|
- private _renderAlphaTest;
|
|
|
- private _renderTransparent;
|
|
|
- onBeforeTransparentRendering: () => void;
|
|
|
- /**
|
|
|
- * Set the opaque sort comparison function.
|
|
|
- * If null the sub meshes will be render in the order they were created
|
|
|
- */
|
|
|
- opaqueSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
- /**
|
|
|
- * Set the alpha test sort comparison function.
|
|
|
- * If null the sub meshes will be render in the order they were created
|
|
|
- */
|
|
|
- alphaTestSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
- /**
|
|
|
- * Set the transparent sort comparison function.
|
|
|
- * If null the sub meshes will be render in the order they were created
|
|
|
- */
|
|
|
- transparentSortCompareFn: (a: SubMesh, b: SubMesh) => number;
|
|
|
- /**
|
|
|
- * Creates a new rendering group.
|
|
|
- * @param index The rendering group index
|
|
|
- * @param opaqueSortCompareFn The opaque sort comparison function. If null no order is applied
|
|
|
- * @param alphaTestSortCompareFn The alpha test sort comparison function. If null no order is applied
|
|
|
- * @param transparentSortCompareFn The transparent sort comparison function. If null back to front + alpha index sort is applied
|
|
|
- */
|
|
|
- constructor(index: number, scene: Scene, opaqueSortCompareFn?: (a: SubMesh, b: SubMesh) => number, alphaTestSortCompareFn?: (a: SubMesh, b: SubMesh) => number, transparentSortCompareFn?: (a: SubMesh, b: SubMesh) => number);
|
|
|
- /**
|
|
|
- * Render all the sub meshes contained in the group.
|
|
|
- * @param customRenderFunction Used to override the default render behaviour of the group.
|
|
|
- * @returns true if rendered some submeshes.
|
|
|
- */
|
|
|
- render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
- /**
|
|
|
- * Renders the opaque submeshes in the order from the opaqueSortCompareFn.
|
|
|
- * @param subMeshes The submeshes to render
|
|
|
- */
|
|
|
- private renderOpaqueSorted(subMeshes);
|
|
|
- /**
|
|
|
- * Renders the opaque submeshes in the order from the alphatestSortCompareFn.
|
|
|
- * @param subMeshes The submeshes to render
|
|
|
- */
|
|
|
- private renderAlphaTestSorted(subMeshes);
|
|
|
- /**
|
|
|
- * Renders the opaque submeshes in the order from the transparentSortCompareFn.
|
|
|
- * @param subMeshes The submeshes to render
|
|
|
- */
|
|
|
- private renderTransparentSorted(subMeshes);
|
|
|
- /**
|
|
|
- * Renders the submeshes in a specified order.
|
|
|
- * @param subMeshes The submeshes to sort before render
|
|
|
- * @param sortCompareFn The comparison function use to sort
|
|
|
- * @param cameraPosition The camera position use to preprocess the submeshes to help sorting
|
|
|
- * @param transparent Specifies to activate blending if true
|
|
|
- */
|
|
|
- private static renderSorted(subMeshes, sortCompareFn, cameraPosition, transparent);
|
|
|
- /**
|
|
|
- * Renders the submeshes in the order they were dispatched (no sort applied).
|
|
|
- * @param subMeshes The submeshes to render
|
|
|
- */
|
|
|
- private static renderUnsorted(subMeshes);
|
|
|
- /**
|
|
|
- * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
- * are rendered back to front if in the same alpha index.
|
|
|
- *
|
|
|
- * @param a The first submesh
|
|
|
- * @param b The second submesh
|
|
|
- * @returns The result of the comparison
|
|
|
- */
|
|
|
- static defaultTransparentSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
- /**
|
|
|
- * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
- * are rendered back to front.
|
|
|
- *
|
|
|
- * @param a The first submesh
|
|
|
- * @param b The second submesh
|
|
|
- * @returns The result of the comparison
|
|
|
- */
|
|
|
- static backToFrontSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
- /**
|
|
|
- * Build in function which can be applied to ensure meshes of a special queue (opaque, alpha test, transparent)
|
|
|
- * are rendered front to back (prevent overdraw).
|
|
|
- *
|
|
|
- * @param a The first submesh
|
|
|
- * @param b The second submesh
|
|
|
- * @returns The result of the comparison
|
|
|
- */
|
|
|
- static frontToBackSortCompare(a: SubMesh, b: SubMesh): number;
|
|
|
- /**
|
|
|
- * Resets the different lists of submeshes to prepare a new frame.
|
|
|
- */
|
|
|
- prepare(): void;
|
|
|
- /**
|
|
|
- * Inserts the submesh in its correct queue depending on its material.
|
|
|
- * @param subMesh The submesh to dispatch
|
|
|
- */
|
|
|
- dispatch(subMesh: SubMesh): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class RenderingManager {
|
|
|
- /**
|
|
|
- * The max id used for rendering groups (not included)
|
|
|
- */
|
|
|
- static MAX_RENDERINGGROUPS: number;
|
|
|
+ class SpriteManager {
|
|
|
+ name: string;
|
|
|
+ sprites: Sprite[];
|
|
|
+ renderingGroupId: number;
|
|
|
+ layerMask: number;
|
|
|
+ fogEnabled: boolean;
|
|
|
+ isPickable: boolean;
|
|
|
+ cellWidth: number;
|
|
|
+ cellHeight: number;
|
|
|
/**
|
|
|
- * The min id used for rendering groups (included)
|
|
|
- */
|
|
|
- static MIN_RENDERINGGROUPS: number;
|
|
|
+ * An event triggered when the manager is disposed.
|
|
|
+ * @type {BABYLON.Observable}
|
|
|
+ */
|
|
|
+ onDisposeObservable: Observable<SpriteManager>;
|
|
|
+ private _onDisposeObserver;
|
|
|
+ onDispose: () => void;
|
|
|
+ private _capacity;
|
|
|
+ private _spriteTexture;
|
|
|
+ private _epsilon;
|
|
|
private _scene;
|
|
|
- private _renderingGroups;
|
|
|
- private _depthStencilBufferAlreadyCleaned;
|
|
|
- private _currentIndex;
|
|
|
- private _currentActiveMeshes;
|
|
|
- private _currentRenderParticles;
|
|
|
- private _currentRenderSprites;
|
|
|
- private _autoClearDepthStencil;
|
|
|
- private _customOpaqueSortCompareFn;
|
|
|
- private _customAlphaTestSortCompareFn;
|
|
|
- private _customTransparentSortCompareFn;
|
|
|
- constructor(scene: Scene);
|
|
|
- private _renderParticles(index, activeMeshes);
|
|
|
- private _renderSprites(index);
|
|
|
- private _clearDepthStencilBuffer();
|
|
|
- private _renderSpritesAndParticles();
|
|
|
- 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;
|
|
|
- /**
|
|
|
- * Overrides the default sort function applied in the renderging group to prepare the meshes.
|
|
|
- * This allowed control for front to back rendering or reversly depending of the special needs.
|
|
|
- *
|
|
|
- * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
- * @param opaqueSortCompareFn The opaque queue comparison function use to sort.
|
|
|
- * @param alphaTestSortCompareFn The alpha test queue comparison function use to sort.
|
|
|
- * @param transparentSortCompareFn The transparent queue comparison function use to sort.
|
|
|
- */
|
|
|
- setRenderingOrder(renderingGroupId: number, opaqueSortCompareFn?: (a: SubMesh, b: SubMesh) => number, alphaTestSortCompareFn?: (a: SubMesh, b: SubMesh) => number, transparentSortCompareFn?: (a: SubMesh, b: SubMesh) => number): void;
|
|
|
- /**
|
|
|
- * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
- *
|
|
|
- * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
- * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
- */
|
|
|
- setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
+ private _vertexData;
|
|
|
+ private _buffer;
|
|
|
+ private _vertexBuffers;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _effectBase;
|
|
|
+ private _effectFog;
|
|
|
+ texture: Texture;
|
|
|
+ constructor(name: string, imgUrl: string, capacity: number, cellSize: any, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
+ private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
+ intersects(ray: Ray, camera: Camera, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean): PickingInfo;
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -9628,76 +9720,6 @@ declare module BABYLON.Internals {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-declare module BABYLON {
|
|
|
- class Sprite {
|
|
|
- name: string;
|
|
|
- position: Vector3;
|
|
|
- color: Color4;
|
|
|
- width: number;
|
|
|
- height: number;
|
|
|
- angle: number;
|
|
|
- cellIndex: number;
|
|
|
- invertU: number;
|
|
|
- invertV: number;
|
|
|
- disposeWhenFinishedAnimating: boolean;
|
|
|
- animations: Animation[];
|
|
|
- isPickable: boolean;
|
|
|
- actionManager: ActionManager;
|
|
|
- private _animationStarted;
|
|
|
- private _loopAnimation;
|
|
|
- private _fromIndex;
|
|
|
- private _toIndex;
|
|
|
- private _delay;
|
|
|
- private _direction;
|
|
|
- private _frameCount;
|
|
|
- private _manager;
|
|
|
- private _time;
|
|
|
- private _onAnimationEnd;
|
|
|
- size: number;
|
|
|
- constructor(name: string, manager: SpriteManager);
|
|
|
- playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: () => void): void;
|
|
|
- stopAnimation(): void;
|
|
|
- _animate(deltaTime: number): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class SpriteManager {
|
|
|
- name: string;
|
|
|
- sprites: Sprite[];
|
|
|
- renderingGroupId: number;
|
|
|
- layerMask: number;
|
|
|
- fogEnabled: boolean;
|
|
|
- isPickable: boolean;
|
|
|
- cellWidth: number;
|
|
|
- cellHeight: number;
|
|
|
- /**
|
|
|
- * An event triggered when the manager is disposed.
|
|
|
- * @type {BABYLON.Observable}
|
|
|
- */
|
|
|
- onDisposeObservable: Observable<SpriteManager>;
|
|
|
- private _onDisposeObserver;
|
|
|
- onDispose: () => void;
|
|
|
- private _capacity;
|
|
|
- private _spriteTexture;
|
|
|
- private _epsilon;
|
|
|
- private _scene;
|
|
|
- private _vertexData;
|
|
|
- private _buffer;
|
|
|
- private _vertexBuffers;
|
|
|
- private _indexBuffer;
|
|
|
- private _effectBase;
|
|
|
- private _effectFog;
|
|
|
- texture: Texture;
|
|
|
- constructor(name: string, imgUrl: string, capacity: number, cellSize: any, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
- private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
- intersects(ray: Ray, camera: Camera, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean): PickingInfo;
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
declare module BABYLON.Internals {
|
|
|
class AndOrNotEvaluator {
|
|
|
static Eval(query: string, evaluateCallback: (val: any) => boolean): boolean;
|