|
@@ -750,6 +750,7 @@ declare module BABYLON {
|
|
|
setTransformMatrix(view: Matrix, projection: Matrix): void;
|
|
|
addMesh(newMesh: AbstractMesh): void;
|
|
|
removeMesh(toRemove: AbstractMesh): number;
|
|
|
+ removeSkeleton(toRemove: Skeleton): number;
|
|
|
removeLight(toRemove: Light): number;
|
|
|
removeCamera(toRemove: Camera): number;
|
|
|
addLight(newLight: Light): void;
|
|
@@ -1571,247 +1572,7 @@ declare module BABYLON {
|
|
|
prepare(): void;
|
|
|
getAnimatables(): IAnimatable[];
|
|
|
clone(name: string, id: string): Skeleton;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-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;
|
|
|
- removeMesh(uniqueId: number): void;
|
|
|
- getGeometry(id: string): SerializedGeometry;
|
|
|
- addGeometry(geometry: SerializedGeometry): void;
|
|
|
- removeGeometry(id: string): 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;
|
|
|
- pickedSprite: Sprite;
|
|
|
- getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
- getTextureCoordinates(): Vector2;
|
|
|
+ dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2173,36 +1934,277 @@ declare module BABYLON {
|
|
|
_updateRigCameras(): void;
|
|
|
private _getRigCamPosition(halfSpace, result);
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class TouchCamera extends FreeCamera {
|
|
|
- private _offsetX;
|
|
|
- private _offsetY;
|
|
|
- private _pointerCount;
|
|
|
- private _pointerPressed;
|
|
|
- private _attachedCanvas;
|
|
|
- private _onPointerDown;
|
|
|
- private _onPointerUp;
|
|
|
- private _onPointerMove;
|
|
|
- angularSensibility: number;
|
|
|
- moveSensibility: number;
|
|
|
- constructor(name: string, position: Vector3, scene: Scene);
|
|
|
- attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void;
|
|
|
- detachControl(canvas: HTMLCanvasElement): void;
|
|
|
- _checkInputs(): void;
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class TouchCamera extends FreeCamera {
|
|
|
+ private _offsetX;
|
|
|
+ private _offsetY;
|
|
|
+ private _pointerCount;
|
|
|
+ private _pointerPressed;
|
|
|
+ private _attachedCanvas;
|
|
|
+ private _onPointerDown;
|
|
|
+ private _onPointerUp;
|
|
|
+ private _onPointerMove;
|
|
|
+ angularSensibility: number;
|
|
|
+ moveSensibility: number;
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene);
|
|
|
+ attachControl(canvas: HTMLCanvasElement, noPreventDefault: boolean): void;
|
|
|
+ detachControl(canvas: HTMLCanvasElement): void;
|
|
|
+ _checkInputs(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+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;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+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;
|
|
|
+ removeMesh(uniqueId: number): void;
|
|
|
+ getGeometry(id: string): SerializedGeometry;
|
|
|
+ addGeometry(geometry: SerializedGeometry): void;
|
|
|
+ removeGeometry(id: string): 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 VirtualJoysticksCamera extends FreeCamera {
|
|
|
- private _leftjoystick;
|
|
|
- private _rightjoystick;
|
|
|
- constructor(name: string, position: Vector3, scene: Scene);
|
|
|
- getLeftJoystick(): VirtualJoystick;
|
|
|
- getRightJoystick(): VirtualJoystick;
|
|
|
- _checkInputs(): void;
|
|
|
- dispose(): void;
|
|
|
+ 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;
|
|
|
+ pickedSprite: Sprite;
|
|
|
+ getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
+ getTextureCoordinates(): Vector2;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -4682,8 +4684,6 @@ declare module BABYLON {
|
|
|
_pos: number;
|
|
|
_model: ModelShape;
|
|
|
shapeId: number;
|
|
|
- previous: SolidParticle;
|
|
|
- next: SolidParticle;
|
|
|
idxInShape: number;
|
|
|
constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
}
|
|
@@ -4733,7 +4733,6 @@ declare module BABYLON {
|
|
|
private _axisZ;
|
|
|
private _camera;
|
|
|
private _particle;
|
|
|
- private _previousParticle;
|
|
|
private _fakeCamPos;
|
|
|
private _rotMatrix;
|
|
|
private _invertedMatrix;
|
|
@@ -4753,7 +4752,7 @@ declare module BABYLON {
|
|
|
private _sinYaw;
|
|
|
private _cosYaw;
|
|
|
constructor(name: string, scene: Scene);
|
|
|
- buildMesh(upgradable?: boolean): Mesh;
|
|
|
+ buildMesh(updatable?: boolean): Mesh;
|
|
|
private _resetCopy();
|
|
|
private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options);
|
|
|
private _posToShape(positions);
|
|
@@ -6243,6 +6242,38 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class VRDeviceOrientationFreeCamera extends FreeCamera {
|
|
|
+ _alpha: number;
|
|
|
+ _beta: number;
|
|
|
+ _gamma: number;
|
|
|
+ private _offsetOrientation;
|
|
|
+ private _deviceOrientationHandler;
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean);
|
|
|
+ _onOrientationEvent(evt: DeviceOrientationEvent): void;
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare var HMDVRDevice: any;
|
|
|
+declare var PositionSensorVRDevice: any;
|
|
|
+declare module BABYLON {
|
|
|
+ class WebVRFreeCamera extends FreeCamera {
|
|
|
+ _hmdDevice: any;
|
|
|
+ _sensorDevice: any;
|
|
|
+ _cacheState: any;
|
|
|
+ _cacheQuaternion: Quaternion;
|
|
|
+ _cacheRotation: Vector3;
|
|
|
+ _vrEnabled: boolean;
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean);
|
|
|
+ private _getWebVRDevices(devices);
|
|
|
+ _checkInputs(): void;
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
interface IOctreeContainer<T> {
|
|
|
blocks: Array<OctreeBlock<T>>;
|
|
|
}
|
|
@@ -6290,38 +6321,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class VRDeviceOrientationFreeCamera extends FreeCamera {
|
|
|
- _alpha: number;
|
|
|
- _beta: number;
|
|
|
- _gamma: number;
|
|
|
- private _offsetOrientation;
|
|
|
- private _deviceOrientationHandler;
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean);
|
|
|
- _onOrientationEvent(evt: DeviceOrientationEvent): void;
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare var HMDVRDevice: any;
|
|
|
-declare var PositionSensorVRDevice: any;
|
|
|
-declare module BABYLON {
|
|
|
- class WebVRFreeCamera extends FreeCamera {
|
|
|
- _hmdDevice: any;
|
|
|
- _sensorDevice: any;
|
|
|
- _cacheState: any;
|
|
|
- _cacheQuaternion: Quaternion;
|
|
|
- _cacheRotation: Vector3;
|
|
|
- _vrEnabled: boolean;
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean);
|
|
|
- private _getWebVRDevices(devices);
|
|
|
- _checkInputs(): void;
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class ShadowGenerator {
|
|
|
private static _FILTER_NONE;
|
|
|
private static _FILTER_VARIANCESHADOWMAP;
|
|
@@ -6577,6 +6576,62 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
|
+ private _world;
|
|
|
+ private _registeredMeshes;
|
|
|
+ private _physicsMaterials;
|
|
|
+ initialize(iterations?: number): void;
|
|
|
+ private _checkWithEpsilon(value);
|
|
|
+ runOneStep(delta: number): void;
|
|
|
+ setGravity(gravity: Vector3): void;
|
|
|
+ registerMesh(mesh: AbstractMesh, impostor: number, options?: PhysicsBodyCreationOptions): any;
|
|
|
+ private _createShape(mesh, impostor);
|
|
|
+ private _createConvexPolyhedron(rawVerts, rawFaces, mesh);
|
|
|
+ private _createHeightmap(mesh);
|
|
|
+ private _addMaterial(friction, restitution);
|
|
|
+ private _createRigidBodyFromShape(shape, mesh, options);
|
|
|
+ registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ private _unbindBody(body);
|
|
|
+ unregisterMesh(mesh: AbstractMesh): void;
|
|
|
+ applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ updateBodyPosition: (mesh: AbstractMesh) => void;
|
|
|
+ createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3): boolean;
|
|
|
+ dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ getWorldObject(): any;
|
|
|
+ getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class OimoJSPlugin implements IPhysicsEnginePlugin {
|
|
|
+ private _world;
|
|
|
+ private _registeredMeshes;
|
|
|
+ private _checkWithEpsilon(value);
|
|
|
+ initialize(iterations?: number): void;
|
|
|
+ setGravity(gravity: Vector3): void;
|
|
|
+ registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
+ registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
+ private _createBodyAsCompound(part, options, initialMesh);
|
|
|
+ unregisterMesh(mesh: AbstractMesh): void;
|
|
|
+ private _unbindBody(body);
|
|
|
+ /**
|
|
|
+ * Update the body position according to the mesh position
|
|
|
+ * @param mesh
|
|
|
+ */
|
|
|
+ updateBodyPosition: (mesh: AbstractMesh) => void;
|
|
|
+ applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
+ createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
+ dispose(): void;
|
|
|
+ isSupported(): boolean;
|
|
|
+ getWorldObject(): any;
|
|
|
+ getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
+ private _getLastShape(body);
|
|
|
+ runOneStep(time: number): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class PostProcessRenderEffect {
|
|
|
private _engine;
|
|
|
private _postProcesses;
|
|
@@ -6675,62 +6730,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
|
- private _world;
|
|
|
- private _registeredMeshes;
|
|
|
- private _physicsMaterials;
|
|
|
- initialize(iterations?: number): void;
|
|
|
- private _checkWithEpsilon(value);
|
|
|
- runOneStep(delta: number): void;
|
|
|
- setGravity(gravity: Vector3): void;
|
|
|
- registerMesh(mesh: AbstractMesh, impostor: number, options?: PhysicsBodyCreationOptions): any;
|
|
|
- private _createShape(mesh, impostor);
|
|
|
- private _createConvexPolyhedron(rawVerts, rawFaces, mesh);
|
|
|
- private _createHeightmap(mesh);
|
|
|
- private _addMaterial(friction, restitution);
|
|
|
- private _createRigidBodyFromShape(shape, mesh, options);
|
|
|
- registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- private _unbindBody(body);
|
|
|
- unregisterMesh(mesh: AbstractMesh): void;
|
|
|
- applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- updateBodyPosition: (mesh: AbstractMesh) => void;
|
|
|
- createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3): boolean;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- getWorldObject(): any;
|
|
|
- getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class OimoJSPlugin implements IPhysicsEnginePlugin {
|
|
|
- private _world;
|
|
|
- private _registeredMeshes;
|
|
|
- private _checkWithEpsilon(value);
|
|
|
- initialize(iterations?: number): void;
|
|
|
- setGravity(gravity: Vector3): void;
|
|
|
- registerMesh(mesh: AbstractMesh, impostor: number, options: PhysicsBodyCreationOptions): any;
|
|
|
- registerMeshesAsCompound(parts: PhysicsCompoundBodyPart[], options: PhysicsBodyCreationOptions): any;
|
|
|
- private _createBodyAsCompound(part, options, initialMesh);
|
|
|
- unregisterMesh(mesh: AbstractMesh): void;
|
|
|
- private _unbindBody(body);
|
|
|
- /**
|
|
|
- * Update the body position according to the mesh position
|
|
|
- * @param mesh
|
|
|
- */
|
|
|
- updateBodyPosition: (mesh: AbstractMesh) => void;
|
|
|
- applyImpulse(mesh: AbstractMesh, force: Vector3, contactPoint: Vector3): void;
|
|
|
- createLink(mesh1: AbstractMesh, mesh2: AbstractMesh, pivot1: Vector3, pivot2: Vector3, options?: any): boolean;
|
|
|
- dispose(): void;
|
|
|
- isSupported(): boolean;
|
|
|
- getWorldObject(): any;
|
|
|
- getPhysicsBodyOfMesh(mesh: AbstractMesh): any;
|
|
|
- private _getLastShape(body);
|
|
|
- runOneStep(time: number): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class CustomProceduralTexture extends ProceduralTexture {
|
|
|
private _animate;
|
|
|
private _time;
|