@woosh/meep-engine 2.35.7 → 2.35.8

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.
@@ -10,9 +10,10 @@ export class MicronGeometry {
10
10
  initialize(): void
11
11
 
12
12
  raycast(
13
+ destination: SurfacePoint3[], destination_offset: number,
13
14
  origin_x: number, origin_y: number, origin_z: number,
14
15
  direction_x: number, direction_y: number, direction_z: number
15
- ): SurfacePoint3[]
16
+ ): number
16
17
 
17
18
  readonly isMicronGeometry: boolean
18
19
 
@@ -75,28 +75,26 @@ export class MicronGeometry {
75
75
 
76
76
  /**
77
77
  *
78
+ * @param {SurfacePoint3[]} destination
79
+ * @param {number} destination_offset
78
80
  * @param {number} origin_x
79
81
  * @param {number} origin_y
80
82
  * @param {number} origin_z
81
83
  * @param {number} direction_x
82
84
  * @param {number} direction_y
83
85
  * @param {number} direction_z
84
- * @returns {SurfacePoint3[]}
86
+ * @returns {number}
85
87
  */
86
88
  raycast(
89
+ destination,
90
+ destination_offset,
87
91
  origin_x, origin_y, origin_z,
88
92
  direction_x, direction_y, direction_z
89
93
  ) {
90
-
94
+ let destination_address = destination_offset;
91
95
  let i;
92
96
  let stack_cursor = 1;
93
97
 
94
- /**
95
- *
96
- * @type {SurfacePoint3[]}
97
- */
98
- const hits = [];
99
-
100
98
  // initialize stack
101
99
  const stack = scratch_traversal_stack;
102
100
  stack[0] = this.root;
@@ -185,7 +183,7 @@ export class MicronGeometry {
185
183
 
186
184
  contact.copy(temp_hit);
187
185
 
188
- hits.push(contact);
186
+ destination[destination_address++] = contact;
189
187
 
190
188
  }
191
189
  }
@@ -233,7 +231,7 @@ export class MicronGeometry {
233
231
  }
234
232
  }
235
233
 
236
- return hits;
234
+ return destination_address - destination_offset;
237
235
  }
238
236
 
239
237
  /**
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.35.7",
8
+ "version": "2.35.8",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",