|
@@ -4050,6 +4050,120 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class BoundingBox implements ICullable {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ vectors: Vector3[];
|
|
|
|
+ center: Vector3;
|
|
|
|
+ centerWorld: Vector3;
|
|
|
|
+ extendSize: Vector3;
|
|
|
|
+ extendSizeWorld: Vector3;
|
|
|
|
+ directions: Vector3[];
|
|
|
|
+ vectorsWorld: Vector3[];
|
|
|
|
+ minimumWorld: Vector3;
|
|
|
|
+ maximumWorld: Vector3;
|
|
|
|
+ private _worldMatrix;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ getWorldMatrix(): Matrix;
|
|
|
|
+ setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
|
+ _update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
+ intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
|
+ static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
|
+ static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
|
+ static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
+ static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ interface ICullable {
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ }
|
|
|
|
+ class BoundingInfo implements ICullable {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ boundingBox: BoundingBox;
|
|
|
|
+ boundingSphere: BoundingSphere;
|
|
|
|
+ private _isLocked;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ isLocked: boolean;
|
|
|
|
+ update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ _checkCollision(collider: Collider): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class BoundingSphere {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ center: Vector3;
|
|
|
|
+ radius: number;
|
|
|
|
+ centerWorld: Vector3;
|
|
|
|
+ radiusWorld: number;
|
|
|
|
+ private _tempRadiusVector;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ _update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class Ray {
|
|
|
|
+ origin: Vector3;
|
|
|
|
+ direction: Vector3;
|
|
|
|
+ length: number;
|
|
|
|
+ private _edge1;
|
|
|
|
+ private _edge2;
|
|
|
|
+ private _pvec;
|
|
|
|
+ private _tvec;
|
|
|
|
+ private _qvec;
|
|
|
|
+ private _tmpRay;
|
|
|
|
+ private _rayHelper;
|
|
|
|
+ constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
|
+ intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
|
+ intersectsBox(box: BoundingBox): boolean;
|
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
+ intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
|
+ intersectsPlane(plane: Plane): number;
|
|
|
|
+ intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
|
+ intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
|
|
|
|
+ private _comparePickingInfo(pickingInfoA, pickingInfoB);
|
|
|
|
+ private static smallnum;
|
|
|
|
+ private static rayl;
|
|
|
|
+ /**
|
|
|
|
+ * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
|
+ * @param sega the first point of the segment to test the intersection against
|
|
|
|
+ * @param segb the second point of the segment to test the intersection against
|
|
|
|
+ * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
|
+ * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
|
+ */
|
|
|
|
+ intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
|
+ static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
|
+ /**
|
|
|
|
+ * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
|
+ * transformed to the given world matrix.
|
|
|
|
+ * @param origin The origin point
|
|
|
|
+ * @param end The end point
|
|
|
|
+ * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
|
+ */
|
|
|
|
+ static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
|
+ static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
|
+ static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
declare module BABYLON.Debug {
|
|
declare module BABYLON.Debug {
|
|
class AxesViewer {
|
|
class AxesViewer {
|
|
private _xline;
|
|
private _xline;
|
|
@@ -4179,120 +4293,6 @@ declare module BABYLON.Debug {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class BoundingBox implements ICullable {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- vectors: Vector3[];
|
|
|
|
- center: Vector3;
|
|
|
|
- centerWorld: Vector3;
|
|
|
|
- extendSize: Vector3;
|
|
|
|
- extendSizeWorld: Vector3;
|
|
|
|
- directions: Vector3[];
|
|
|
|
- vectorsWorld: Vector3[];
|
|
|
|
- minimumWorld: Vector3;
|
|
|
|
- maximumWorld: Vector3;
|
|
|
|
- private _worldMatrix;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- getWorldMatrix(): Matrix;
|
|
|
|
- setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
|
- _update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
- intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
|
- static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
|
- static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
|
- static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
- static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- interface ICullable {
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- }
|
|
|
|
- class BoundingInfo implements ICullable {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- boundingBox: BoundingBox;
|
|
|
|
- boundingSphere: BoundingSphere;
|
|
|
|
- private _isLocked;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- isLocked: boolean;
|
|
|
|
- update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- _checkCollision(collider: Collider): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class BoundingSphere {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- center: Vector3;
|
|
|
|
- radius: number;
|
|
|
|
- centerWorld: Vector3;
|
|
|
|
- radiusWorld: number;
|
|
|
|
- private _tempRadiusVector;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- _update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class Ray {
|
|
|
|
- origin: Vector3;
|
|
|
|
- direction: Vector3;
|
|
|
|
- length: number;
|
|
|
|
- private _edge1;
|
|
|
|
- private _edge2;
|
|
|
|
- private _pvec;
|
|
|
|
- private _tvec;
|
|
|
|
- private _qvec;
|
|
|
|
- private _tmpRay;
|
|
|
|
- private _rayHelper;
|
|
|
|
- constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
|
- intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
|
- intersectsBox(box: BoundingBox): boolean;
|
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
- intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
|
- intersectsPlane(plane: Plane): number;
|
|
|
|
- intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
|
- intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
|
|
|
|
- private _comparePickingInfo(pickingInfoA, pickingInfoB);
|
|
|
|
- private static smallnum;
|
|
|
|
- private static rayl;
|
|
|
|
- /**
|
|
|
|
- * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
|
- * @param sega the first point of the segment to test the intersection against
|
|
|
|
- * @param segb the second point of the segment to test the intersection against
|
|
|
|
- * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
|
- * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
|
- */
|
|
|
|
- intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
|
- static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
|
- /**
|
|
|
|
- * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
|
- * transformed to the given world matrix.
|
|
|
|
- * @param origin The origin point
|
|
|
|
- * @param end The end point
|
|
|
|
- * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
|
- */
|
|
|
|
- static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
|
- static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
|
- static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
/**
|
|
/**
|
|
* Highlight layer options. This helps customizing the behaviour
|
|
* Highlight layer options. This helps customizing the behaviour
|
|
* of the highlight layer.
|
|
* of the highlight layer.
|
|
@@ -5930,6 +5930,7 @@ declare module BABYLON {
|
|
getBindedMeshes(): AbstractMesh[];
|
|
getBindedMeshes(): AbstractMesh[];
|
|
forceCompilation(mesh: AbstractMesh, onCompiled: (material: Material) => void, options?: {
|
|
forceCompilation(mesh: AbstractMesh, onCompiled: (material: Material) => void, options?: {
|
|
alphaTest: boolean;
|
|
alphaTest: boolean;
|
|
|
|
+ clipPlane: boolean;
|
|
}): void;
|
|
}): void;
|
|
markAsDirty(flag: number): void;
|
|
markAsDirty(flag: number): void;
|
|
protected _markAllSubMeshesAsDirty(func: (defines: MaterialDefines) => void): void;
|
|
protected _markAllSubMeshesAsDirty(func: (defines: MaterialDefines) => void): void;
|
|
@@ -13586,33 +13587,63 @@ 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 _vertexBuffers;
|
|
|
|
- private _indexBuffer;
|
|
|
|
- constructor(scene: Scene);
|
|
|
|
- private _prepareRessources();
|
|
|
|
- reset(): void;
|
|
|
|
- render(): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class DepthRenderer {
|
|
|
|
|
|
+ class ReflectionProbe {
|
|
|
|
+ name: string;
|
|
private _scene;
|
|
private _scene;
|
|
- private _depthMap;
|
|
|
|
- private _effect;
|
|
|
|
- private _viewMatrix;
|
|
|
|
|
|
+ private _renderTargetTexture;
|
|
private _projectionMatrix;
|
|
private _projectionMatrix;
|
|
- private _transformMatrix;
|
|
|
|
- private _worldViewProjection;
|
|
|
|
- private _cachedDefines;
|
|
|
|
|
|
+ private _viewMatrix;
|
|
|
|
+ private _target;
|
|
|
|
+ private _add;
|
|
|
|
+ private _attachedMesh;
|
|
|
|
+ invertYAxis: boolean;
|
|
|
|
+ position: Vector3;
|
|
|
|
+ constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
|
+ samples: number;
|
|
|
|
+ refreshRate: number;
|
|
|
|
+ getScene(): Scene;
|
|
|
|
+ readonly cubeTexture: RenderTargetTexture;
|
|
|
|
+ readonly renderList: AbstractMesh[];
|
|
|
|
+ attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
+ /**
|
|
|
|
+ * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
|
+ *
|
|
|
|
+ * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
|
+ * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
|
+ */
|
|
|
|
+ setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class BoundingBoxRenderer {
|
|
|
|
+ frontColor: Color3;
|
|
|
|
+ backColor: Color3;
|
|
|
|
+ showBackLines: boolean;
|
|
|
|
+ renderList: SmartArray<BoundingBox>;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _colorShader;
|
|
|
|
+ private _vertexBuffers;
|
|
|
|
+ private _indexBuffer;
|
|
|
|
+ constructor(scene: Scene);
|
|
|
|
+ private _prepareRessources();
|
|
|
|
+ reset(): void;
|
|
|
|
+ render(): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class DepthRenderer {
|
|
|
|
+ private _scene;
|
|
|
|
+ private _depthMap;
|
|
|
|
+ private _effect;
|
|
|
|
+ private _viewMatrix;
|
|
|
|
+ private _projectionMatrix;
|
|
|
|
+ private _transformMatrix;
|
|
|
|
+ private _worldViewProjection;
|
|
|
|
+ private _cachedDefines;
|
|
constructor(scene: Scene, type?: number);
|
|
constructor(scene: Scene, type?: number);
|
|
isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
getDepthMap(): RenderTargetTexture;
|
|
getDepthMap(): RenderTargetTexture;
|
|
@@ -13854,36 +13885,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class ReflectionProbe {
|
|
|
|
- name: string;
|
|
|
|
- private _scene;
|
|
|
|
- private _renderTargetTexture;
|
|
|
|
- private _projectionMatrix;
|
|
|
|
- private _viewMatrix;
|
|
|
|
- private _target;
|
|
|
|
- private _add;
|
|
|
|
- private _attachedMesh;
|
|
|
|
- invertYAxis: boolean;
|
|
|
|
- position: Vector3;
|
|
|
|
- constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
|
- samples: number;
|
|
|
|
- refreshRate: number;
|
|
|
|
- getScene(): Scene;
|
|
|
|
- readonly cubeTexture: RenderTargetTexture;
|
|
|
|
- readonly renderList: AbstractMesh[];
|
|
|
|
- attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
- /**
|
|
|
|
- * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
|
- *
|
|
|
|
- * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
|
- * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
|
- */
|
|
|
|
- setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class Sprite {
|
|
class Sprite {
|
|
name: string;
|
|
name: string;
|
|
position: Vector3;
|
|
position: Vector3;
|
|
@@ -15514,139 +15515,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class VRCameraMetrics {
|
|
|
|
- hResolution: number;
|
|
|
|
- vResolution: number;
|
|
|
|
- hScreenSize: number;
|
|
|
|
- vScreenSize: number;
|
|
|
|
- vScreenCenter: number;
|
|
|
|
- eyeToScreenDistance: number;
|
|
|
|
- lensSeparationDistance: number;
|
|
|
|
- interpupillaryDistance: number;
|
|
|
|
- distortionK: number[];
|
|
|
|
- chromaAbCorrection: number[];
|
|
|
|
- postProcessScaleFactor: number;
|
|
|
|
- lensCenterOffset: number;
|
|
|
|
- compensateDistortion: boolean;
|
|
|
|
- readonly aspectRatio: number;
|
|
|
|
- readonly aspectRatioFov: number;
|
|
|
|
- readonly leftHMatrix: Matrix;
|
|
|
|
- readonly rightHMatrix: Matrix;
|
|
|
|
- readonly leftPreViewMatrix: Matrix;
|
|
|
|
- readonly rightPreViewMatrix: Matrix;
|
|
|
|
- static GetDefault(): VRCameraMetrics;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
- class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
- class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
|
|
|
|
- constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare var HMDVRDevice: any;
|
|
|
|
-declare var VRDisplay: any;
|
|
|
|
-declare var VRFrameData: any;
|
|
|
|
-declare module BABYLON {
|
|
|
|
- /**
|
|
|
|
- * This is a copy of VRPose.
|
|
|
|
- * IMPORTANT!! The data is right-hand data.
|
|
|
|
- * @export
|
|
|
|
- * @interface DevicePose
|
|
|
|
- */
|
|
|
|
- interface DevicePose {
|
|
|
|
- readonly position?: Float32Array;
|
|
|
|
- readonly linearVelocity?: Float32Array;
|
|
|
|
- readonly linearAcceleration?: Float32Array;
|
|
|
|
- readonly orientation?: Float32Array;
|
|
|
|
- readonly angularVelocity?: Float32Array;
|
|
|
|
- readonly angularAcceleration?: Float32Array;
|
|
|
|
- }
|
|
|
|
- interface PoseControlled {
|
|
|
|
- position: Vector3;
|
|
|
|
- rotationQuaternion: Quaternion;
|
|
|
|
- devicePosition?: Vector3;
|
|
|
|
- deviceRotationQuaternion: Quaternion;
|
|
|
|
- rawPose: DevicePose;
|
|
|
|
- deviceScaleFactor: number;
|
|
|
|
- updateFromDevice(poseData: DevicePose): any;
|
|
|
|
- }
|
|
|
|
- interface WebVROptions {
|
|
|
|
- trackPosition?: boolean;
|
|
|
|
- positionScale?: number;
|
|
|
|
- displayName?: string;
|
|
|
|
- controllerMeshes?: boolean;
|
|
|
|
- defaultLightningOnControllers?: boolean;
|
|
|
|
- }
|
|
|
|
- class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
|
- private webVROptions;
|
|
|
|
- _vrDevice: any;
|
|
|
|
- rawPose: DevicePose;
|
|
|
|
- private _vrEnabled;
|
|
|
|
- private _specsVersion;
|
|
|
|
- private _attached;
|
|
|
|
- private _oldSize;
|
|
|
|
- private _oldHardwareScaleFactor;
|
|
|
|
- private _frameData;
|
|
|
|
- private _quaternionCache;
|
|
|
|
- private _positionOffset;
|
|
|
|
- protected _descendants: Array<Node>;
|
|
|
|
- devicePosition: Vector3;
|
|
|
|
- deviceRotationQuaternion: any;
|
|
|
|
- deviceScaleFactor: number;
|
|
|
|
- controllers: Array<WebVRController>;
|
|
|
|
- nonVRControllers: Array<Gamepad>;
|
|
|
|
- private _onControllersAttached;
|
|
|
|
- private _onNonVRControllerAttached;
|
|
|
|
- rigParenting: boolean;
|
|
|
|
- private _lightOnControllers;
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
|
- onControllersAttached: (controllers: Array<WebVRController>) => void;
|
|
|
|
- onNonVRControllerAttached: (controller: Gamepad) => void;
|
|
|
|
- getControllerByName(name: string): WebVRController;
|
|
|
|
- private _leftController;
|
|
|
|
- readonly leftController: WebVRController;
|
|
|
|
- private _rightController;
|
|
|
|
- readonly rightController: WebVRController;
|
|
|
|
- getForwardRay(length?: number): Ray;
|
|
|
|
- _checkInputs(): void;
|
|
|
|
- updateFromDevice(poseData: DevicePose): void;
|
|
|
|
- /**
|
|
|
|
- * WebVR's attach control will start broadcasting frames to the device.
|
|
|
|
- * Note that in certain browsers (chrome for example) this function must be called
|
|
|
|
- * within a user-interaction callback. Example:
|
|
|
|
- * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
|
|
|
|
- *
|
|
|
|
- * @param {HTMLElement} element
|
|
|
|
- * @param {boolean} [noPreventDefault]
|
|
|
|
- *
|
|
|
|
- * @memberOf WebVRFreeCamera
|
|
|
|
- */
|
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
|
- getClassName(): string;
|
|
|
|
- resetToCurrentRotation(): void;
|
|
|
|
- _updateRigCameras(): void;
|
|
|
|
- /**
|
|
|
|
- * This function is called by the two RIG cameras.
|
|
|
|
- * 'this' is the left or right camera (and NOT (!!!) the WebVRFreeCamera instance)
|
|
|
|
- */
|
|
|
|
- protected _getWebVRViewMatrix(): Matrix;
|
|
|
|
- protected _getWebVRProjectionMatrix(): Matrix;
|
|
|
|
- initControllers(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
camera: ArcRotateCamera;
|
|
camera: ArcRotateCamera;
|
|
gamepad: Gamepad;
|
|
gamepad: Gamepad;
|
|
@@ -15855,6 +15723,139 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class VRCameraMetrics {
|
|
|
|
+ hResolution: number;
|
|
|
|
+ vResolution: number;
|
|
|
|
+ hScreenSize: number;
|
|
|
|
+ vScreenSize: number;
|
|
|
|
+ vScreenCenter: number;
|
|
|
|
+ eyeToScreenDistance: number;
|
|
|
|
+ lensSeparationDistance: number;
|
|
|
|
+ interpupillaryDistance: number;
|
|
|
|
+ distortionK: number[];
|
|
|
|
+ chromaAbCorrection: number[];
|
|
|
|
+ postProcessScaleFactor: number;
|
|
|
|
+ lensCenterOffset: number;
|
|
|
|
+ compensateDistortion: boolean;
|
|
|
|
+ readonly aspectRatio: number;
|
|
|
|
+ readonly aspectRatioFov: number;
|
|
|
|
+ readonly leftHMatrix: Matrix;
|
|
|
|
+ readonly rightHMatrix: Matrix;
|
|
|
|
+ readonly leftPreViewMatrix: Matrix;
|
|
|
|
+ readonly rightPreViewMatrix: Matrix;
|
|
|
|
+ static GetDefault(): VRCameraMetrics;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+ class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+ class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
|
|
|
|
+ constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare var HMDVRDevice: any;
|
|
|
|
+declare var VRDisplay: any;
|
|
|
|
+declare var VRFrameData: any;
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ /**
|
|
|
|
+ * This is a copy of VRPose.
|
|
|
|
+ * IMPORTANT!! The data is right-hand data.
|
|
|
|
+ * @export
|
|
|
|
+ * @interface DevicePose
|
|
|
|
+ */
|
|
|
|
+ interface DevicePose {
|
|
|
|
+ readonly position?: Float32Array;
|
|
|
|
+ readonly linearVelocity?: Float32Array;
|
|
|
|
+ readonly linearAcceleration?: Float32Array;
|
|
|
|
+ readonly orientation?: Float32Array;
|
|
|
|
+ readonly angularVelocity?: Float32Array;
|
|
|
|
+ readonly angularAcceleration?: Float32Array;
|
|
|
|
+ }
|
|
|
|
+ interface PoseControlled {
|
|
|
|
+ position: Vector3;
|
|
|
|
+ rotationQuaternion: Quaternion;
|
|
|
|
+ devicePosition?: Vector3;
|
|
|
|
+ deviceRotationQuaternion: Quaternion;
|
|
|
|
+ rawPose: DevicePose;
|
|
|
|
+ deviceScaleFactor: number;
|
|
|
|
+ updateFromDevice(poseData: DevicePose): any;
|
|
|
|
+ }
|
|
|
|
+ interface WebVROptions {
|
|
|
|
+ trackPosition?: boolean;
|
|
|
|
+ positionScale?: number;
|
|
|
|
+ displayName?: string;
|
|
|
|
+ controllerMeshes?: boolean;
|
|
|
|
+ defaultLightningOnControllers?: boolean;
|
|
|
|
+ }
|
|
|
|
+ class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
|
+ private webVROptions;
|
|
|
|
+ _vrDevice: any;
|
|
|
|
+ rawPose: DevicePose;
|
|
|
|
+ private _vrEnabled;
|
|
|
|
+ private _specsVersion;
|
|
|
|
+ private _attached;
|
|
|
|
+ private _oldSize;
|
|
|
|
+ private _oldHardwareScaleFactor;
|
|
|
|
+ private _frameData;
|
|
|
|
+ private _quaternionCache;
|
|
|
|
+ private _positionOffset;
|
|
|
|
+ protected _descendants: Array<Node>;
|
|
|
|
+ devicePosition: Vector3;
|
|
|
|
+ deviceRotationQuaternion: any;
|
|
|
|
+ deviceScaleFactor: number;
|
|
|
|
+ controllers: Array<WebVRController>;
|
|
|
|
+ nonVRControllers: Array<Gamepad>;
|
|
|
|
+ private _onControllersAttached;
|
|
|
|
+ private _onNonVRControllerAttached;
|
|
|
|
+ rigParenting: boolean;
|
|
|
|
+ private _lightOnControllers;
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
|
+ onControllersAttached: (controllers: Array<WebVRController>) => void;
|
|
|
|
+ onNonVRControllerAttached: (controller: Gamepad) => void;
|
|
|
|
+ getControllerByName(name: string): WebVRController;
|
|
|
|
+ private _leftController;
|
|
|
|
+ readonly leftController: WebVRController;
|
|
|
|
+ private _rightController;
|
|
|
|
+ readonly rightController: WebVRController;
|
|
|
|
+ getForwardRay(length?: number): Ray;
|
|
|
|
+ _checkInputs(): void;
|
|
|
|
+ updateFromDevice(poseData: DevicePose): void;
|
|
|
|
+ /**
|
|
|
|
+ * WebVR's attach control will start broadcasting frames to the device.
|
|
|
|
+ * Note that in certain browsers (chrome for example) this function must be called
|
|
|
|
+ * within a user-interaction callback. Example:
|
|
|
|
+ * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
|
|
|
|
+ *
|
|
|
|
+ * @param {HTMLElement} element
|
|
|
|
+ * @param {boolean} [noPreventDefault]
|
|
|
|
+ *
|
|
|
|
+ * @memberOf WebVRFreeCamera
|
|
|
|
+ */
|
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ resetToCurrentRotation(): void;
|
|
|
|
+ _updateRigCameras(): void;
|
|
|
|
+ /**
|
|
|
|
+ * This function is called by the two RIG cameras.
|
|
|
|
+ * 'this' is the left or right camera (and NOT (!!!) the WebVRFreeCamera instance)
|
|
|
|
+ */
|
|
|
|
+ protected _getWebVRViewMatrix(): Matrix;
|
|
|
|
+ protected _getWebVRProjectionMatrix(): Matrix;
|
|
|
|
+ initControllers(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
interface IOctreeContainer<T> {
|
|
interface IOctreeContainer<T> {
|
|
blocks: Array<OctreeBlock<T>>;
|
|
blocks: Array<OctreeBlock<T>>;
|
|
}
|
|
}
|