Bladeren bron

temp, check for NaNs in camera

Alexander Rose 6 jaren geleden
bovenliggende
commit
573eedd722
1 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. 8 1
      src/mol-canvas3d/camera.ts

+ 8 - 1
src/mol-canvas3d/camera.ts

@@ -71,6 +71,13 @@ class Camera implements Object3D {
             this.updatedViewProjection.next(this);
         }
 
+        if (Mat4.hasNaN(this.projectionView)) console.error('NaNs in projectionView')
+        if (Mat4.hasNaN(this.inverseProjectionView)) console.error('NaNs in inverseProjectionView')
+        if (Mat4.hasNaN(this.view)) console.error('NaNs in view')
+        if (Mat4.hasNaN(this.projection)) console.error('NaNs in projection')
+        if (Vec3.hasNaN(snapshot.position)) console.error('NaNs in position')
+        if (Vec3.hasNaN(snapshot.target)) console.error('NaNs in target')
+
         return changed;
     }
 
@@ -97,7 +104,7 @@ class Camera implements Object3D {
         Vec3.setMagnitude(this.deltaDirection, this.state.direction, deltaDistance)
         if (currentDistance < targetDistance) Vec3.negate(this.deltaDirection, this.deltaDirection)
         Vec3.add(this.newPosition, this.state.position, this.deltaDirection)
-        
+
         this.setState({ target, position: this.newPosition })
     }