|
@@ -1515,244 +1515,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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 {
|
|
class ArcRotateCamera extends TargetCamera {
|
|
alpha: number;
|
|
alpha: number;
|
|
beta: number;
|
|
beta: number;
|
|
@@ -2128,14 +1890,252 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class VirtualJoysticksCamera extends FreeCamera {
|
|
|
|
- private _leftjoystick;
|
|
|
|
- private _rightjoystick;
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene);
|
|
|
|
- getLeftJoystick(): VirtualJoystick;
|
|
|
|
- getRightJoystick(): VirtualJoystick;
|
|
|
|
- _checkInputs(): void;
|
|
|
|
- dispose(): void;
|
|
|
|
|
|
+ class VirtualJoysticksCamera extends FreeCamera {
|
|
|
|
+ private _leftjoystick;
|
|
|
|
+ private _rightjoystick;
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene);
|
|
|
|
+ getLeftJoystick(): VirtualJoystick;
|
|
|
|
+ getRightJoystick(): VirtualJoystick;
|
|
|
|
+ _checkInputs(): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2315,6 +2315,38 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ interface ISceneLoaderPlugin {
|
|
|
|
+ extensions: string;
|
|
|
|
+ importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
|
|
|
|
+ load: (scene: Scene, data: string, rootUrl: string) => boolean;
|
|
|
|
+ }
|
|
|
|
+ class SceneLoader {
|
|
|
|
+ private static _ForceFullSceneLoadingForIncremental;
|
|
|
|
+ private static _ShowLoadingScreen;
|
|
|
|
+ static ForceFullSceneLoadingForIncremental: boolean;
|
|
|
|
+ static ShowLoadingScreen: boolean;
|
|
|
|
+ private static _registeredPlugins;
|
|
|
|
+ private static _getPluginForFilename(sceneFilename);
|
|
|
|
+ static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
|
|
|
|
+ static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
|
|
|
|
+ /**
|
|
|
|
+ * Load a scene
|
|
|
|
+ * @param rootUrl a string that defines the root url for scene and resources
|
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
|
+ * @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
|
+ */
|
|
|
|
+ static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
|
+ /**
|
|
|
|
+ * Append a scene
|
|
|
|
+ * @param rootUrl a string that defines the root url for scene and resources
|
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
|
+ * @param scene is the instance of BABYLON.Scene to append to
|
|
|
|
+ */
|
|
|
|
+ static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class DirectionalLight extends Light implements IShadowLight {
|
|
class DirectionalLight extends Light implements IShadowLight {
|
|
direction: Vector3;
|
|
direction: Vector3;
|
|
position: Vector3;
|
|
position: Vector3;
|
|
@@ -2419,38 +2451,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- interface ISceneLoaderPlugin {
|
|
|
|
- extensions: string;
|
|
|
|
- importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
|
|
|
|
- load: (scene: Scene, data: string, rootUrl: string) => boolean;
|
|
|
|
- }
|
|
|
|
- class SceneLoader {
|
|
|
|
- private static _ForceFullSceneLoadingForIncremental;
|
|
|
|
- private static _ShowLoadingScreen;
|
|
|
|
- static ForceFullSceneLoadingForIncremental: boolean;
|
|
|
|
- static ShowLoadingScreen: boolean;
|
|
|
|
- private static _registeredPlugins;
|
|
|
|
- private static _getPluginForFilename(sceneFilename);
|
|
|
|
- static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
|
|
|
|
- static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
|
|
|
|
- /**
|
|
|
|
- * Load a scene
|
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
|
- * @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
|
- */
|
|
|
|
- static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
|
- /**
|
|
|
|
- * Append a scene
|
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
|
- * @param scene is the instance of BABYLON.Scene to append to
|
|
|
|
- */
|
|
|
|
- static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class EffectFallbacks {
|
|
class EffectFallbacks {
|
|
private _defines;
|
|
private _defines;
|
|
private _currentRank;
|
|
private _currentRank;
|
|
@@ -3544,7 +3544,7 @@ declare module BABYLON {
|
|
_subdivisions: number;
|
|
_subdivisions: number;
|
|
constructor(name: string, scene: Scene);
|
|
constructor(name: string, scene: Scene);
|
|
subdivisions: number;
|
|
subdivisions: number;
|
|
- optimize(chunksCount: number): void;
|
|
|
|
|
|
+ optimize(chunksCount: number, octreeBlocksSize?: number): void;
|
|
getHeightAtCoordinates(x: number, z: number): number;
|
|
getHeightAtCoordinates(x: number, z: number): number;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4226,83 +4226,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class BoundingBoxRenderer {
|
|
|
|
- frontColor: Color3;
|
|
|
|
- backColor: Color3;
|
|
|
|
- showBackLines: boolean;
|
|
|
|
- renderList: SmartArray<BoundingBox>;
|
|
|
|
- private _scene;
|
|
|
|
- private _colorShader;
|
|
|
|
- private _vb;
|
|
|
|
- private _ib;
|
|
|
|
- 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 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;
|
|
|
|
- constructor(index: number, scene: Scene);
|
|
|
|
- render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
|
- prepare(): void;
|
|
|
|
- dispatch(subMesh: SubMesh): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class RenderingManager {
|
|
|
|
- static MAX_RENDERINGGROUPS: number;
|
|
|
|
- private _scene;
|
|
|
|
- private _renderingGroups;
|
|
|
|
- private _depthBufferAlreadyCleaned;
|
|
|
|
- constructor(scene: Scene);
|
|
|
|
- private _renderParticles(index, activeMeshes);
|
|
|
|
- private _renderSprites(index);
|
|
|
|
- private _clearDepthBuffer();
|
|
|
|
- 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;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
}
|
|
}
|
|
@@ -4842,6 +4765,83 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class BoundingBoxRenderer {
|
|
|
|
+ frontColor: Color3;
|
|
|
|
+ backColor: Color3;
|
|
|
|
+ showBackLines: boolean;
|
|
|
|
+ renderList: SmartArray<BoundingBox>;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _colorShader;
|
|
|
|
+ private _vb;
|
|
|
|
+ private _ib;
|
|
|
|
+ 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 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;
|
|
|
|
+ constructor(index: number, scene: Scene);
|
|
|
|
+ render(customRenderFunction: (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>) => void): boolean;
|
|
|
|
+ prepare(): void;
|
|
|
|
+ dispatch(subMesh: SubMesh): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class RenderingManager {
|
|
|
|
+ static MAX_RENDERINGGROUPS: number;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _renderingGroups;
|
|
|
|
+ private _depthBufferAlreadyCleaned;
|
|
|
|
+ constructor(scene: Scene);
|
|
|
|
+ private _renderParticles(index, activeMeshes);
|
|
|
|
+ private _renderSprites(index);
|
|
|
|
+ private _clearDepthBuffer();
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class Sprite {
|
|
class Sprite {
|
|
name: string;
|
|
name: string;
|
|
position: Vector3;
|
|
position: Vector3;
|
|
@@ -5233,7 +5233,7 @@ declare module BABYLON {
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
class SceneSerializer {
|
|
class SceneSerializer {
|
|
static Serialize(scene: Scene): any;
|
|
static Serialize(scene: Scene): any;
|
|
- static SerializeMesh(toSerialize: any, withParents?: boolean): any;
|
|
|
|
|
|
+ static SerializeMesh(toSerialize: any, withParents?: boolean, withChildren?: boolean): any;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5502,6 +5502,7 @@ declare module BABYLON {
|
|
private _joystickPointerID;
|
|
private _joystickPointerID;
|
|
private _joystickColor;
|
|
private _joystickColor;
|
|
private _joystickPointerPos;
|
|
private _joystickPointerPos;
|
|
|
|
+ private _joystickPreviousPointerPos;
|
|
private _joystickPointerStartPos;
|
|
private _joystickPointerStartPos;
|
|
private _deltaJoystickVector;
|
|
private _deltaJoystickVector;
|
|
private _leftJoystick;
|
|
private _leftJoystick;
|
|
@@ -5610,6 +5611,9 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+declare module BABYLON.Internals {
|
|
|
|
+}
|
|
|
|
+
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
class ShadowGenerator {
|
|
class ShadowGenerator {
|
|
private static _FILTER_NONE;
|
|
private static _FILTER_NONE;
|
|
@@ -5663,9 +5667,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-declare module BABYLON.Internals {
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
class BaseTexture {
|
|
class BaseTexture {
|
|
name: string;
|
|
name: string;
|