|
@@ -110,10 +110,7 @@ declare module BABYLON {
|
|
|
private _caps;
|
|
|
private _pointerLockRequested;
|
|
|
private _alphaTest;
|
|
|
- private _resizeLoadingUI;
|
|
|
- private _loadingDiv;
|
|
|
- private _loadingTextDiv;
|
|
|
- private _loadingDivBackgroundColor;
|
|
|
+ private _loadingScreen;
|
|
|
private _drawCalls;
|
|
|
private _glVersion;
|
|
|
private _glRenderer;
|
|
@@ -285,9 +282,10 @@ declare module BABYLON {
|
|
|
readPixels(x: number, y: number, width: number, height: number): Uint8Array;
|
|
|
dispose(): void;
|
|
|
displayLoadingUI(): void;
|
|
|
+ hideLoadingUI(): void;
|
|
|
+ loadingScreen: ILoadingScreen;
|
|
|
loadingUIText: string;
|
|
|
loadingUIBackgroundColor: string;
|
|
|
- hideLoadingUI(): void;
|
|
|
getFps(): number;
|
|
|
getDeltaTime(): number;
|
|
|
private _measureFps();
|
|
@@ -1525,244 +1523,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Collider {
|
|
|
- radius: Vector3;
|
|
|
- retry: number;
|
|
|
- velocity: Vector3;
|
|
|
- basePoint: Vector3;
|
|
|
- epsilon: number;
|
|
|
- collisionFound: boolean;
|
|
|
- velocityWorldLength: number;
|
|
|
- basePointWorld: Vector3;
|
|
|
- velocityWorld: Vector3;
|
|
|
- normalizedVelocity: Vector3;
|
|
|
- initialVelocity: Vector3;
|
|
|
- initialPosition: Vector3;
|
|
|
- nearestDistance: number;
|
|
|
- intersectionPoint: Vector3;
|
|
|
- collidedMesh: AbstractMesh;
|
|
|
- private _collisionPoint;
|
|
|
- private _planeIntersectionPoint;
|
|
|
- private _tempVector;
|
|
|
- private _tempVector2;
|
|
|
- private _tempVector3;
|
|
|
- private _tempVector4;
|
|
|
- private _edge;
|
|
|
- private _baseToVertex;
|
|
|
- private _destinationPoint;
|
|
|
- private _slidePlaneNormal;
|
|
|
- private _displacementVector;
|
|
|
- _initialize(source: Vector3, dir: Vector3, e: number): void;
|
|
|
- _checkPointInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean;
|
|
|
- _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean;
|
|
|
- _testTriangle(faceIndex: number, trianglePlaneArray: Array<Plane>, p1: Vector3, p2: Vector3, p3: Vector3, hasMaterial: boolean): void;
|
|
|
- _collide(trianglePlaneArray: Array<Plane>, pts: Vector3[], indices: number[], indexStart: number, indexEnd: number, decal: number, hasMaterial: boolean): void;
|
|
|
- _getResponse(pos: Vector3, vel: Vector3): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- var CollisionWorker: string;
|
|
|
- interface ICollisionCoordinator {
|
|
|
- getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
- init(scene: Scene): void;
|
|
|
- destroy(): void;
|
|
|
- onMeshAdded(mesh: AbstractMesh): any;
|
|
|
- onMeshUpdated(mesh: AbstractMesh): any;
|
|
|
- onMeshRemoved(mesh: AbstractMesh): any;
|
|
|
- onGeometryAdded(geometry: Geometry): any;
|
|
|
- onGeometryUpdated(geometry: Geometry): any;
|
|
|
- onGeometryDeleted(geometry: Geometry): any;
|
|
|
- }
|
|
|
- interface SerializedMesh {
|
|
|
- id: string;
|
|
|
- name: string;
|
|
|
- uniqueId: number;
|
|
|
- geometryId: string;
|
|
|
- sphereCenter: Array<number>;
|
|
|
- sphereRadius: number;
|
|
|
- boxMinimum: Array<number>;
|
|
|
- boxMaximum: Array<number>;
|
|
|
- worldMatrixFromCache: any;
|
|
|
- subMeshes: Array<SerializedSubMesh>;
|
|
|
- checkCollisions: boolean;
|
|
|
- }
|
|
|
- interface SerializedSubMesh {
|
|
|
- position: number;
|
|
|
- verticesStart: number;
|
|
|
- verticesCount: number;
|
|
|
- indexStart: number;
|
|
|
- indexCount: number;
|
|
|
- hasMaterial: boolean;
|
|
|
- sphereCenter: Array<number>;
|
|
|
- sphereRadius: number;
|
|
|
- boxMinimum: Array<number>;
|
|
|
- boxMaximum: Array<number>;
|
|
|
- }
|
|
|
- interface SerializedGeometry {
|
|
|
- id: string;
|
|
|
- positions: Float32Array;
|
|
|
- indices: Int32Array;
|
|
|
- normals: Float32Array;
|
|
|
- }
|
|
|
- interface BabylonMessage {
|
|
|
- taskType: WorkerTaskType;
|
|
|
- payload: InitPayload | CollidePayload | UpdatePayload;
|
|
|
- }
|
|
|
- interface SerializedColliderToWorker {
|
|
|
- position: Array<number>;
|
|
|
- velocity: Array<number>;
|
|
|
- radius: Array<number>;
|
|
|
- }
|
|
|
- enum WorkerTaskType {
|
|
|
- INIT = 0,
|
|
|
- UPDATE = 1,
|
|
|
- COLLIDE = 2,
|
|
|
- }
|
|
|
- interface WorkerReply {
|
|
|
- error: WorkerReplyType;
|
|
|
- taskType: WorkerTaskType;
|
|
|
- payload?: any;
|
|
|
- }
|
|
|
- interface CollisionReplyPayload {
|
|
|
- newPosition: Array<number>;
|
|
|
- collisionId: number;
|
|
|
- collidedMeshUniqueId: number;
|
|
|
- }
|
|
|
- interface InitPayload {
|
|
|
- }
|
|
|
- interface CollidePayload {
|
|
|
- collisionId: number;
|
|
|
- collider: SerializedColliderToWorker;
|
|
|
- maximumRetry: number;
|
|
|
- excludedMeshUniqueId?: number;
|
|
|
- }
|
|
|
- interface UpdatePayload {
|
|
|
- updatedMeshes: {
|
|
|
- [n: number]: SerializedMesh;
|
|
|
- };
|
|
|
- updatedGeometries: {
|
|
|
- [s: string]: SerializedGeometry;
|
|
|
- };
|
|
|
- removedMeshes: Array<number>;
|
|
|
- removedGeometries: Array<string>;
|
|
|
- }
|
|
|
- enum WorkerReplyType {
|
|
|
- SUCCESS = 0,
|
|
|
- UNKNOWN_ERROR = 1,
|
|
|
- }
|
|
|
- class CollisionCoordinatorWorker implements ICollisionCoordinator {
|
|
|
- private _scene;
|
|
|
- private _scaledPosition;
|
|
|
- private _scaledVelocity;
|
|
|
- private _collisionsCallbackArray;
|
|
|
- private _init;
|
|
|
- private _runningUpdated;
|
|
|
- private _runningCollisionTask;
|
|
|
- private _worker;
|
|
|
- private _addUpdateMeshesList;
|
|
|
- private _addUpdateGeometriesList;
|
|
|
- private _toRemoveMeshesArray;
|
|
|
- private _toRemoveGeometryArray;
|
|
|
- constructor();
|
|
|
- static SerializeMesh: (mesh: AbstractMesh) => SerializedMesh;
|
|
|
- static SerializeGeometry: (geometry: Geometry) => SerializedGeometry;
|
|
|
- getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
- init(scene: Scene): void;
|
|
|
- destroy(): void;
|
|
|
- onMeshAdded(mesh: AbstractMesh): void;
|
|
|
- onMeshUpdated: (mesh: AbstractMesh) => void;
|
|
|
- onMeshRemoved(mesh: AbstractMesh): void;
|
|
|
- onGeometryAdded(geometry: Geometry): void;
|
|
|
- onGeometryUpdated: (geometry: Geometry) => void;
|
|
|
- onGeometryDeleted(geometry: Geometry): void;
|
|
|
- private _afterRender;
|
|
|
- private _onMessageFromWorker;
|
|
|
- }
|
|
|
- class CollisionCoordinatorLegacy implements ICollisionCoordinator {
|
|
|
- private _scene;
|
|
|
- private _scaledPosition;
|
|
|
- private _scaledVelocity;
|
|
|
- private _finalPosition;
|
|
|
- getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
- init(scene: Scene): void;
|
|
|
- destroy(): void;
|
|
|
- onMeshAdded(mesh: AbstractMesh): void;
|
|
|
- onMeshUpdated(mesh: AbstractMesh): void;
|
|
|
- onMeshRemoved(mesh: AbstractMesh): void;
|
|
|
- onGeometryAdded(geometry: Geometry): void;
|
|
|
- onGeometryUpdated(geometry: Geometry): void;
|
|
|
- onGeometryDeleted(geometry: Geometry): void;
|
|
|
- private _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh?);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- var WorkerIncluded: boolean;
|
|
|
- class CollisionCache {
|
|
|
- private _meshes;
|
|
|
- private _geometries;
|
|
|
- getMeshes(): {
|
|
|
- [n: number]: SerializedMesh;
|
|
|
- };
|
|
|
- getGeometries(): {
|
|
|
- [s: number]: SerializedGeometry;
|
|
|
- };
|
|
|
- getMesh(id: any): SerializedMesh;
|
|
|
- addMesh(mesh: SerializedMesh): void;
|
|
|
- getGeometry(id: string): SerializedGeometry;
|
|
|
- addGeometry(geometry: SerializedGeometry): void;
|
|
|
- }
|
|
|
- class CollideWorker {
|
|
|
- collider: Collider;
|
|
|
- private _collisionCache;
|
|
|
- private finalPosition;
|
|
|
- private collisionsScalingMatrix;
|
|
|
- private collisionTranformationMatrix;
|
|
|
- constructor(collider: Collider, _collisionCache: CollisionCache, finalPosition: Vector3);
|
|
|
- collideWithWorld(position: Vector3, velocity: Vector3, maximumRetry: number, excludedMeshUniqueId?: number): void;
|
|
|
- private checkCollision(mesh);
|
|
|
- private processCollisionsForSubMeshes(transformMatrix, mesh);
|
|
|
- private collideForSubMesh(subMesh, transformMatrix, meshGeometry);
|
|
|
- private checkSubmeshCollision(subMesh);
|
|
|
- }
|
|
|
- interface ICollisionDetector {
|
|
|
- onInit(payload: InitPayload): void;
|
|
|
- onUpdate(payload: UpdatePayload): void;
|
|
|
- onCollision(payload: CollidePayload): void;
|
|
|
- }
|
|
|
- class CollisionDetectorTransferable implements ICollisionDetector {
|
|
|
- private _collisionCache;
|
|
|
- onInit(payload: InitPayload): void;
|
|
|
- onUpdate(payload: UpdatePayload): void;
|
|
|
- onCollision(payload: CollidePayload): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class IntersectionInfo {
|
|
|
- bu: number;
|
|
|
- bv: number;
|
|
|
- distance: number;
|
|
|
- faceId: number;
|
|
|
- subMeshId: number;
|
|
|
- constructor(bu: number, bv: number, distance: number);
|
|
|
- }
|
|
|
- class PickingInfo {
|
|
|
- hit: boolean;
|
|
|
- distance: number;
|
|
|
- pickedPoint: Vector3;
|
|
|
- pickedMesh: AbstractMesh;
|
|
|
- bu: number;
|
|
|
- bv: number;
|
|
|
- faceId: number;
|
|
|
- subMeshId: number;
|
|
|
- getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
- getTextureCoordinates(): Vector2;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class ArcRotateCamera extends TargetCamera {
|
|
|
alpha: number;
|
|
|
beta: number;
|
|
@@ -2154,81 +1914,240 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Layer {
|
|
|
- name: string;
|
|
|
- texture: Texture;
|
|
|
- isBackground: boolean;
|
|
|
- color: Color4;
|
|
|
- onDispose: () => void;
|
|
|
- private _scene;
|
|
|
- private _vertexDeclaration;
|
|
|
- private _vertexStrideSize;
|
|
|
- private _vertexBuffer;
|
|
|
- private _indexBuffer;
|
|
|
- private _effect;
|
|
|
- constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4);
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
+ class Collider {
|
|
|
+ radius: Vector3;
|
|
|
+ retry: number;
|
|
|
+ velocity: Vector3;
|
|
|
+ basePoint: Vector3;
|
|
|
+ epsilon: number;
|
|
|
+ collisionFound: boolean;
|
|
|
+ velocityWorldLength: number;
|
|
|
+ basePointWorld: Vector3;
|
|
|
+ velocityWorld: Vector3;
|
|
|
+ normalizedVelocity: Vector3;
|
|
|
+ initialVelocity: Vector3;
|
|
|
+ initialPosition: Vector3;
|
|
|
+ nearestDistance: number;
|
|
|
+ intersectionPoint: Vector3;
|
|
|
+ collidedMesh: AbstractMesh;
|
|
|
+ private _collisionPoint;
|
|
|
+ private _planeIntersectionPoint;
|
|
|
+ private _tempVector;
|
|
|
+ private _tempVector2;
|
|
|
+ private _tempVector3;
|
|
|
+ private _tempVector4;
|
|
|
+ private _edge;
|
|
|
+ private _baseToVertex;
|
|
|
+ private _destinationPoint;
|
|
|
+ private _slidePlaneNormal;
|
|
|
+ private _displacementVector;
|
|
|
+ _initialize(source: Vector3, dir: Vector3, e: number): void;
|
|
|
+ _checkPointInTriangle(point: Vector3, pa: Vector3, pb: Vector3, pc: Vector3, n: Vector3): boolean;
|
|
|
+ _canDoCollision(sphereCenter: Vector3, sphereRadius: number, vecMin: Vector3, vecMax: Vector3): boolean;
|
|
|
+ _testTriangle(faceIndex: number, trianglePlaneArray: Array<Plane>, p1: Vector3, p2: Vector3, p3: Vector3, hasMaterial: boolean): void;
|
|
|
+ _collide(trianglePlaneArray: Array<Plane>, pts: Vector3[], indices: number[], indexStart: number, indexEnd: number, decal: number, hasMaterial: boolean): void;
|
|
|
+ _getResponse(pos: Vector3, vel: Vector3): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class BoundingBox {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- vectors: Vector3[];
|
|
|
- center: Vector3;
|
|
|
- extendSize: Vector3;
|
|
|
- directions: Vector3[];
|
|
|
- vectorsWorld: Vector3[];
|
|
|
- minimumWorld: Vector3;
|
|
|
- maximumWorld: Vector3;
|
|
|
- private _worldMatrix;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- getWorldMatrix(): Matrix;
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
- intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
- static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
- static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
- static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
- static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ var CollisionWorker: string;
|
|
|
+ interface ICollisionCoordinator {
|
|
|
+ getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
+ init(scene: Scene): void;
|
|
|
+ destroy(): void;
|
|
|
+ onMeshAdded(mesh: AbstractMesh): any;
|
|
|
+ onMeshUpdated(mesh: AbstractMesh): any;
|
|
|
+ onMeshRemoved(mesh: AbstractMesh): any;
|
|
|
+ onGeometryAdded(geometry: Geometry): any;
|
|
|
+ onGeometryUpdated(geometry: Geometry): any;
|
|
|
+ onGeometryDeleted(geometry: Geometry): any;
|
|
|
+ }
|
|
|
+ interface SerializedMesh {
|
|
|
+ id: string;
|
|
|
+ name: string;
|
|
|
+ uniqueId: number;
|
|
|
+ geometryId: string;
|
|
|
+ sphereCenter: Array<number>;
|
|
|
+ sphereRadius: number;
|
|
|
+ boxMinimum: Array<number>;
|
|
|
+ boxMaximum: Array<number>;
|
|
|
+ worldMatrixFromCache: any;
|
|
|
+ subMeshes: Array<SerializedSubMesh>;
|
|
|
+ checkCollisions: boolean;
|
|
|
+ }
|
|
|
+ interface SerializedSubMesh {
|
|
|
+ position: number;
|
|
|
+ verticesStart: number;
|
|
|
+ verticesCount: number;
|
|
|
+ indexStart: number;
|
|
|
+ indexCount: number;
|
|
|
+ hasMaterial: boolean;
|
|
|
+ sphereCenter: Array<number>;
|
|
|
+ sphereRadius: number;
|
|
|
+ boxMinimum: Array<number>;
|
|
|
+ boxMaximum: Array<number>;
|
|
|
+ }
|
|
|
+ interface SerializedGeometry {
|
|
|
+ id: string;
|
|
|
+ positions: Float32Array;
|
|
|
+ indices: Int32Array;
|
|
|
+ normals: Float32Array;
|
|
|
+ }
|
|
|
+ interface BabylonMessage {
|
|
|
+ taskType: WorkerTaskType;
|
|
|
+ payload: InitPayload | CollidePayload | UpdatePayload;
|
|
|
+ }
|
|
|
+ interface SerializedColliderToWorker {
|
|
|
+ position: Array<number>;
|
|
|
+ velocity: Array<number>;
|
|
|
+ radius: Array<number>;
|
|
|
+ }
|
|
|
+ enum WorkerTaskType {
|
|
|
+ INIT = 0,
|
|
|
+ UPDATE = 1,
|
|
|
+ COLLIDE = 2,
|
|
|
+ }
|
|
|
+ interface WorkerReply {
|
|
|
+ error: WorkerReplyType;
|
|
|
+ taskType: WorkerTaskType;
|
|
|
+ payload?: any;
|
|
|
+ }
|
|
|
+ interface CollisionReplyPayload {
|
|
|
+ newPosition: Array<number>;
|
|
|
+ collisionId: number;
|
|
|
+ collidedMeshUniqueId: number;
|
|
|
+ }
|
|
|
+ interface InitPayload {
|
|
|
+ }
|
|
|
+ interface CollidePayload {
|
|
|
+ collisionId: number;
|
|
|
+ collider: SerializedColliderToWorker;
|
|
|
+ maximumRetry: number;
|
|
|
+ excludedMeshUniqueId?: number;
|
|
|
+ }
|
|
|
+ interface UpdatePayload {
|
|
|
+ updatedMeshes: {
|
|
|
+ [n: number]: SerializedMesh;
|
|
|
+ };
|
|
|
+ updatedGeometries: {
|
|
|
+ [s: string]: SerializedGeometry;
|
|
|
+ };
|
|
|
+ removedMeshes: Array<number>;
|
|
|
+ removedGeometries: Array<string>;
|
|
|
+ }
|
|
|
+ enum WorkerReplyType {
|
|
|
+ SUCCESS = 0,
|
|
|
+ UNKNOWN_ERROR = 1,
|
|
|
+ }
|
|
|
+ class CollisionCoordinatorWorker implements ICollisionCoordinator {
|
|
|
+ private _scene;
|
|
|
+ private _scaledPosition;
|
|
|
+ private _scaledVelocity;
|
|
|
+ private _collisionsCallbackArray;
|
|
|
+ private _init;
|
|
|
+ private _runningUpdated;
|
|
|
+ private _runningCollisionTask;
|
|
|
+ private _worker;
|
|
|
+ private _addUpdateMeshesList;
|
|
|
+ private _addUpdateGeometriesList;
|
|
|
+ private _toRemoveMeshesArray;
|
|
|
+ private _toRemoveGeometryArray;
|
|
|
+ constructor();
|
|
|
+ static SerializeMesh: (mesh: AbstractMesh) => SerializedMesh;
|
|
|
+ static SerializeGeometry: (geometry: Geometry) => SerializedGeometry;
|
|
|
+ getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
+ init(scene: Scene): void;
|
|
|
+ destroy(): void;
|
|
|
+ onMeshAdded(mesh: AbstractMesh): void;
|
|
|
+ onMeshUpdated: (mesh: AbstractMesh) => void;
|
|
|
+ onMeshRemoved(mesh: AbstractMesh): void;
|
|
|
+ onGeometryAdded(geometry: Geometry): void;
|
|
|
+ onGeometryUpdated: (geometry: Geometry) => void;
|
|
|
+ onGeometryDeleted(geometry: Geometry): void;
|
|
|
+ private _afterRender;
|
|
|
+ private _onMessageFromWorker;
|
|
|
+ }
|
|
|
+ class CollisionCoordinatorLegacy implements ICollisionCoordinator {
|
|
|
+ private _scene;
|
|
|
+ private _scaledPosition;
|
|
|
+ private _scaledVelocity;
|
|
|
+ private _finalPosition;
|
|
|
+ getNewPosition(position: Vector3, velocity: Vector3, collider: Collider, maximumRetry: number, excludedMesh: AbstractMesh, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh?: AbstractMesh) => void, collisionIndex: number): void;
|
|
|
+ init(scene: Scene): void;
|
|
|
+ destroy(): void;
|
|
|
+ onMeshAdded(mesh: AbstractMesh): void;
|
|
|
+ onMeshUpdated(mesh: AbstractMesh): void;
|
|
|
+ onMeshRemoved(mesh: AbstractMesh): void;
|
|
|
+ onGeometryAdded(geometry: Geometry): void;
|
|
|
+ onGeometryUpdated(geometry: Geometry): void;
|
|
|
+ onGeometryDeleted(geometry: Geometry): void;
|
|
|
+ private _collideWithWorld(position, velocity, collider, maximumRetry, finalPosition, excludedMesh?);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class BoundingInfo {
|
|
|
- minimum: Vector3;
|
|
|
- maximum: Vector3;
|
|
|
- boundingBox: BoundingBox;
|
|
|
- boundingSphere: BoundingSphere;
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
- _update(world: Matrix): void;
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
- _checkCollision(collider: Collider): boolean;
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
- intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
+ var WorkerIncluded: boolean;
|
|
|
+ class CollisionCache {
|
|
|
+ private _meshes;
|
|
|
+ private _geometries;
|
|
|
+ getMeshes(): {
|
|
|
+ [n: number]: SerializedMesh;
|
|
|
+ };
|
|
|
+ getGeometries(): {
|
|
|
+ [s: number]: SerializedGeometry;
|
|
|
+ };
|
|
|
+ getMesh(id: any): SerializedMesh;
|
|
|
+ addMesh(mesh: SerializedMesh): void;
|
|
|
+ getGeometry(id: string): SerializedGeometry;
|
|
|
+ addGeometry(geometry: SerializedGeometry): void;
|
|
|
+ }
|
|
|
+ class CollideWorker {
|
|
|
+ collider: Collider;
|
|
|
+ private _collisionCache;
|
|
|
+ private finalPosition;
|
|
|
+ private collisionsScalingMatrix;
|
|
|
+ private collisionTranformationMatrix;
|
|
|
+ constructor(collider: Collider, _collisionCache: CollisionCache, finalPosition: Vector3);
|
|
|
+ collideWithWorld(position: Vector3, velocity: Vector3, maximumRetry: number, excludedMeshUniqueId?: number): void;
|
|
|
+ private checkCollision(mesh);
|
|
|
+ private processCollisionsForSubMeshes(transformMatrix, mesh);
|
|
|
+ private collideForSubMesh(subMesh, transformMatrix, meshGeometry);
|
|
|
+ private checkSubmeshCollision(subMesh);
|
|
|
+ }
|
|
|
+ interface ICollisionDetector {
|
|
|
+ onInit(payload: InitPayload): void;
|
|
|
+ onUpdate(payload: UpdatePayload): void;
|
|
|
+ onCollision(payload: CollidePayload): void;
|
|
|
+ }
|
|
|
+ class CollisionDetectorTransferable implements ICollisionDetector {
|
|
|
+ private _collisionCache;
|
|
|
+ onInit(payload: InitPayload): void;
|
|
|
+ onUpdate(payload: UpdatePayload): void;
|
|
|
+ onCollision(payload: CollidePayload): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
+ class IntersectionInfo {
|
|
|
+ bu: number;
|
|
|
+ bv: number;
|
|
|
+ distance: number;
|
|
|
+ faceId: number;
|
|
|
+ subMeshId: number;
|
|
|
+ constructor(bu: number, bv: number, distance: number);
|
|
|
+ }
|
|
|
+ class PickingInfo {
|
|
|
+ hit: boolean;
|
|
|
+ distance: number;
|
|
|
+ pickedPoint: Vector3;
|
|
|
+ pickedMesh: AbstractMesh;
|
|
|
+ bu: number;
|
|
|
+ bv: number;
|
|
|
+ faceId: number;
|
|
|
+ subMeshId: number;
|
|
|
+ getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
+ getTextureCoordinates(): Vector2;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2289,6 +2208,85 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class Layer {
|
|
|
+ name: string;
|
|
|
+ texture: Texture;
|
|
|
+ isBackground: boolean;
|
|
|
+ color: Color4;
|
|
|
+ onDispose: () => void;
|
|
|
+ private _scene;
|
|
|
+ private _vertexDeclaration;
|
|
|
+ private _vertexStrideSize;
|
|
|
+ private _vertexBuffer;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _effect;
|
|
|
+ constructor(name: string, imgUrl: string, scene: Scene, isBackground?: boolean, color?: Color4);
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingBox {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ vectors: Vector3[];
|
|
|
+ center: Vector3;
|
|
|
+ extendSize: Vector3;
|
|
|
+ directions: Vector3[];
|
|
|
+ vectorsWorld: Vector3[];
|
|
|
+ minimumWorld: Vector3;
|
|
|
+ maximumWorld: Vector3;
|
|
|
+ private _worldMatrix;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ getWorldMatrix(): Matrix;
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
+ intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
+ static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
+ static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
+ static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingInfo {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ boundingBox: BoundingBox;
|
|
|
+ boundingSphere: BoundingSphere;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ _checkCollision(collider: Collider): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class BoundingSphere {
|
|
|
+ minimum: Vector3;
|
|
|
+ maximum: Vector3;
|
|
|
+ center: Vector3;
|
|
|
+ radius: number;
|
|
|
+ centerWorld: Vector3;
|
|
|
+ radiusWorld: number;
|
|
|
+ private _tempRadiusVector;
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
+ _update(world: Matrix): void;
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
+ static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class LensFlare {
|
|
|
size: number;
|
|
|
position: number;
|
|
@@ -2705,6 +2703,57 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ interface IPhysicsEnginePlugin {
|
|
|
+ initialize(iterations?: number): any;
|
|
|
+ setGravity(gravity: Vector3): void;
|
|
|
+ runOneStep(delta: number): void;
|
|
|
+ registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
+ registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ unregisterMesh(mesh: AbstractMesh): any;
|
|
|
+ applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
+ dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
+ }
|
|
|
+ interface PhysicsBodyCreationOptions {
|
|
|
+ mass: number;
|
|
|
+ friction: number;
|
|
|
+ restitution: number;
|
|
|
+ }
|
|
|
+ interface PhysicsCompoundBodyPart {
|
|
|
+ mesh: Mesh;
|
|
|
+ impostor: number;
|
|
|
+ }
|
|
|
+ class PhysicsEngine {
|
|
|
+ gravity: Vector3;
|
|
|
+ private _currentPlugin;
|
|
|
+ constructor(plugin?: IPhysicsEnginePlugin);
|
|
|
+ _initialize(gravity?: Vector3): void;
|
|
|
+ _runOneStep(delta: number): void;
|
|
|
+ _setGravity(gravity: Vector3): void;
|
|
|
+ _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
+ _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ _unregisterMesh(mesh: AbstractMesh): void;
|
|
|
+ _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
+ _updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
+ dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ static NoImpostor: number;
|
|
|
+ static SphereImpostor: number;
|
|
|
+ static BoxImpostor: number;
|
|
|
+ static PlaneImpostor: number;
|
|
|
+ static MeshImpostor: number;
|
|
|
+ static CapsuleImpostor: number;
|
|
|
+ static ConeImpostor: number;
|
|
|
+ static CylinderImpostor: number;
|
|
|
+ static ConvexHullImpostor: number;
|
|
|
+ static Epsilon: number;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class Color3 {
|
|
|
r: number;
|
|
|
g: number;
|
|
@@ -4306,57 +4355,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- interface IPhysicsEnginePlugin {
|
|
|
- initialize(iterations?: number): any;
|
|
|
- setGravity(gravity: Vector3): void;
|
|
|
- runOneStep(delta: number): void;
|
|
|
- registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
- registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- unregisterMesh(mesh: AbstractMesh): any;
|
|
|
- applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
- }
|
|
|
- interface PhysicsBodyCreationOptions {
|
|
|
- mass: number;
|
|
|
- friction: number;
|
|
|
- restitution: number;
|
|
|
- }
|
|
|
- interface PhysicsCompoundBodyPart {
|
|
|
- mesh: Mesh;
|
|
|
- impostor: number;
|
|
|
- }
|
|
|
- class PhysicsEngine {
|
|
|
- gravity: Vector3;
|
|
|
- private _currentPlugin;
|
|
|
- constructor(plugin?: IPhysicsEnginePlugin);
|
|
|
- _initialize(gravity?: Vector3): void;
|
|
|
- _runOneStep(delta: number): void;
|
|
|
- _setGravity(gravity: Vector3): void;
|
|
|
- _registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
- _registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- _unregisterMesh(mesh: AbstractMesh): void;
|
|
|
- _applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- _createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
- _updateBodyPosition(mesh: AbstractMesh): void;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- static NoImpostor: number;
|
|
|
- static SphereImpostor: number;
|
|
|
- static BoxImpostor: number;
|
|
|
- static PlaneImpostor: number;
|
|
|
- static MeshImpostor: number;
|
|
|
- static CapsuleImpostor: number;
|
|
|
- static ConeImpostor: number;
|
|
|
- static CylinderImpostor: number;
|
|
|
- static ConvexHullImpostor: number;
|
|
|
- static Epsilon: number;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
|
constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
|
}
|
|
@@ -4910,64 +4908,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
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[];
|
|
|
- private _animationStarted;
|
|
|
- private _loopAnimation;
|
|
|
- private _fromIndex;
|
|
|
- private _toIndex;
|
|
|
- private _delay;
|
|
|
- private _direction;
|
|
|
- private _frameCount;
|
|
|
- private _manager;
|
|
|
- private _time;
|
|
|
- size: number;
|
|
|
- constructor(name: string, manager: SpriteManager);
|
|
|
- playAnimation(from: number, to: number, loop: boolean, delay: number): void;
|
|
|
- stopAnimation(): void;
|
|
|
- _animate(deltaTime: number): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class SpriteManager {
|
|
|
- name: string;
|
|
|
- cellSize: number;
|
|
|
- sprites: Sprite[];
|
|
|
- renderingGroupId: number;
|
|
|
- layerMask: number;
|
|
|
- onDispose: () => void;
|
|
|
- fogEnabled: boolean;
|
|
|
- private _capacity;
|
|
|
- private _spriteTexture;
|
|
|
- private _epsilon;
|
|
|
- private _scene;
|
|
|
- private _vertexDeclaration;
|
|
|
- private _vertexStrideSize;
|
|
|
- private _vertexBuffer;
|
|
|
- private _indexBuffer;
|
|
|
- private _vertices;
|
|
|
- private _effectBase;
|
|
|
- private _effectFog;
|
|
|
- constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
- private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class BoundingBoxRenderer {
|
|
|
frontColor: Color3;
|
|
|
backColor: Color3;
|
|
@@ -5069,6 +5009,64 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+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[];
|
|
|
+ private _animationStarted;
|
|
|
+ private _loopAnimation;
|
|
|
+ private _fromIndex;
|
|
|
+ private _toIndex;
|
|
|
+ private _delay;
|
|
|
+ private _direction;
|
|
|
+ private _frameCount;
|
|
|
+ private _manager;
|
|
|
+ private _time;
|
|
|
+ size: number;
|
|
|
+ constructor(name: string, manager: SpriteManager);
|
|
|
+ playAnimation(from: number, to: number, loop: boolean, delay: number): void;
|
|
|
+ stopAnimation(): void;
|
|
|
+ _animate(deltaTime: number): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class SpriteManager {
|
|
|
+ name: string;
|
|
|
+ cellSize: number;
|
|
|
+ sprites: Sprite[];
|
|
|
+ renderingGroupId: number;
|
|
|
+ layerMask: number;
|
|
|
+ onDispose: () => void;
|
|
|
+ fogEnabled: boolean;
|
|
|
+ private _capacity;
|
|
|
+ private _spriteTexture;
|
|
|
+ private _epsilon;
|
|
|
+ private _scene;
|
|
|
+ private _vertexDeclaration;
|
|
|
+ private _vertexStrideSize;
|
|
|
+ private _vertexBuffer;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _vertices;
|
|
|
+ private _effectBase;
|
|
|
+ private _effectFog;
|
|
|
+ constructor(name: string, imgUrl: string, capacity: number, cellSize: number, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
+ private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON.Internals {
|
|
|
class AndOrNotEvaluator {
|
|
|
static Eval(query: string, evaluateCallback: (val: any) => boolean): boolean;
|
|
@@ -5349,6 +5347,28 @@ interface Navigator {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ interface ILoadingScreen {
|
|
|
+ displayLoadingUI: () => void;
|
|
|
+ hideLoadingUI: () => void;
|
|
|
+ loadingUIBackgroundColor: string;
|
|
|
+ loadingUIText: string;
|
|
|
+ }
|
|
|
+ class DefaultLoadingScreen implements ILoadingScreen {
|
|
|
+ private _renderingCanvas;
|
|
|
+ private _loadingText;
|
|
|
+ private _loadingDivBackgroundColor;
|
|
|
+ private _loadingDiv;
|
|
|
+ private _loadingTextDiv;
|
|
|
+ constructor(_renderingCanvas: HTMLCanvasElement, _loadingText?: string, _loadingDivBackgroundColor?: string);
|
|
|
+ displayLoadingUI(): void;
|
|
|
+ hideLoadingUI(): void;
|
|
|
+ loadingUIText: string;
|
|
|
+ loadingUIBackgroundColor: string;
|
|
|
+ private _resizeLoadingUI;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class SceneOptimization {
|
|
|
priority: number;
|
|
|
apply: (scene: Scene) => boolean;
|