@woosh/meep-engine 2.34.35 → 2.34.36

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 (37) hide show
  1. package/core/binary/BitSet.js +5 -0
  2. package/core/bvh2/BinaryNode.js +25 -76
  3. package/core/bvh2/aabb3/AABB3.js +46 -1
  4. package/core/bvh2/aabb3/aabb3_from_v3_array.js +34 -0
  5. package/core/bvh2/aabb3/aabb3_from_v3_array_transformed.js +39 -0
  6. package/core/bvh2/aabb3/aabb3_intersects_frustum_degree.js +46 -0
  7. package/core/bvh2/traversal/ThreeFrustumsIntersectionBVHVisitor.js +16 -35
  8. package/core/bvh2/traversal/queryBinaryNode_FrustumIntersections.js +52 -0
  9. package/core/geom/3d/aabb/aabb3_matrix4_project.js +2 -3
  10. package/core/geom/Quaternion.d.ts +2 -0
  11. package/engine/ecs/attachment/TransformAttachmentBinding.js +0 -1
  12. package/engine/ecs/foliage/FoliageVisibilitySetBuilder.js +1 -31
  13. package/engine/ecs/foliage/InstancedFoliage.js +81 -152
  14. package/engine/ecs/foliage/ViewState.js +190 -0
  15. package/engine/ecs/foliage/ecs/Foliage2System.js +80 -12
  16. package/engine/ecs/foliage/ecs/InstancedMeshComponent.js +30 -0
  17. package/engine/ecs/foliage/ecs/InstancedMeshLayer.js +16 -0
  18. package/engine/ecs/foliage/ecs/InstancedMeshUtils.js +2 -2
  19. package/engine/ecs/parent/EntityNode.js +31 -49
  20. package/engine/ecs/transform-attachment/TransformAttachment.js +88 -0
  21. package/engine/ecs/transform-attachment/TransformAttachmentSystem.js +59 -0
  22. package/engine/graphics/GraphicsEngine.js +23 -2
  23. package/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +2 -19
  24. package/engine/graphics/ecs/mesh/updateNodeByTransformAndBBB.js +21 -21
  25. package/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +9 -1
  26. package/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.js +4 -1
  27. package/engine/graphics/ecs/mesh-v2/sample/load_gltf.js +32 -8
  28. package/engine/graphics/geometry/instancing/InstancedMeshGroup.js +17 -11
  29. package/engine/graphics/micron/build/buildMicronGeometryFromBufferGeometry.js +1 -34
  30. package/engine/graphics/micron/build/fill_patch_geometry_data.js +12 -0
  31. package/engine/graphics/micron/format/MicronGeometry.js +21 -0
  32. package/engine/graphics/micron/plugin/MicronRenderPlugin.js +0 -3
  33. package/engine/graphics/micron/prototypeVirtualGeometry.js +69 -1
  34. package/engine/graphics/render/layers/RenderLayer.js +22 -85
  35. package/engine/graphics/render/visibility/VisibilityComputer.js +23 -103
  36. package/package.json +1 -1
  37. package/samples/terrain/editor.js +0 -1
@@ -14,8 +14,7 @@ import { build_leaf_patches_metis } from "./clustering/build_leaf_patches_metis.
14
14
  import { compute_buffer_geometry_byte_size } from "../../geometry/buffered/compute_buffer_geometry_byte_size.js";
15
15
  import { deinterleaveBufferGeometry } from "../../geometry/buffered/deinterleaveBufferGeometry.js";
16
16
  import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
17
- import { min2 } from "../../../../core/math/min2.js";
18
- import { max2 } from "../../../../core/math/max2.js";
17
+ import { aabb3_from_v3_array } from "../../../../core/bvh2/aabb3/aabb3_from_v3_array.js";
19
18
 
20
19
  /**
21
20
  * Returns current time in milliseconds
@@ -118,38 +117,6 @@ function attributes_from_buffer_geometry(buffer_geometry) {
118
117
 
119
118
  const PRINT_VERBOSE_STATS = false;
120
119
 
121
- /**
122
- *
123
- * @param {AABB3} result
124
- * @param {number[]|ArrayLike<number>} input
125
- * @param {number} input_length
126
- */
127
- function aabb3_from_v3_array(result, input, input_length) {
128
- let x0 = Infinity;
129
- let y0 = Infinity;
130
- let z0 = Infinity;
131
-
132
- let x1 = -Infinity;
133
- let y1 = -Infinity;
134
- let z1 = -Infinity;
135
-
136
- for (let i = 0; i < input_length; i += 3) {
137
- const x = input[i];
138
- const y = input[i + 1];
139
- const z = input[i + 2];
140
-
141
- x0 = min2(x, x0);
142
- y0 = min2(y, y0);
143
- z0 = min2(z, z0);
144
-
145
- x1 = max2(x, x1);
146
- y1 = max2(y, y1);
147
- z1 = max2(z, z1);
148
- }
149
-
150
- result.setBounds(x0, y0, z0, x1, y1, z1);
151
- }
152
-
153
120
  /**
154
121
  *
155
122
  * @param {THREE.BufferGeometry} input
@@ -113,6 +113,15 @@ function normalize_to_int8(value) {
113
113
  return Math.round(value * 127);
114
114
  }
115
115
 
116
+ /**
117
+ *
118
+ * @param {number} value
119
+ * @return {number}
120
+ */
121
+ function normalize_to_uint8(value) {
122
+ return Math.round(value * 255);
123
+ }
124
+
116
125
  /**
117
126
  * @enum {function(number):number}
118
127
  */
@@ -120,6 +129,7 @@ const DataConverterType = {
120
129
  None: passThrough,
121
130
  Number2HalfFloat: to_half_float_uint16,
122
131
  Normalize2Int8: normalize_to_int8,
132
+ Normalize2Uint8: normalize_to_uint8,
123
133
  ResampleNormalized_Uint16_to_Uint8: resample_normalized_uint16_to_uint8
124
134
  };
125
135
 
@@ -137,6 +147,8 @@ function compute_attribute_data_converter(source, spec) {
137
147
  // source data can be normalized but isn't
138
148
  if (target_type === DataType.Int8) {
139
149
  return DataConverterType.Normalize2Int8;
150
+ } else if (target_type === DataType.Uint8) {
151
+ return DataConverterType.Normalize2Uint8;
140
152
  } else {
141
153
  throw new Error(`Unsupported normalized type '${target_type}'`);
142
154
  }
@@ -4,6 +4,7 @@ import { computeTriangleRayIntersection } from "../../../../core/geom/3d/triangl
4
4
  import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
5
5
  import { aabb3_array_intersects_ray } from "../../../../core/bvh2/aabb3/aabb3_array_intersects_ray.js";
6
6
  import { sphere_array_intersects_ray } from "../../../../core/geom/3d/sphere/sphere_array_intersects_ray.js";
7
+ import { BitSet } from "../../../../core/binary/BitSet.js";
7
8
 
8
9
  let id_counter = 0;
9
10
 
@@ -13,6 +14,13 @@ let id_counter = 0;
13
14
  */
14
15
  const scratch_traversal_stack = [];
15
16
 
17
+ /**
18
+ *
19
+ * @type {BitSet}
20
+ */
21
+ const scratch_traversal_bitset = new BitSet();
22
+ scratch_traversal_bitset.preventShrink();
23
+
16
24
  export class MicronGeometry {
17
25
  constructor() {
18
26
  /**
@@ -79,6 +87,7 @@ export class MicronGeometry {
79
87
  origin_x, origin_y, origin_z,
80
88
  direction_x, direction_y, direction_z
81
89
  ) {
90
+
82
91
  let i;
83
92
  let stack_cursor = 1;
84
93
 
@@ -99,6 +108,11 @@ export class MicronGeometry {
99
108
  // check that position attribute actually exists
100
109
  assert.isNonNegativeInteger(position_attribute_index, 'position_attribute_index');
101
110
 
111
+ const included_set = scratch_traversal_bitset;
112
+ included_set.reset();
113
+
114
+ included_set.set(this.root.id, true);
115
+
102
116
  const temp_hit = new SurfacePoint3();
103
117
 
104
118
  while (stack_cursor > 0) {
@@ -106,6 +120,7 @@ export class MicronGeometry {
106
120
 
107
121
  const patch = stack[stack_cursor];
108
122
 
123
+
109
124
  if (patch.lod === 0) {
110
125
  // LOD 0 - source geometry
111
126
 
@@ -206,9 +221,15 @@ export class MicronGeometry {
206
221
  for (i = 0; i < child_count; i++) {
207
222
  const child = children[i];
208
223
 
224
+ if (included_set.get(child.id)) {
225
+ continue;
226
+ }
227
+
209
228
  // push to stack
210
229
  stack[stack_cursor] = child;
211
230
 
231
+ included_set.set(child.id, true);
232
+
212
233
  stack_cursor++;
213
234
  }
214
235
  }
@@ -2,7 +2,6 @@ import { EnginePlugin } from "../../../plugin/EnginePlugin.js";
2
2
  import { VGThreeRenderer } from "../render/v1/VGThreeRenderer.js";
3
3
  import { RenderLayer } from "../../render/layers/RenderLayer.js";
4
4
  import { RenderPassType } from "../../render/RenderPassType.js";
5
- import { SOURCE_RENDER_LAYER_PROPERTY } from "../../render/visibility/VisibilityComputer.js";
6
5
  import { AssetTransformer } from "../../../asset/AssetTransformer.js";
7
6
  import { convert_three_object_to_micron } from "../convert_three_object_to_micron.js";
8
7
  import { Cache } from "../../../../core/cache/Cache.js";
@@ -180,8 +179,6 @@ export class MicronRenderPlugin extends EnginePlugin {
180
179
 
181
180
  const mesh = ctx.mesh;
182
181
 
183
- mesh[SOURCE_RENDER_LAYER_PROPERTY] = layer;
184
-
185
182
  visibleSet.elements.push(mesh);
186
183
  visibleSet.size++;
187
184
 
@@ -20,6 +20,8 @@ import {
20
20
  SphereGeometry,
21
21
  sRGBEncoding,
22
22
  TextureLoader,
23
+ Vector2,
24
+ Vector3,
23
25
  VSMShadowMap,
24
26
  WebGLRenderer
25
27
  } from "three";
@@ -46,6 +48,8 @@ import { CanvasView } from "../../../view/elements/CanvasView.js";
46
48
  import { Sampler2D } from "../texture/sampler/Sampler2D.js";
47
49
  import { downsampleSampler2D } from "../texture/sampler/downsampleSampler2D.js";
48
50
  import { ShadowMapRenderer } from "../shadows/ShadowMapRenderer.js";
51
+ import { MouseEvents } from "../../input/devices/events/MouseEvents.js";
52
+ import { mat4 } from "gl-matrix";
49
53
 
50
54
  const background = new TextureLoader().load('data/textures/utility/checkers_white_grey_256x256.png');
51
55
  background.repeat.set(50, 30);
@@ -473,7 +477,8 @@ function init() {
473
477
  // gltf_sample('moicon/03_Jan_22_Demo/3-area_ground_floor/model.gltf');
474
478
  // gltf_sample('moicon/03_Jan_22_Demo/4-area_1st_floor/model.gltf');
475
479
  // gltf_sample('moicon/03_Jan_22_Demo/8-assets/model.gltf');
476
- gltf_sample('moicon/03_Jan_22_Demo/worker_test/model.gltf');
480
+ // gltf_sample('moicon/03_Jan_22_Demo/worker_test/model.gltf');
481
+ gltf_sample('moicon/A4/A4/model.gltf');
477
482
 
478
483
  document.addEventListener("mousemove", onDocumentMouseMove);
479
484
 
@@ -735,6 +740,7 @@ shadowmapRenderer.onBeforeRender.add((renderer, camera, scene) => {
735
740
  vgtr.render();
736
741
  });
737
742
 
743
+
738
744
  function render() {
739
745
  if (orbitControls !== undefined) {
740
746
  orbitControls.update();
@@ -790,3 +796,65 @@ function render() {
790
796
  // console.log(`patches:${active_patches.length}, polycount:${polycount}`);
791
797
  }
792
798
 
799
+ window.document.body.addEventListener(MouseEvents.Move, ({ clientX, clientY }) => {
800
+ const direction = new Vector3();
801
+
802
+ const viewport_size = new Vector2();
803
+
804
+ renderer.getSize(viewport_size);
805
+
806
+ const v2_nx = (clientX / viewport_size.x) * 2 - 1;
807
+ const v2_ny = -(clientY / viewport_size.y) * 2 + 1;
808
+
809
+ direction.set(v2_nx, v2_ny, 0.5);
810
+
811
+ direction.unproject(camera);
812
+
813
+ direction.sub(camera.position);
814
+
815
+ direction.normalize();
816
+
817
+ const origin_x = camera.position.x;
818
+ const origin_y = camera.position.y;
819
+ const origin_z = camera.position.z;
820
+
821
+ const direction_x = direction.x;
822
+ const direction_y = direction.y;
823
+ const direction_z = direction.z;
824
+
825
+ const hits = [];
826
+ scene.traverse(o => {
827
+ if (o.isMicronMesh) {
828
+ /**
829
+ * @type {MicronGeometry}
830
+ */
831
+ const micron_geo = o.geometry;
832
+
833
+ const scratch_m4 = new Float32Array(16);
834
+
835
+ // get transform in local space
836
+ mat4.invert(scratch_m4, o.matrixWorld);
837
+
838
+ // transform ray to local space
839
+ const local_origin_x = scratch_m4[0] * origin_x + scratch_m4[4] * origin_y + scratch_m4[8] * origin_z + scratch_m4[12];
840
+ const local_origin_y = scratch_m4[1] * origin_x + scratch_m4[5] * origin_y + scratch_m4[9] * origin_z + scratch_m4[13];
841
+ const local_origin_z = scratch_m4[2] * origin_x + scratch_m4[6] * origin_y + scratch_m4[10] * origin_z + scratch_m4[14];
842
+
843
+ const local_direction_x = scratch_m4[0] * direction_x + scratch_m4[4] * direction_y + scratch_m4[8] * direction_z;
844
+ const local_direction_y = scratch_m4[1] * direction_x + scratch_m4[5] * direction_y + scratch_m4[9] * direction_z;
845
+ const local_direction_z = scratch_m4[2] * direction_x + scratch_m4[6] * direction_y + scratch_m4[10] * direction_z;
846
+ // NOTE: direction is not normalized
847
+
848
+ const point = micron_geo.raycast(local_origin_x, local_origin_y, local_origin_z, local_direction_x, local_direction_y, local_direction_z);
849
+
850
+ Array.prototype.push.apply(hits, point.map(p => {
851
+ return { position: p.position.toJSON(), geometry: micron_geo.id, instance: o.id };
852
+ }));
853
+ }
854
+ });
855
+
856
+ if (hits.length > 0) {
857
+ console.log(`HITS: ${hits.map(JSON.stringify).join(',')}`);
858
+ }
859
+ });
860
+
@@ -6,73 +6,19 @@
6
6
  import { BinaryNode } from '../../../../core/bvh2/BinaryNode.js';
7
7
  import { RenderPassType } from "../RenderPassType.js";
8
8
  import { IncrementalDeltaSet } from "../visibility/IncrementalDeltaSet.js";
9
- import { BVHVisitor } from "../../../../core/bvh2/traversal/BVHVisitor.js";
10
- import { noop, passThrough } from "../../../../core/function/Functions.js";
11
- import { ThreeFrustumsIntersectionBVHVisitor } from "../../../../core/bvh2/traversal/ThreeFrustumsIntersectionBVHVisitor.js";
9
+ import { passThrough } from "../../../../core/function/Functions.js";
12
10
  import { traverseBinaryNodeUsingVisitor } from "../../../../core/bvh2/traversal/traverseBinaryNodeUsingVisitor.js";
13
11
  import { ThreeClippingPlaneComputingBVHVisitor } from "../../../../core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js";
14
12
  import { RenderLayerState } from "./RenderLayerState.js";
15
13
  import { compare_three_objects } from "../../three/compare_three_objects.js";
14
+ import { queryBinaryNode_FrustumIntersections_Data } from "../../../../core/bvh2/traversal/queryBinaryNode_FrustumIntersections.js";
16
15
 
17
16
 
18
- class VisibleLeafCollector extends BVHVisitor {
19
- constructor() {
20
- super();
21
-
22
- /**
23
- *
24
- * @type {Function[]}
25
- */
26
- this.filters = [];
27
- this.filterCount = 0;
28
-
29
- this.callback = noop;
30
- this.callbackContext = null;
31
-
32
- this.reader = passThrough;
33
-
34
- this.count = 0;
35
- }
36
-
37
- initialize() {
38
- this.filterCount = this.filters.length;
39
- this.count = 0;
40
- }
41
-
42
- visitLeaf(leaf) {
43
- const numFilters = this.filterCount;
44
-
45
- const filters = this.filters;
46
-
47
- for (let i = 0; i < numFilters; i++) {
48
- const filterFunction = filters[i];
49
-
50
- const visibilityFlag = filterFunction(leaf);
51
-
52
- if (!visibilityFlag) {
53
- //not visible, skip
54
- return;
55
- }
56
- }
57
-
58
- const object = leaf.object;
59
-
60
- if (object === null) {
61
- // no payload on the BVH leaf
62
- return;
63
- }
64
-
65
- const renderable = this.reader(object);
66
-
67
- if (renderable === null) {
68
- // no renderable on the payload
69
- return;
70
- }
71
-
72
- this.count++;
73
- this.callback.call(this.callbackContext, renderable, leaf);
74
- }
75
- }
17
+ /**
18
+ *
19
+ * @type {*[]}
20
+ */
21
+ const scratch_array = [];
76
22
 
77
23
  export class RenderLayer {
78
24
  constructor() {
@@ -119,18 +65,6 @@ export class RenderLayer {
119
65
  * @type {RenderPassType|number}
120
66
  */
121
67
  this.renderPass = RenderPassType.Opaque;
122
-
123
- /**
124
- * @private
125
- * @type {VisibleLeafCollector}
126
- */
127
- this.visibilityCollector = new VisibleLeafCollector();
128
- /**
129
- * @private
130
- * @type {ThreeFrustumsIntersectionBVHVisitor}
131
- */
132
- this.bvhVisibilityVisitor = new ThreeFrustumsIntersectionBVHVisitor();
133
- this.bvhVisibilityVisitor.collector = this.visibilityCollector;
134
68
  }
135
69
 
136
70
  /**
@@ -178,29 +112,32 @@ export class RenderLayer {
178
112
 
179
113
  /**
180
114
  *
181
- * @param {Frustum[]} frustums
182
- * @param {function[]} filters
183
- * @param {function(Object3D, NodeDescription)} callback
115
+ * @param {CameraView} view
116
+ * @param {function(THREE.Object3D)} callback
184
117
  * @param {*} [callbackContext]
185
118
  */
186
- buildVisibleSet(frustums, filters, callback, callbackContext) {
119
+ buildVisibleSet(view, callback, callbackContext) {
120
+ const frustum = view.frustum;
121
+
187
122
  const reader = this.extractRenderable;
188
123
 
189
124
 
190
125
  if (typeof reader === "function") {
191
- this.visibilityCollector.callback = callback;
192
- this.visibilityCollector.callbackContext = callbackContext;
193
126
 
194
- this.visibilityCollector.filters = filters;
195
- this.visibilityCollector.reader = reader;
127
+ const hits = queryBinaryNode_FrustumIntersections_Data(scratch_array, 0, this.bvh, frustum);
196
128
 
197
- this.visibilityCollector.initialize();
129
+ for (let i = 0; i < hits; i++) {
130
+ const datum = scratch_array[i];
198
131
 
199
- this.bvhVisibilityVisitor.setFrustums(frustums);
132
+ const object3D = reader(datum);
200
133
 
201
- traverseBinaryNodeUsingVisitor(this.bvh, this.bvhVisibilityVisitor);
134
+ if (!object3D) {
135
+ // null or undefined
136
+ continue;
137
+ }
202
138
 
203
- this.visibilityCollector.finalize();
139
+ callback.call(callbackContext, object3D);
140
+ }
204
141
 
205
142
  }
206
143
 
@@ -1,42 +1,14 @@
1
- import { Frustum } from "three";
2
- import { frustumFromCamera } from "../../ecs/camera/CameraSystem.js";
3
1
  import { assert } from "../../../../core/assert.js";
4
2
 
5
- const frustum = new Frustum();
6
- /**
7
- *
8
- * @type {VisibilityFilter[]}
9
- */
10
- const objectFilters = [];
11
-
12
- /**
13
- *
14
- * @type {function[]}
15
- */
16
- const objectFilterExecutors = [];
17
-
18
- export const SOURCE_RENDER_LAYER_PROPERTY = '@meep-render-layer';
19
-
20
3
  export class VisibilityComputer {
21
4
  constructor() {
22
- /**
23
- *
24
- * @type {VisibilityFilter[]}
25
- */
26
- this.filters = [];
5
+
27
6
  /**
28
7
  *
29
8
  * @type {CameraView}
30
9
  */
31
10
  this.__view = null;
32
11
 
33
- /**
34
- * @deprecated use view.frustum instead
35
- * @type {Frustum[]}
36
- * @private
37
- */
38
- this.__frustums = [];
39
-
40
12
  /**
41
13
  *
42
14
  * @type {RenderLayer}
@@ -53,15 +25,28 @@ export class VisibilityComputer {
53
25
  }
54
26
 
55
27
  /**
56
- *
28
+ * @deprecated
29
+ * @returns {VisibilityFilter[]}
30
+ */
31
+ get filters() {
32
+
33
+ throw new Error('Method is deprecated');
34
+ }
35
+
36
+ /**
37
+ * @deprecated
38
+ * @param {VisibilityFilter[]} v
39
+ */
40
+ set filters(v) {
41
+ throw new Error('Method is deprecated');
42
+ }
43
+
44
+ /**
45
+ * @deprecated
57
46
  * @param {VisibilityFilter} filter
58
47
  */
59
48
  addFilter(filter) {
60
- if (this.filters.find(f => f.name === filter.name)) {
61
- throw new Error(`Filter named '${filter.name}' already exists`);
62
- }
63
-
64
- this.filters.push(filter);
49
+ throw new Error('Method is deprecated');
65
50
  }
66
51
 
67
52
  /**
@@ -70,16 +55,8 @@ export class VisibilityComputer {
70
55
  * @returns {boolean}
71
56
  */
72
57
  removeFilter(filter) {
73
- const i = this.filters.indexOf(filter);
74
-
75
- if (i === -1) {
76
- //not present
77
- return false;
78
- }
79
58
 
80
- //cut
81
- this.filters.splice(i, 1);
82
- return true;
59
+ throw new Error('Method is deprecated');
83
60
  }
84
61
 
85
62
  /**
@@ -97,9 +74,6 @@ export class VisibilityComputer {
97
74
  __includeObject(object3d) {
98
75
  assert.equal(object3d.isObject3D, true, 'object3d.isObject3D !== true');
99
76
 
100
- // mark object, this is a hack, needs to be fixed at some point
101
- object3d[SOURCE_RENDER_LAYER_PROPERTY] = this.__activeLayer;
102
-
103
77
  //object passed all filters, add it to visible set
104
78
  this.__output.push(object3d);
105
79
 
@@ -111,8 +85,6 @@ export class VisibilityComputer {
111
85
  * @param {RenderLayer} layer
112
86
  */
113
87
  __processLayer(layer) {
114
-
115
-
116
88
  if (!layer.state.visible) {
117
89
  //whole layer is hidden
118
90
 
@@ -123,61 +95,13 @@ export class VisibilityComputer {
123
95
  this.__activeLayer = layer;
124
96
 
125
97
  if (layer.managed) {
126
- this.__output.pushOther(layer.visibleSet);
127
98
 
128
- // mark all elements in the layer
129
- const elements = layer.visibleSet.elements;
130
-
131
- const element_count = elements.length;
132
- for (let j = 0; j < element_count; j++) {
133
- const object3D = elements[j];
134
-
135
- object3D[SOURCE_RENDER_LAYER_PROPERTY] = layer;
136
- }
99
+ this.__output.pushOther(layer.visibleSet);
137
100
 
138
101
  return;
139
102
  }
140
103
 
141
- // clear visible set
142
- // this.__output.initializeUpdate();
143
-
144
- const filters = this.filters;
145
- const filterCount = filters.length;
146
-
147
- let objectFilterCount = 0;
148
- let i;
149
- for (i = 0; i < filterCount; i++) {
150
- const f = filters[i];
151
-
152
- if (f.enabled && f.layerPredicate(layer)) {
153
- objectFilters[objectFilterCount] = f;
154
- objectFilterExecutors[objectFilterCount] = f.objectPredicateExecute;
155
-
156
- objectFilterCount++;
157
- }
158
- }
159
-
160
-
161
- //prepare filters
162
- for (i = 0; i < objectFilterCount; i++) {
163
- const f = objectFilters[i];
164
-
165
- f.objectPredicateInitialize(this.__view.camera);
166
- }
167
-
168
- objectFilterExecutors.length = objectFilterCount;
169
-
170
- layer.buildVisibleSet(this.__frustums, objectFilterExecutors, this.__includeObject, this);
171
-
172
- //finalize filters
173
- for (i = 0; i < objectFilterCount; i++) {
174
- const f = objectFilters[i];
175
-
176
- f.objectPredicateFinalize();
177
- }
178
-
179
-
180
- // layer.visibleSet.finalizeUpdate();
104
+ layer.buildVisibleSet(this.__view, this.__includeObject, this);
181
105
  }
182
106
 
183
107
 
@@ -193,10 +117,6 @@ export class VisibilityComputer {
193
117
  * @param {RenderLayerManager} renderLayers
194
118
  */
195
119
  build(renderLayers) {
196
- frustumFromCamera(this.__view.camera, frustum);
197
-
198
- this.__frustums = [frustum];
199
-
200
120
  renderLayers.traverse(this.__processLayer, this);
201
121
  }
202
122
  }
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.34.35",
8
+ "version": "2.34.36",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",
@@ -20,7 +20,6 @@ import { copy_Sampler2D_channel_data } from "../../engine/graphics/texture/sampl
20
20
  import { TextureAssetLoader } from "../../engine/asset/loaders/texture/TextureAssetLoader.js";
21
21
  import { CanvasView } from "../../view/elements/CanvasView.js";
22
22
  import convertSampler2D2Canvas from "../../engine/graphics/texture/sampler/Sampler2D2Canvas.js";
23
- import { drawSamplerHTML } from "../../engine/graphics/texture/sampler/util/drawSamplerHTML.js";
24
23
 
25
24
  const engineHarness = new EngineHarness();
26
25