@geoblocks/cesium-walk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cesium-walk.js +4 -5
  2. package/package.json +3 -3
package/cesium-walk.js CHANGED
@@ -269,12 +269,11 @@ export default class CesiumWalk {
269
269
  // walk along the view direction projected onto the ground plane,
270
270
  // so that looking down does not push the camera into the terrain
271
271
  const normal = this.surfaceNormal_();
272
- const along = Cartesian3.multiplyByScalar(
273
- normal,
274
- Cartesian3.dot(camera.direction, normal),
272
+ const along = Cartesian3.subtract(
273
+ camera.direction,
274
+ Cartesian3.projectVector(camera.direction, normal, forwardScratch),
275
275
  forwardScratch
276
276
  );
277
- Cartesian3.subtract(camera.direction, along, along);
278
277
  const level = Cartesian3.magnitude(along) > CesiumMath.EPSILON6;
279
278
  if (level) {
280
279
  Cartesian3.normalize(along, along);
@@ -318,7 +317,7 @@ export default class CesiumWalk {
318
317
  if (this.landing_ < 1e-3) {
319
318
  this.landing_ = 0;
320
319
  }
321
- this.stepPhase_ += (Cartesian3.magnitude(this.velocity_) * deltaTime / STEP_LENGTH) * Math.PI;
320
+ this.stepPhase_ += (Cartesian3.magnitude(this.velocity_) * deltaTime / STEP_LENGTH) * CesiumMath.PI;
322
321
  this.clampCameraToTerrain_();
323
322
  }
324
323
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoblocks/cesium-walk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@geoblocks/cesium-input": "^0.1.0",
25
- "@geoblocks/cesium-obstacles": "^0.2.0"
25
+ "@geoblocks/cesium-obstacles": "^0.2.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@cesium/core": ">=0.1.0",
29
29
  "@cesium/engine": ">=10"
30
30
  },
31
- "gitHead": "a4cb0a96ab6cadc09a8a2347acfa9f28b5648d03"
31
+ "gitHead": "0abb7f3381fdf13b15d50047a46d3789f5f95a9e"
32
32
  }