@woosh/meep-engine 2.43.1 → 2.43.4
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/core/binary/BinaryBuffer.js +13 -1
- package/core/binary/BitSet.js +2 -2
- package/core/bvh2/aabb3/aabb3_array_combine.js +2 -2
- package/core/collection/RingBuffer.js +4 -2
- package/core/collection/RingBuffer.spec.js +59 -0
- package/core/collection/array/ArrayIteratorRandom.js +1 -1
- package/core/collection/{ArrayUtils.spec.js → array/arrayPickBestElement.spec.js} +1 -1
- package/core/collection/array/arrayPickBestElements.js +51 -0
- package/core/collection/array/arrayPickMinElement.js +43 -0
- package/core/collection/array/arrayQuickSort.js +1 -1
- package/core/collection/array/arraySetSortingDiff.js +1 -1
- package/core/collection/array/arraySwapElements.js +12 -0
- package/core/collection/array/array_range_equal_strict.js +22 -0
- package/core/collection/array/groupArrayBy.js +42 -0
- package/core/collection/array/isArrayEqual.js +50 -0
- package/core/collection/array/randomMultipleFromArray.js +34 -0
- package/core/collection/array/randomizeArrayElementOrder.js +23 -0
- package/core/color/sRGB_to_linear.js +9 -4
- package/core/geom/2d/convex-hull/convex_hull_monotone_2d.js +1 -1
- package/core/geom/3d/aabb/aabb3_build_frustum.js +1 -1
- package/core/geom/3d/aabb/compute_aabb_from_points.js +1 -1
- package/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +3 -1
- package/core/geom/3d/morton/v3_morton_encode_transformed.spec.js +20 -0
- package/core/geom/3d/plane/orient3d_fast.js +11 -10
- package/core/geom/3d/plane/orient3d_robust.js +41 -0
- package/core/geom/3d/plane/plane_computeConvex3PlaneIntersection.js +0 -23
- package/core/geom/3d/plane/plane_three_compute_convex3_plane_intersection.js +24 -0
- package/core/geom/3d/shape/UnionShape3D.js +1 -1
- package/core/geom/3d/sphere/harmonics/README.md +15 -0
- package/core/geom/3d/sphere/harmonics/sh3_add.js +21 -0
- package/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +618 -0
- package/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +49 -0
- package/core/geom/3d/sphere/harmonics/sh3_sample_irradiance_by_direction.js +53 -0
- package/core/geom/3d/tetrahedra/README.md +10 -1
- package/core/geom/3d/tetrahedra/TetrahedralMesh.js +650 -0
- package/core/geom/3d/tetrahedra/TetrahedralMesh.spec.js +233 -0
- package/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js +75 -0
- package/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +2 -2
- package/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.spec.js +4 -4
- package/core/geom/3d/tetrahedra/delaunay/Cavity.js +49 -7
- package/core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.js +51 -17
- package/core/geom/3d/tetrahedra/delaunay/debug_validate_mesh.js +19 -0
- package/core/geom/3d/tetrahedra/delaunay/fill_in_a_cavity.js +191 -0
- package/core/geom/3d/tetrahedra/delaunay/push_boundary_with_validation.js +27 -0
- package/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_compute_cavity.js +59 -43
- package/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_compute_sub_determinant.js +77 -0
- package/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_compute_sub_determinant.spec.js +30 -0
- package/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_walk_towards_containing_tetrahedron.js +58 -0
- package/core/geom/3d/tetrahedra/delaunay/validate_cavity_boundary.js +60 -0
- package/core/geom/3d/tetrahedra/{point_in_tetrahedron_circumsphere.js → in_sphere_fast.js} +11 -13
- package/core/geom/3d/tetrahedra/in_sphere_robust.js +53 -0
- package/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +44 -35
- package/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +83 -0
- package/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.spec.js +24 -0
- package/core/geom/3d/tetrahedra/tetrahedron_contains_point.spec.js +66 -0
- package/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +166 -0
- package/core/geom/3d/util/make_justified_point_grid.js +31 -0
- package/core/geom/Bezier.js +0 -27
- package/core/geom/Plane.js +0 -4
- package/core/geom/packing/miniball/Subspan.js +2 -2
- package/core/geom/v3_lerp.js +6 -1
- package/core/math/isqrt.js +28 -0
- package/core/math/isqrt.spec.js +9 -0
- package/core/math/max.spec.js +25 -0
- package/core/math/min2.spec.js +25 -0
- package/core/model/node-graph/node/NodeInstance.js +3 -3
- package/core/primitives/strings/prefixTree/PrefixTreeLeaf.js +1 -1
- package/core/process/delay.js +5 -0
- package/core/process/task/util/randomCountTask.js +1 -1
- package/editor/Editor.js +3 -0
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.js +195 -11
- package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.js +16 -0
- package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.js +4 -0
- package/editor/ecs/component/editors/primitive/ArrayEditor.js +1 -1
- package/editor/tools/v2/BlenderCameraOrientationGizmo.js +6 -0
- package/editor/view/ecs/components/common/AutoCanvasView.js +13 -25
- package/engine/EngineHarness.js +11 -5
- package/engine/asset/AssetManager.d.ts +5 -1
- package/engine/asset/AssetManager.js +50 -15
- package/engine/asset/AssetManager.spec.js +17 -11
- package/engine/asset/AssetRequest.js +57 -0
- package/engine/asset/loaders/ArrayBufferLoader.js +22 -0
- package/engine/asset/loaders/AssetLoader.js +1 -1
- package/engine/ecs/System.js +1 -1
- package/engine/ecs/dynamic_actions/DynamicActorSystem.js +1 -1
- package/engine/ecs/terrain/ecs/TerrainSystem.js +7 -1
- package/engine/ecs/transform/copy_three_transform.js +15 -0
- package/engine/graphics/FrameRunner.js +5 -9
- package/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +1 -1
- package/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +1 -1
- package/engine/graphics/ecs/camera/Camera.js +1 -10
- package/engine/graphics/ecs/camera/CameraSystem.js +8 -8
- package/engine/graphics/ecs/camera/ProjectionType.js +9 -0
- package/engine/graphics/ecs/camera/build_three_camera_object.js +3 -3
- package/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +59 -4
- package/engine/graphics/ecs/light/Light.js +6 -1
- package/engine/graphics/ecs/light/LightSystem.d.ts +1 -1
- package/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.js +2 -17
- package/engine/graphics/geometry/VertexDataSpec.js +1 -1
- package/engine/graphics/geometry/instancing/InstancedMeshGroup.js +2 -2
- package/engine/graphics/impostors/octahedral/prototypeBaker.js +3 -3
- package/engine/graphics/micron/plugin/GLTFAssetTransformer.js +1 -1
- package/engine/graphics/micron/plugin/MicronRenderPlugin.js +3 -1
- package/engine/graphics/particles/node-based/codegen/modules/FunctionSignature.js +1 -1
- package/engine/graphics/render/forward_plus/LightManager.js +1 -1
- package/engine/graphics/render/forward_plus/LightManager.spec.js +4 -0
- package/engine/graphics/render/forward_plus/computeFrustumCorners.js +4 -2
- package/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +2 -2
- package/engine/graphics/render/layers/RenderLayerUtils.js +2 -2
- package/engine/graphics/sh3/LightProbeVolume.js +595 -0
- package/engine/graphics/sh3/SH3VisualisationMaterial.js +79 -0
- package/engine/graphics/sh3/prototypeSH3Probe.js +427 -0
- package/engine/graphics/sh3/visualise_probe.js +40 -0
- package/engine/graphics/shaders/DenoiseShader.js +1 -1
- package/engine/graphics/texture/atlas/AtlasPatch.js +11 -3
- package/engine/graphics/texture/atlas/CachingTextureAtlas.js +2 -2
- package/engine/graphics/texture/atlas/TextureAtlas.js +22 -4
- package/engine/graphics/texture/atlas/TextureAtlas.spec.js +22 -0
- package/engine/graphics/texture/sampler/Sampler2D.js +0 -64
- package/engine/graphics/texture/sampler/Sampler2D.spec.js +2 -1
- package/engine/graphics/texture/sampler/sampler2d_combine.js +67 -0
- package/engine/intelligence/behavior/ecs/BehaviorSystem.spec.js +0 -3
- package/engine/intelligence/blackboard/AbstractBlackboard.d.ts +1 -1
- package/engine/network/PriorityFetch.js +192 -0
- package/engine/simulation/DormandPrince.js +1 -1
- package/engine/ui/DraggableAspect.js +0 -1
- package/generation/grid/generation/road/GridTaskGenerateRoads.js +1 -1
- package/package.json +2 -1
- package/samples/terrain/from_image_2.js +127 -82
- package/view/elements/CanvasView.js +7 -1
- package/view/elements/image/HTMLElementCacheKey.js +1 -1
- package/view/util/DomSizeObserver.js +3 -5
- package/core/collection/ArrayUtils.js +0 -263
- package/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_walk_toward_cavity.js +0 -48
- package/core/geom/3d/tetrahedra/hxt/a.js +0 -524
- package/core/geom/3d/tetrahedra/hxt/hxt.js +0 -140
- package/core/geom/3d/tetrahedra/hxt/hxt.wasm +0 -0
- package/core/geom/3d/tetrahedra/tetrahedra_collection.js +0 -383
|
@@ -54,13 +54,11 @@ export class DomSizeObserver {
|
|
|
54
54
|
* @param {number} [depth=0] how deep should the observation go
|
|
55
55
|
*/
|
|
56
56
|
constructor({ depth = 0 } = {}) {
|
|
57
|
-
const rectangle = new Rectangle();
|
|
58
|
-
|
|
59
57
|
/**
|
|
60
58
|
*
|
|
61
59
|
* @type {Rectangle}
|
|
62
60
|
*/
|
|
63
|
-
this.dimensions =
|
|
61
|
+
this.dimensions = new Rectangle();
|
|
64
62
|
|
|
65
63
|
/**
|
|
66
64
|
*
|
|
@@ -169,7 +167,7 @@ export class DomSizeObserver {
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
/**
|
|
172
|
-
*
|
|
170
|
+
* Will attach to the view's element and automatically start/stop observing when the view is linked/unlinked
|
|
173
171
|
* @param {View} view
|
|
174
172
|
*/
|
|
175
173
|
watchView(view) {
|
|
@@ -184,7 +182,7 @@ export class DomSizeObserver {
|
|
|
184
182
|
}
|
|
185
183
|
|
|
186
184
|
/**
|
|
187
|
-
*
|
|
185
|
+
* Counterpart to {@link #watchView}
|
|
188
186
|
* @param {View} view
|
|
189
187
|
*/
|
|
190
188
|
unwatchView(view) {
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {Array} first
|
|
4
|
-
* @param {Array} second
|
|
5
|
-
* @returns {boolean}
|
|
6
|
-
*/
|
|
7
|
-
import { assert } from "../assert.js";
|
|
8
|
-
import { returnZero } from "../function/Functions.js";
|
|
9
|
-
import { min2 } from "../math/min2.js";
|
|
10
|
-
import { HashMap } from "./HashMap.js";
|
|
11
|
-
import { randomIntegerBetween } from "../math/random/randomIntegerBetween.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @template T
|
|
16
|
-
* @param {function} random
|
|
17
|
-
* @param {T[]} array
|
|
18
|
-
*/
|
|
19
|
-
export function randomizeArrayElementOrder(random, array) {
|
|
20
|
-
const n = array.length;
|
|
21
|
-
|
|
22
|
-
const lastValidIndex = n - 1;
|
|
23
|
-
|
|
24
|
-
for (let i = 0; i < n; i++) {
|
|
25
|
-
const t = randomIntegerBetween(random, 0, lastValidIndex);
|
|
26
|
-
|
|
27
|
-
if (t === i) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
arraySwapElements(array, i, t);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Pick multiple random items from an array
|
|
37
|
-
*
|
|
38
|
-
* @template T
|
|
39
|
-
* @param {function} random
|
|
40
|
-
* @param {T[]} source
|
|
41
|
-
* @param {T[]} target
|
|
42
|
-
* @param {number} count how many items to pick
|
|
43
|
-
* @returns {T}
|
|
44
|
-
*/
|
|
45
|
-
export function randomMultipleFromArray(random, source, target, count) {
|
|
46
|
-
|
|
47
|
-
const order = [];
|
|
48
|
-
|
|
49
|
-
const source_length = source.length;
|
|
50
|
-
for (let i = 0; i < source_length; i++) {
|
|
51
|
-
order[i] = i;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
randomizeArrayElementOrder(random, order);
|
|
55
|
-
|
|
56
|
-
const target_length = min2(source_length, count);
|
|
57
|
-
|
|
58
|
-
for (let i = 0; i < target_length; i++) {
|
|
59
|
-
const index = order[i];
|
|
60
|
-
const element = source[index];
|
|
61
|
-
target.push(element);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return target_length;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @template T,R
|
|
69
|
-
* @param {T[]} first
|
|
70
|
-
* @param {R[]} second
|
|
71
|
-
* @return {boolean}
|
|
72
|
-
*/
|
|
73
|
-
export function isArrayEqual(first, second) {
|
|
74
|
-
|
|
75
|
-
const il = first.length;
|
|
76
|
-
|
|
77
|
-
if (il !== second.length) return false;
|
|
78
|
-
|
|
79
|
-
let i = 0;
|
|
80
|
-
|
|
81
|
-
for (; i < il; i++) {
|
|
82
|
-
|
|
83
|
-
const a = first[i];
|
|
84
|
-
const b = second[i];
|
|
85
|
-
|
|
86
|
-
if (a === b) {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (a === undefined) {
|
|
92
|
-
//a is undefined, and B is something else
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (a === null) {
|
|
97
|
-
//a is null and B is something else
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//try "equals" method
|
|
102
|
-
if (typeof a.equals === "function") {
|
|
103
|
-
|
|
104
|
-
if (!a.equals(b)) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
} else {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return true;
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* @template T
|
|
120
|
-
* @param {T[]} array
|
|
121
|
-
* @param {function(T):number} scoreFunction
|
|
122
|
-
* @returns {T[]}
|
|
123
|
-
*/
|
|
124
|
-
export function arrayPickBestElements(array, scoreFunction) {
|
|
125
|
-
assert.notEqual(array, undefined, 'array is undefined');
|
|
126
|
-
assert.isArray(array, 'array');
|
|
127
|
-
|
|
128
|
-
assert.typeOf(scoreFunction, 'function', 'scoreFunction');
|
|
129
|
-
|
|
130
|
-
let bestScore;
|
|
131
|
-
|
|
132
|
-
const size = array.length;
|
|
133
|
-
|
|
134
|
-
if (size === 0) {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const first = array[0];
|
|
139
|
-
|
|
140
|
-
bestScore = scoreFunction(first);
|
|
141
|
-
|
|
142
|
-
assert.isNumber(bestScore, 'bestScore');
|
|
143
|
-
|
|
144
|
-
const result = [first];
|
|
145
|
-
|
|
146
|
-
for (let i = 1; i < size; i++) {
|
|
147
|
-
const el = array[i];
|
|
148
|
-
|
|
149
|
-
// compute score
|
|
150
|
-
const score = scoreFunction(el);
|
|
151
|
-
|
|
152
|
-
assert.isNumber(score, 'score');
|
|
153
|
-
|
|
154
|
-
if (score > bestScore) {
|
|
155
|
-
bestScore = score;
|
|
156
|
-
|
|
157
|
-
result.splice(0, result.length);
|
|
158
|
-
|
|
159
|
-
result.push(el);
|
|
160
|
-
} else if (score === bestScore) {
|
|
161
|
-
result.push(el);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @template T
|
|
170
|
-
* @param {T[]} array
|
|
171
|
-
* @param {function(T):number} scoreFunction
|
|
172
|
-
* @returns {T}
|
|
173
|
-
*/
|
|
174
|
-
export function arrayPickMinElement(array, scoreFunction) {
|
|
175
|
-
assert.notEqual(array, undefined, 'array is undefined');
|
|
176
|
-
assert.typeOf(scoreFunction, 'function', 'scoreFunction');
|
|
177
|
-
|
|
178
|
-
let bestElement;
|
|
179
|
-
let bestScore;
|
|
180
|
-
|
|
181
|
-
const size = array.length;
|
|
182
|
-
|
|
183
|
-
if (size === 0) {
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
bestElement = array[0];
|
|
188
|
-
|
|
189
|
-
bestScore = scoreFunction(bestElement);
|
|
190
|
-
|
|
191
|
-
assert.typeOf(bestScore, 'number', 'bestScore');
|
|
192
|
-
|
|
193
|
-
for (let i = 1; i < size; i++) {
|
|
194
|
-
const el = array[i];
|
|
195
|
-
|
|
196
|
-
// compute score
|
|
197
|
-
const score = scoreFunction(el);
|
|
198
|
-
|
|
199
|
-
assert.typeOf(score, 'number', 'score');
|
|
200
|
-
|
|
201
|
-
if (score < bestScore) {
|
|
202
|
-
bestScore = score;
|
|
203
|
-
bestElement = el;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return bestElement;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @template T,K
|
|
212
|
-
* @param {T[]} array
|
|
213
|
-
* @param {function(T):K} groupingFunction
|
|
214
|
-
* @param keyHashFunction
|
|
215
|
-
* @returns {Map<K,T[]>}
|
|
216
|
-
*/
|
|
217
|
-
export function groupArrayBy(array, groupingFunction, keyHashFunction = returnZero) {
|
|
218
|
-
const result = new HashMap({
|
|
219
|
-
keyHashFunction,
|
|
220
|
-
keyEqualityFunction(a, b) {
|
|
221
|
-
if (a === b) {
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (typeof a === "object" && a !== null && typeof a.equals === "function") {
|
|
226
|
-
return a.equals(b);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
for (let i = 0; i < array.length; i++) {
|
|
234
|
-
const element = array[i];
|
|
235
|
-
|
|
236
|
-
const groupKey = groupingFunction(element);
|
|
237
|
-
|
|
238
|
-
const group = result.get(groupKey);
|
|
239
|
-
|
|
240
|
-
if (group === undefined) {
|
|
241
|
-
result.set(groupKey, [element]);
|
|
242
|
-
} else {
|
|
243
|
-
group.push(element);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* @template T
|
|
253
|
-
* @param {T[]} array
|
|
254
|
-
* @param {number} index0
|
|
255
|
-
* @param {number} index1
|
|
256
|
-
*/
|
|
257
|
-
export function arraySwapElements(array, index0, index1) {
|
|
258
|
-
const t = array[index0];
|
|
259
|
-
|
|
260
|
-
array[index0] = array[index1];
|
|
261
|
-
array[index1] = t;
|
|
262
|
-
}
|
|
263
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { orient3d_fast } from "../../plane/orient3d_fast.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Walk from a given tetrahedron in the mesh towards tetrahedron that contains input point
|
|
5
|
-
* This is an essential method for incrementally finding the next tetrahedron for cavity computation
|
|
6
|
-
*
|
|
7
|
-
* @see https://git.immc.ucl.ac.be/hextreme/hxt_seqdel/-/blob/master/src/hxt_tetrahedra.c#L330
|
|
8
|
-
* @see p3 "One machine, one minute, three billion tetrahedra" by Célestin Marot, Jeanne Pellerin, Jean-François Remacle
|
|
9
|
-
* @param {TetrahedralMesh} mesh
|
|
10
|
-
* @param {number[]} points
|
|
11
|
-
* @param {number} current_tet
|
|
12
|
-
* @param {number} current_vertex
|
|
13
|
-
* @returns {number}
|
|
14
|
-
*/
|
|
15
|
-
function tetrahedral_mesh_walk_toward_cavity(mesh, points, current_tet, current_vertex) {
|
|
16
|
-
|
|
17
|
-
let entering_face = 4;
|
|
18
|
-
|
|
19
|
-
let curTet = current_tet;
|
|
20
|
-
|
|
21
|
-
while (true) {
|
|
22
|
-
|
|
23
|
-
let i;
|
|
24
|
-
for (i = 0; i < 4; i++) {
|
|
25
|
-
|
|
26
|
-
// we walk whenever the volume is positive
|
|
27
|
-
const a_i = (i + 1) & 3;
|
|
28
|
-
const b_i = (i & 2) ^ 3;
|
|
29
|
-
const c_i = (i + 3) & 2;
|
|
30
|
-
|
|
31
|
-
const a_index = mesh.getCornerIndex(curTet, a_i);
|
|
32
|
-
const b_index = mesh.getCornerIndex(curTet, b_i);
|
|
33
|
-
const c_index = mesh.getCornerIndex(curTet, c_i);
|
|
34
|
-
|
|
35
|
-
if (i !== entering_face && orient3d_fast(points, a_index, b_index, c_index, current_vertex) < 0.0) {
|
|
36
|
-
const neighbour = mesh.getNeighbour(curTet, i);
|
|
37
|
-
curTet = neighbour >> 2;
|
|
38
|
-
entering_face = neighbour & 3;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (i === 4) {
|
|
44
|
-
return curTet;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|