|
@@ -3440,6 +3440,123 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingBox implements ICullable {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ vectors: Vector3[];
|
|
|
+ center: Vector3;
|
|
|
+ extendSize: Vector3;
|
|
|
+ directions: Vector3[];
|
|
|
+ vectorsWorld: Vector3[];
|
|
|
+ minimumWorld: Vector3;
|
|
|
+ maximumWorld: Vector3;
|
|
|
+ private _worldMatrix;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ getWorldMatrix(): Matrix;
|
|
|
+ setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
+ intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
+ static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
+ static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
+ static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ interface ICullable {
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ }
|
|
|
+ class BoundingInfo implements ICullable {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ boundingBox: BoundingBox;
|
|
|
+ boundingSphere: BoundingSphere;
|
|
|
+ private _isLocked;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ isLocked: boolean;
|
|
|
+ update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ _checkCollision(collider: Collider): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingSphere {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ center: Vector3;
|
|
|
+ radius: number;
|
|
|
+ centerWorld: Vector3;
|
|
|
+ radiusWorld: number;
|
|
|
+ private _tempRadiusVector;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class Ray {
|
|
|
+ origin: Vector3;
|
|
|
+ direction: Vector3;
|
|
|
+ length: number;
|
|
|
+ private _edge1;
|
|
|
+ private _edge2;
|
|
|
+ private _pvec;
|
|
|
+ private _tvec;
|
|
|
+ private _qvec;
|
|
|
+ private _renderPoints;
|
|
|
+ private _renderLine;
|
|
|
+ private _renderFunction;
|
|
|
+ private _scene;
|
|
|
+ private _show;
|
|
|
+ private _tmpRay;
|
|
|
+ constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
+ intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
+ intersectsBox(box: BoundingBox): boolean;
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
+ intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
+ intersectsPlane(plane: Plane): number;
|
|
|
+ intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
+ show(scene: Scene, color: Color3): void;
|
|
|
+ hide(): void;
|
|
|
+ private _render();
|
|
|
+ private static smallnum;
|
|
|
+ private static rayl;
|
|
|
+ /**
|
|
|
+ * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
+ * @param sega the first point of the segment to test the intersection against
|
|
|
+ * @param segb the second point of the segment to test the intersection against
|
|
|
+ * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
+ * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
+ */
|
|
|
+ intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
+ static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
+ /**
|
|
|
+ * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
+ * transformed to the given world matrix.
|
|
|
+ * @param origin The origin point
|
|
|
+ * @param end The end point
|
|
|
+ * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
+ */
|
|
|
+ static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
+ static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
+ static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON.Debug {
|
|
|
class AxesViewer {
|
|
|
private _xline;
|
|
@@ -3763,168 +3880,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class BoundingBox implements ICullable {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- vectors: Vector3[];
|
|
|
- center: Vector3;
|
|
|
- extendSize: Vector3;
|
|
|
- directions: Vector3[];
|
|
|
- vectorsWorld: Vector3[];
|
|
|
- minimumWorld: Vector3;
|
|
|
- maximumWorld: Vector3;
|
|
|
- private _worldMatrix;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- getWorldMatrix(): Matrix;
|
|
|
- setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
- intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
- static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
- static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
- static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
- static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- interface ICullable {
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- }
|
|
|
- class BoundingInfo implements ICullable {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- boundingBox: BoundingBox;
|
|
|
- boundingSphere: BoundingSphere;
|
|
|
- private _isLocked;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- isLocked: boolean;
|
|
|
- update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- _checkCollision(collider: Collider): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class BoundingSphere {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- center: Vector3;
|
|
|
- radius: number;
|
|
|
- centerWorld: Vector3;
|
|
|
- radiusWorld: number;
|
|
|
- private _tempRadiusVector;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class Ray {
|
|
|
- origin: Vector3;
|
|
|
- direction: Vector3;
|
|
|
- length: number;
|
|
|
- private _edge1;
|
|
|
- private _edge2;
|
|
|
- private _pvec;
|
|
|
- private _tvec;
|
|
|
- private _qvec;
|
|
|
- private _renderPoints;
|
|
|
- private _renderLine;
|
|
|
- private _renderFunction;
|
|
|
- private _scene;
|
|
|
- private _show;
|
|
|
- private _tmpRay;
|
|
|
- constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
- intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
- intersectsBox(box: BoundingBox): boolean;
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
- intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
- intersectsPlane(plane: Plane): number;
|
|
|
- intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
- show(scene: Scene, color: Color3): void;
|
|
|
- hide(): void;
|
|
|
- private _render();
|
|
|
- private static smallnum;
|
|
|
- private static rayl;
|
|
|
- /**
|
|
|
- * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
- * @param sega the first point of the segment to test the intersection against
|
|
|
- * @param segb the second point of the segment to test the intersection against
|
|
|
- * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
- * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
- */
|
|
|
- intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
- static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
- /**
|
|
|
- * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
- * transformed to the given world matrix.
|
|
|
- * @param origin The origin point
|
|
|
- * @param end The end point
|
|
|
- * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
- */
|
|
|
- static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
- static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
- static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class LensFlare {
|
|
|
- size: number;
|
|
|
- position: number;
|
|
|
- color: Color3;
|
|
|
- texture: Texture;
|
|
|
- alphaMode: number;
|
|
|
- private _system;
|
|
|
- constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
|
|
|
- dispose: () => void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class LensFlareSystem {
|
|
|
- name: string;
|
|
|
- lensFlares: LensFlare[];
|
|
|
- borderLimit: number;
|
|
|
- viewportBorder: number;
|
|
|
- meshesSelectionPredicate: (mesh: Mesh) => boolean;
|
|
|
- layerMask: number;
|
|
|
- id: string;
|
|
|
- private _scene;
|
|
|
- private _emitter;
|
|
|
- private _vertexBuffers;
|
|
|
- private _indexBuffer;
|
|
|
- private _effect;
|
|
|
- private _positionX;
|
|
|
- private _positionY;
|
|
|
- private _isEnabled;
|
|
|
- constructor(name: string, emitter: any, scene: Scene);
|
|
|
- isEnabled: boolean;
|
|
|
- getScene(): Scene;
|
|
|
- getEmitter(): any;
|
|
|
- setEmitter(newEmitter: any): void;
|
|
|
- getEmitterPosition(): Vector3;
|
|
|
- computeEffectivePosition(globalViewport: Viewport): boolean;
|
|
|
- _isVisible(): boolean;
|
|
|
- render(): boolean;
|
|
|
- dispose(): void;
|
|
|
- static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
|
|
|
- serialize(): any;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class DirectionalLight extends Light implements IShadowLight {
|
|
|
position: Vector3;
|
|
|
direction: Vector3;
|
|
@@ -4083,6 +4038,51 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class LensFlare {
|
|
|
+ size: number;
|
|
|
+ position: number;
|
|
|
+ color: Color3;
|
|
|
+ texture: Texture;
|
|
|
+ alphaMode: number;
|
|
|
+ private _system;
|
|
|
+ constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
|
|
|
+ dispose: () => void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class LensFlareSystem {
|
|
|
+ name: string;
|
|
|
+ lensFlares: LensFlare[];
|
|
|
+ borderLimit: number;
|
|
|
+ viewportBorder: number;
|
|
|
+ meshesSelectionPredicate: (mesh: Mesh) => boolean;
|
|
|
+ layerMask: number;
|
|
|
+ id: string;
|
|
|
+ private _scene;
|
|
|
+ private _emitter;
|
|
|
+ private _vertexBuffers;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _effect;
|
|
|
+ private _positionX;
|
|
|
+ private _positionY;
|
|
|
+ private _isEnabled;
|
|
|
+ constructor(name: string, emitter: any, scene: Scene);
|
|
|
+ isEnabled: boolean;
|
|
|
+ getScene(): Scene;
|
|
|
+ getEmitter(): any;
|
|
|
+ setEmitter(newEmitter: any): void;
|
|
|
+ getEmitterPosition(): Vector3;
|
|
|
+ computeEffectivePosition(globalViewport: Viewport): boolean;
|
|
|
+ _isVisible(): boolean;
|
|
|
+ render(): boolean;
|
|
|
+ dispose(): void;
|
|
|
+ static Parse(parsedLensFlareSystem: any, scene: Scene, rootUrl: string): LensFlareSystem;
|
|
|
+ serialize(): any;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
interface ISceneLoaderPluginExtensions {
|
|
|
[extension: string]: {
|
|
|
isBinary: boolean;
|
|
@@ -8952,262 +8952,8 @@ declare module BABYLON {
|
|
|
}
|
|
|
interface SpringJointData extends PhysicsJointData {
|
|
|
length: number;
|
|
|
- stiffness: number;
|
|
|
- damping: number;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ReflectionProbe {
|
|
|
- name: string;
|
|
|
- private _scene;
|
|
|
- private _renderTargetTexture;
|
|
|
- private _projectionMatrix;
|
|
|
- private _viewMatrix;
|
|
|
- private _target;
|
|
|
- private _add;
|
|
|
- private _attachedMesh;
|
|
|
- invertYAxis: boolean;
|
|
|
- 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 {
|
|
|
- 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;
|
|
|
- private _renderinGroupInfo;
|
|
|
- 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;
|
|
|
+ stiffness: number;
|
|
|
+ damping: number;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -9887,6 +9633,260 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class ReflectionProbe {
|
|
|
+ name: string;
|
|
|
+ private _scene;
|
|
|
+ private _renderTargetTexture;
|
|
|
+ private _projectionMatrix;
|
|
|
+ private _viewMatrix;
|
|
|
+ private _target;
|
|
|
+ private _add;
|
|
|
+ private _attachedMesh;
|
|
|
+ invertYAxis: boolean;
|
|
|
+ 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 {
|
|
|
+ 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;
|
|
|
+ private _renderinGroupInfo;
|
|
|
+ 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 Sprite {
|
|
|
name: string;
|
|
|
position: Vector3;
|