Explorar o código

Make it so ids do not need to be sequential.

Alex Tran %!s(int64=5) %!d(string=hai) anos
pai
achega
2c6cf29599
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/XR/features/WebXRFeaturePointSystem.ts

+ 1 - 1
src/XR/features/WebXRFeaturePointSystem.ts

@@ -121,7 +121,7 @@ export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
                 const id = featurePointRawData[rawIndex + 4];
 
                 // IDs should be durable across frames and strictly increasing from 0 up, so use them as indexing into the feature point array.
-                if (id >= this._featurePointCloud.length) {
+                if (!this._featurePointCloud[id]) {
                     this._featurePointCloud[id] = { position: new Vector3(), confidenceValue: 0 };
                     addedFeaturePoints.push(id);
                 } else {