|
@@ -2,21 +2,6 @@
|
|
|
// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
|
|
|
// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
|
|
|
|
|
|
-// Open question: Do better types exist to use for vectors/quaternions?
|
|
|
-interface XRVector {
|
|
|
- x: number;
|
|
|
- y: number;
|
|
|
- z: number;
|
|
|
-}
|
|
|
-
|
|
|
-interface XRQuaternion {
|
|
|
- x: number;
|
|
|
- y: number;
|
|
|
- z: number;
|
|
|
- w: number;
|
|
|
-}
|
|
|
-
|
|
|
-// Open question: Should XRGeometryType be defined or should all types be strings?
|
|
|
type XRGeometryType = "unknown" | "background" | "wall" | "floor" | "ceiling" | "platform";
|
|
|
|
|
|
interface XRFieldOfView {
|
|
@@ -27,38 +12,49 @@ interface XRFieldOfView {
|
|
|
}
|
|
|
|
|
|
interface XRFrustum {
|
|
|
- position: XRVector;
|
|
|
- rotation: XRQuaternion;
|
|
|
+ position: DOMPointReadOnly;
|
|
|
+ orientation: DOMPointReadOnly;
|
|
|
fieldOfView: XRFieldOfView;
|
|
|
farDistance: number;
|
|
|
}
|
|
|
|
|
|
interface XRPlane {
|
|
|
- // Open question: Should geometry id's and types be declared on XRPlanes or queried through other means?
|
|
|
- geometryId?: number;
|
|
|
- geometryType?: XRGeometryType | string;
|
|
|
+ // Open question: Should parent geometry id's and types be declared on XRPlanes or queried through other means?
|
|
|
+ parentGeometryId?: number;
|
|
|
+ parentGeometryType?: XRWorldGeometryType;
|
|
|
}
|
|
|
|
|
|
-// Open question: Should XRMesh have a concept of a XRReferenceSpace similar to XRPlane?
|
|
|
interface XRMesh {
|
|
|
+ meshSpace: XRSpace;
|
|
|
positions: Float32Array;
|
|
|
indices: Uint32Array;
|
|
|
normals?: Float32Array;
|
|
|
- // Open question: Do we need lastChangedTime declared for XRMeshes?
|
|
|
lastChangedTime: number;
|
|
|
- // Open question: Should geometry id's and types be declared on XRMeshes or queried through other means?
|
|
|
- geometryId?: number;
|
|
|
- geometryType?: XRGeometryType | string;
|
|
|
+
|
|
|
+ // Open question: Should parent geometry id's and types be declared on XRMeshes or queried through other means?
|
|
|
+ parentGeometryId?: number;
|
|
|
+ parentGeometryType?: XRGeometryType;
|
|
|
}
|
|
|
|
|
|
type XRDetectionBoundaryType = "frustum" | "sphere" | "box";
|
|
|
|
|
|
interface XRDetectionBoundary {
|
|
|
- isStationary?: boolean;
|
|
|
- type?: XRDetectionBoundaryType;
|
|
|
- frustum?: XRFrustum;
|
|
|
- sphereRadius?: number;
|
|
|
- boxDimensions?: XRVector;
|
|
|
+ type: XRDetectionBoundaryType;
|
|
|
+}
|
|
|
+
|
|
|
+interface XRFrustumDetectionBoundary extends XRDetectionBoundary {
|
|
|
+ type: XRDetectionBoundaryType = "frustum"
|
|
|
+ frustum: XRFrustum;
|
|
|
+}
|
|
|
+
|
|
|
+interface XRSphereDetectionBoundary extends XRDetectionBoundary {
|
|
|
+ type: XRDetectionBoundaryType = "sphere";
|
|
|
+ radius: number;
|
|
|
+}
|
|
|
+
|
|
|
+interface XRBoxDetectionBoundary extends XRDetectionBoundary {
|
|
|
+ type: XRDetectionBoundaryType = "box";
|
|
|
+ extent: DOMPointReadOnly;
|
|
|
}
|
|
|
|
|
|
interface XRGeometryDetectorOptions {
|
|
@@ -73,10 +69,12 @@ interface XRSession {
|
|
|
trySetPreferredMeshDetectorOptions(preferredOptions: XRGeometryDetectorOptions): boolean;
|
|
|
}
|
|
|
|
|
|
-type XRMeshSet = Set<XRMesh>;
|
|
|
-
|
|
|
interface XRFrame {
|
|
|
featurePointCloud? : Array<number>;
|
|
|
- // Open question: Should meshes be declared on the XRFrame or queried for the session?
|
|
|
+}
|
|
|
+
|
|
|
+type XRMeshSet = Set<XRMesh>;
|
|
|
+
|
|
|
+interface XRWorldInformation {
|
|
|
detectedMeshes? : XRMeshSet;
|
|
|
}
|