Browse Source

Fix doubled size array from doing both a distinct size declaration and .push.

Alex Tran 5 years ago
parent
commit
f09ce2687e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/XR/features/WebXRFeaturePointSystem.ts

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

@@ -106,7 +106,7 @@ export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
             for (var i = 0; i < numberOfFeaturePoints; i++) {
             for (var i = 0; i < numberOfFeaturePoints; i++) {
                 let rawIndex : number = i * 5;
                 let rawIndex : number = i * 5;
                 let id = featurePointRawData[rawIndex + 4];
                 let id = featurePointRawData[rawIndex + 4];
-                updatedFeaturePoints.push(id);
+                updatedFeaturePoints[i] = id;
 
 
                 // IDs should be durable across frames and strictly increasing from 0 up, so use them as indexing into the feature point array.
                 // 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 (id == this.featurePointCloud.length) {