瀏覽代碼

rename to vertex data

Chris Barth 4 年之前
父節點
當前提交
5872b646a2
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      src/XR/features/WebXRMeshDetector.ts

+ 9 - 9
src/XR/features/WebXRMeshDetector.ts

@@ -25,11 +25,11 @@ export interface IWebXRMeshDetectorOptions {
 }
 }
 
 
 /**
 /**
- * A babylon interface for a XR mesh.
+ * A babylon interface for a XR mesh's vertex data.
  *
  *
  * Currently not supported by WebXR, available only with BabylonNative
  * Currently not supported by WebXR, available only with BabylonNative
  */
  */
-export interface IWebXRMesh {
+export interface IWebXRVertexData {
     /**
     /**
      * a babylon-assigned ID for this mesh
      * a babylon-assigned ID for this mesh
      */
      */
@@ -63,7 +63,7 @@ let meshIdProvider = 0;
  * The mesh detector is used to detect meshes in the real world when in AR
  * The mesh detector is used to detect meshes in the real world when in AR
  */
  */
 export class WebXRMeshDetector extends WebXRAbstractFeature {
 export class WebXRMeshDetector extends WebXRAbstractFeature {
-    private _detectedMeshes: Array<IWebXRMesh> = [];
+    private _detectedMeshes: Array<IWebXRVertexData> = [];
     private _lastDetectedSet: XRMeshSet = new Set();
     private _lastDetectedSet: XRMeshSet = new Set();
 
 
     /**
     /**
@@ -80,15 +80,15 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
     /**
     /**
      * Observers registered here will be executed when a new mesh was added to the session
      * Observers registered here will be executed when a new mesh was added to the session
      */
      */
-    public onMeshAddedObservable: Observable<IWebXRMesh> = new Observable();
+    public onMeshAddedObservable: Observable<IWebXRVertexData> = new Observable();
     /**
     /**
      * Observers registered here will be executed when a mesh is no longer detected in the session
      * Observers registered here will be executed when a mesh is no longer detected in the session
      */
      */
-    public onMeshRemovedObservable: Observable<IWebXRMesh> = new Observable();
+    public onMeshRemovedObservable: Observable<IWebXRVertexData> = new Observable();
     /**
     /**
      * Observers registered here will be executed when an existing mesh updates
      * Observers registered here will be executed when an existing mesh updates
      */
      */
-    public onMeshUpdatedObservable: Observable<IWebXRMesh> = new Observable();
+    public onMeshUpdatedObservable: Observable<IWebXRVertexData> = new Observable();
 
 
     constructor(_xrSessionManager: WebXRSessionManager, private _options: IWebXRMeshDetectorOptions = {}) {
     constructor(_xrSessionManager: WebXRSessionManager, private _options: IWebXRMeshDetectorOptions = {}) {
         super(_xrSessionManager);
         super(_xrSessionManager);
@@ -151,7 +151,7 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
             // now check for new ones
             // now check for new ones
             detectedMeshes.forEach((xrMesh) => {
             detectedMeshes.forEach((xrMesh) => {
                 if (!this._lastDetectedSet.has(xrMesh)) {
                 if (!this._lastDetectedSet.has(xrMesh)) {
-                    const newMesh: Partial<IWebXRMesh> = {
+                    const newMesh: Partial<IWebXRVertexData> = {
                         id: meshIdProvider++,
                         id: meshIdProvider++,
                         xrMesh: xrMesh,
                         xrMesh: xrMesh,
                     };
                     };
@@ -183,7 +183,7 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
         }
         }
     }
     }
 
 
-    private _updateMeshWithXRMesh(xrMesh: XRMesh, mesh: Partial<IWebXRMesh>, xrFrame: XRFrame): IWebXRMesh {
+    private _updateMeshWithXRMesh(xrMesh: XRMesh, mesh: Partial<IWebXRVertexData>, xrFrame: XRFrame): IWebXRVertexData {
         mesh.xrMesh = xrMesh;
         mesh.xrMesh = xrMesh;
         if (!this._xrSessionManager.scene.useRightHandedSystem) {
         if (!this._xrSessionManager.scene.useRightHandedSystem) {
             mesh.positions = new Float32Array(xrMesh.positions.length);
             mesh.positions = new Float32Array(xrMesh.positions.length);
@@ -229,7 +229,7 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
             }
             }
         }
         }
         
         
-        return <IWebXRMesh>mesh;
+        return <IWebXRVertexData>mesh;
     }
     }
 
 
     private _findIndexInMeshArray(xrMesh: XRMesh) {
     private _findIndexInMeshArray(xrMesh: XRMesh) {