@woosh/meep-engine 2.94.1 → 2.94.2

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.
package/build/meep.cjs CHANGED
@@ -116586,7 +116586,7 @@ function compute_neighbors(result, index, width, height) {
116586
116586
  /**
116587
116587
  *
116588
116588
  * @param {number} node
116589
- * @param {number[]} g_score
116589
+ * @param {number[]|Float32Array} g_score
116590
116590
  * @param {number} width
116591
116591
  * @param {number} height
116592
116592
  * @returns {number[]}
@@ -116615,11 +116615,11 @@ function compute_path(node, g_score, width, height) {
116615
116615
 
116616
116616
  // normalize
116617
116617
  if (_dx !== 0) {
116618
- _dx /= Math.abs(_dx);
116618
+ _dx = sign$1(_dx);
116619
116619
  }
116620
116620
 
116621
116621
  if (_dy !== 0) {
116622
- _dy /= Math.abs(_dy);
116622
+ _dy = sign$1(_dy);
116623
116623
  }
116624
116624
 
116625
116625
  const direction_change = dx !== _dx || dy !== _dy;
@@ -116680,6 +116680,7 @@ function compute_path(node, g_score, width, height) {
116680
116680
 
116681
116681
  }
116682
116682
 
116683
+ // so far the path is from goal to start, we need to reverse it
116683
116684
  result.reverse();
116684
116685
 
116685
116686
  return result;
@@ -116727,7 +116728,6 @@ let g_score = new Float32Array(1024);
116727
116728
  * @param {number} height
116728
116729
  * @param {number} start
116729
116730
  * @param {number} goal
116730
- * @param {number} crossing_penalty
116731
116731
  * @param {number} block_value value in the field that signifies impassible obstacle
116732
116732
  * @returns {Array.<number>} array of indices representing path from start to end
116733
116733
  */
@@ -116735,7 +116735,6 @@ function find_path_on_grid_astar(
116735
116735
  field,
116736
116736
  width, height,
116737
116737
  start, goal,
116738
- crossing_penalty,
116739
116738
  block_value
116740
116739
  ) {
116741
116740
 
@@ -116790,7 +116789,7 @@ function find_path_on_grid_astar(
116790
116789
  }
116791
116790
 
116792
116791
  // Cost of traversing to this neighbour
116793
- const transition_cost = neighbor_value * crossing_penalty + 1;
116792
+ const transition_cost = neighbor_value + 1;
116794
116793
 
116795
116794
  // updated path cost
116796
116795
  const cost_so_far = g_score[currentNode] + transition_cost;