@woosh/meep-engine 2.39.41 → 2.39.42

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.
@@ -553,12 +553,12 @@ export class AABB3 {
553
553
 
554
554
  /**
555
555
  * @source http://stackoverflow.com/questions/3106666/intersection-of-line-segment-with-axis-aligned-box-in-c-sharp
556
- * @param startX
557
- * @param startY
558
- * @param startZ
559
- * @param endX
560
- * @param endY
561
- * @param endZ
556
+ * @param {number} startX
557
+ * @param {number} startY
558
+ * @param {number} startZ
559
+ * @param {number} endX
560
+ * @param {number} endY
561
+ * @param {number} endZ
562
562
  * @returns {boolean}
563
563
  */
564
564
  intersectSegment2(startX, startY, startZ, endX, endY, endZ) {
@@ -264,6 +264,12 @@ export class Cache {
264
264
  */
265
265
  const weightTarget = this.maxWeight - elementWeight;
266
266
 
267
+ if (weightTarget < 0) {
268
+ // Special case
269
+ // element does not fit into cache, attempting to insert it forcibly would result in a full flush and overflow
270
+ return;
271
+ }
272
+
267
273
  //evict elements until there is enough space for the element
268
274
  this.evictUntilWeight(weightTarget);
269
275
 
@@ -15,4 +15,11 @@ export class GeometrySpatialQueryAccelerator {
15
15
  origin_x: number, origin_y: number, origin_z: number,
16
16
  direction_x: number, direction_y: number, direction_z: number
17
17
  ): boolean
18
+
19
+ /**
20
+ * In bytes
21
+ */
22
+ cache_size: number
23
+
24
+ static INSTANCE: GeometrySpatialQueryAccelerator;
18
25
  }
@@ -33,6 +33,22 @@ export class GeometrySpatialQueryAccelerator {
33
33
  this.__visitor_raycast = new RaycastNearestHitComputingVisitor();
34
34
  }
35
35
 
36
+ /**
37
+ *
38
+ * @param {number} value in bytes
39
+ */
40
+ set cache_size(value) {
41
+ this.cache.setMaxWeight(value);
42
+ }
43
+
44
+ /**
45
+ *
46
+ * @return {number} in bytes
47
+ */
48
+ get cache_size() {
49
+ return this.cache.maxWeight;
50
+ }
51
+
36
52
  /**
37
53
  *
38
54
  * @param {THREE.BufferGeometry} geometry
@@ -184,7 +200,7 @@ export class GeometrySpatialQueryAccelerator {
184
200
  const de_interleaved_position_attribute = deinterleaveBufferAttribute(position_attribute);
185
201
  const vertices = de_interleaved_position_attribute.array;
186
202
 
187
- if(index_attribute === undefined || index_attribute === null){
203
+ if (index_attribute === undefined || index_attribute === null) {
188
204
  return buildUnsortedUnindexed(vertices);
189
205
  }
190
206
 
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.39.41",
8
+ "version": "2.39.42",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",
@@ -9,12 +9,18 @@ import { ImageRGBADataLoader } from "../../engine/asset/loaders/image/ImageRGBAD
9
9
  import TerrainSystem from "../../engine/ecs/terrain/ecs/TerrainSystem.js";
10
10
  import WaterSystem from "../../engine/graphics/ecs/water/WaterSystem.js";
11
11
  import Water from "../../engine/graphics/ecs/water/Water.js";
12
- import { AmbientOcclusionPostProcessEffect } from "../../engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
12
+ import {
13
+ AmbientOcclusionPostProcessEffect
14
+ } from "../../engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
13
15
  import { TerrainLayer } from "../../engine/ecs/terrain/ecs/layers/TerrainLayer.js";
14
16
  import Mesh from "../../engine/graphics/ecs/mesh/Mesh.js";
15
17
  import { Transform } from "../../engine/ecs/transform/Transform.js";
16
18
  import { MeshSystem } from "../../engine/graphics/ecs/mesh/MeshSystem.js";
17
19
  import { enableEditor } from "../../editor/enableEditor.js";
20
+ import "../../../../../css/main.scss";
21
+ import '../../../../../css/editor/EntityEditorView.scss';
22
+ import '../../../../../css/editor/EditorView.scss';
23
+ import { initializeEditor } from "../../../model/game/initializeEditor.js";
18
24
 
19
25
  const HEIGHT_RANGE = 64;
20
26
 
@@ -209,7 +215,7 @@ async function init(harness) {
209
215
 
210
216
  await makeConfig(engine).apply(engine);
211
217
 
212
- enableEditor(engine);
218
+ enableEditor(engine,initializeEditor);
213
219
 
214
220
  await eh.initialize();
215
221