@woosh/meep-engine 2.108.0 → 2.108.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 +178 -127
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +178 -127
- package/editor/tools/paint/TerrainHeightPaintTool.js +5 -5
- package/package.json +1 -1
- package/src/core/binary/float_to_uint8.d.ts +7 -0
- package/src/core/binary/float_to_uint8.d.ts.map +1 -0
- package/src/core/binary/{float2uint8.js → float_to_uint8.js} +1 -1
- package/src/core/binary/uint8_to_float.d.ts +7 -0
- package/src/core/binary/uint8_to_float.d.ts.map +1 -0
- package/src/core/binary/{uint82float.js → uint8_to_float.js} +1 -1
- package/src/core/binary/uint8_to_float.spec.d.ts +2 -0
- package/src/core/binary/uint8_to_float.spec.d.ts.map +1 -0
- package/src/core/binary/uint8_to_float.spec.js +7 -0
- package/src/core/codegen/codeToBlob.d.ts +8 -0
- package/src/core/codegen/codeToBlob.d.ts.map +1 -0
- package/src/core/codegen/codeToBlob.js +36 -0
- package/src/core/codegen/codeToURL.d.ts +8 -0
- package/src/core/codegen/codeToURL.d.ts.map +1 -0
- package/src/core/codegen/codeToURL.js +22 -0
- package/src/core/collection/array/array_shuffle.d.ts +8 -0
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -0
- package/src/core/collection/array/array_shuffle.js +22 -0
- package/src/core/collection/array/array_shuffle.spec.d.ts +2 -0
- package/src/core/collection/array/array_shuffle.spec.d.ts.map +1 -0
- package/src/core/collection/array/{randomizeArrayElementOrder.spec.js → array_shuffle.spec.js} +4 -4
- package/src/core/collection/array/iterator/ArrayIteratorRandom.js +2 -2
- package/src/core/collection/array/randomMultipleFromArray.js +2 -2
- package/src/core/color/Color.js +9 -9
- package/src/core/color/hsv/hsv2rgb.js +4 -4
- package/src/core/color/rgb2uint24.js +4 -4
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +1 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +4 -4
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +4 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_ray.js +3 -3
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +14 -14
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.js +2 -0
- package/src/core/geom/Vector3.js +3 -3
- package/src/core/geom/random/randomPointInSphere.d.ts +1 -1
- package/src/core/geom/random/randomPointInSphere.js +2 -2
- package/src/core/geom/random/randomPointOnSphere.d.ts +3 -3
- package/src/core/geom/random/randomPointOnSphere.d.ts.map +1 -1
- package/src/core/geom/random/randomPointOnSphere.js +5 -9
- package/src/core/process/task/util/randomCountTask.js +3 -3
- package/src/core/process/worker/WorkerBuilder.d.ts.map +1 -1
- package/src/core/process/worker/WorkerBuilder.js +5 -35
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +7 -1
- package/src/engine/asset/loaders/ArrayBufferLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/ArrayBufferLoader.js +17 -10
- package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.js +3 -0
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +4 -4
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +4 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +7 -7
- package/src/engine/graphics/impostors/octahedral/bake/prepare_bake_material.js +3 -3
- package/src/engine/graphics/sh3/SH3VisualisationMaterial.d.ts.map +1 -1
- package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -6
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -5
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +14 -6
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.js +20 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.js +31 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts +9 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.js +21 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.js +2 -3
- package/src/engine/graphics/sh3/path_tracer/vec3_uint8_to_float.js +4 -4
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +74 -6
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +2 -2
- package/src/engine/network/convertPathToURL.d.ts +3 -1
- package/src/engine/network/convertPathToURL.d.ts.map +1 -1
- package/src/engine/network/convertPathToURL.js +68 -51
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +4 -4
- package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
- package/src/generation/filtering/numeric/CellFilterCache.js +1 -0
- package/src/core/binary/float2uint8.d.ts +0 -7
- package/src/core/binary/float2uint8.d.ts.map +0 -1
- package/src/core/binary/uint82float.d.ts +0 -7
- package/src/core/binary/uint82float.d.ts.map +0 -1
- package/src/core/binary/uint82float.spec.d.ts +0 -2
- package/src/core/binary/uint82float.spec.d.ts.map +0 -1
- package/src/core/binary/uint82float.spec.js +0 -7
- package/src/core/collection/array/randomizeArrayElementOrder.d.ts +0 -8
- package/src/core/collection/array/randomizeArrayElementOrder.d.ts.map +0 -1
- package/src/core/collection/array/randomizeArrayElementOrder.js +0 -24
- package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts +0 -2
- package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts.map +0 -1
|
@@ -3,9 +3,12 @@ import {
|
|
|
3
3
|
DataTexture,
|
|
4
4
|
LinearFilter,
|
|
5
5
|
MeshBasicMaterial,
|
|
6
|
+
MeshStandardMaterial,
|
|
6
7
|
NearestFilter,
|
|
7
8
|
PlaneBufferGeometry,
|
|
9
|
+
RepeatWrapping,
|
|
8
10
|
RGBAFormat,
|
|
11
|
+
TextureLoader,
|
|
9
12
|
UnsignedByteType
|
|
10
13
|
} from "three";
|
|
11
14
|
import '../../../../../../../css/game.scss';
|
|
@@ -13,7 +16,10 @@ import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
|
|
|
13
16
|
import { array_copy } from "../../../core/collection/array/array_copy.js";
|
|
14
17
|
import { is_typed_array_equals } from "../../../core/collection/array/typed/is_typed_array_equals.js";
|
|
15
18
|
import { Color } from "../../../core/color/Color.js";
|
|
19
|
+
import { kelvin_to_rgb } from "../../../core/color/kelvin/kelvin_to_rgb.js";
|
|
20
|
+
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
16
21
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
22
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
17
23
|
import { randomFloatBetween } from "../../../core/math/random/randomFloatBetween.js";
|
|
18
24
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
19
25
|
import { number_pretty_print } from "../../../core/primitives/numbers/number_pretty_print.js";
|
|
@@ -27,6 +33,8 @@ import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSyste
|
|
|
27
33
|
import { TransformAttachmentSystem } from "../../ecs/transform-attachment/TransformAttachmentSystem.js";
|
|
28
34
|
import { Transform } from "../../ecs/transform/Transform.js";
|
|
29
35
|
import { EngineHarness } from "../../EngineHarness.js";
|
|
36
|
+
import { Camera } from "../ecs/camera/Camera.js";
|
|
37
|
+
import TopDownCameraController from "../ecs/camera/topdown/TopDownCameraController.js";
|
|
30
38
|
import { Light } from "../ecs/light/Light.js";
|
|
31
39
|
import LightSystem from "../ecs/light/LightSystem.js";
|
|
32
40
|
import { LightType } from "../ecs/light/LightType.js";
|
|
@@ -234,6 +242,40 @@ async function getVolume({ engine, path }) {
|
|
|
234
242
|
return volume;
|
|
235
243
|
}
|
|
236
244
|
|
|
245
|
+
function createFloor({ level, ecd }) {
|
|
246
|
+
|
|
247
|
+
const texture_frequency = 10;
|
|
248
|
+
const size = 1000;
|
|
249
|
+
|
|
250
|
+
const map = new TextureLoader().load('data/textures/utility/checkers_dark_grey_256x256.png', t => {
|
|
251
|
+
map.needsUpdate = true;
|
|
252
|
+
|
|
253
|
+
map.wrapS = RepeatWrapping;
|
|
254
|
+
map.wrapT = RepeatWrapping;
|
|
255
|
+
|
|
256
|
+
map.repeat.set(size / texture_frequency, size / texture_frequency);
|
|
257
|
+
|
|
258
|
+
map.matrixAutoUpdate = true;
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
new Entity()
|
|
263
|
+
.add(Transform.fromJSON({
|
|
264
|
+
position: {
|
|
265
|
+
x: 0,
|
|
266
|
+
y: level,
|
|
267
|
+
z: 0
|
|
268
|
+
},
|
|
269
|
+
rotation: Quaternion.fromEulerAngles(-Math.PI * 0.5, 0, 0),
|
|
270
|
+
scale: size
|
|
271
|
+
}))
|
|
272
|
+
.add(ShadedGeometry.from(new PlaneBufferGeometry(1, 1), new MeshStandardMaterial({
|
|
273
|
+
map: map
|
|
274
|
+
})))
|
|
275
|
+
.build(ecd);
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
237
279
|
/**
|
|
238
280
|
*
|
|
239
281
|
* @param {Engine} engine
|
|
@@ -254,12 +296,16 @@ async function main(engine) {
|
|
|
254
296
|
// shadowmapResolution: 4096
|
|
255
297
|
});
|
|
256
298
|
|
|
299
|
+
const sun_color = new Color();
|
|
300
|
+
|
|
301
|
+
kelvin_to_rgb(sun_color, 0, 6000);
|
|
302
|
+
|
|
257
303
|
await EngineHarness.buildLights({
|
|
258
304
|
engine,
|
|
259
305
|
shadowmapResolution: 4096,
|
|
260
|
-
ambientIntensity: 0.
|
|
261
|
-
sun:
|
|
262
|
-
sunIntensity:
|
|
306
|
+
ambientIntensity: 0.01,
|
|
307
|
+
sun: sun_color,
|
|
308
|
+
sunIntensity: 1,
|
|
263
309
|
sunDirection: new Vector3(0.5, -1, 0.3)
|
|
264
310
|
})
|
|
265
311
|
|
|
@@ -272,16 +318,28 @@ async function main(engine) {
|
|
|
272
318
|
|
|
273
319
|
// const path = 'data/models/LowPolyTownshipSet/Small_house/Small_house.gltf';
|
|
274
320
|
// const path = 'data/models/sibenik/2/model.gltf';
|
|
275
|
-
|
|
321
|
+
const path = 'data/models/sibenik/3-window-less/model.gltf';
|
|
276
322
|
// const path = 'data/models/vokselia_spawn/model.gltf';
|
|
277
|
-
const path = 'data/models/sponza-pbr/gltf/sponza.glb';
|
|
278
323
|
// const path = 'data/models/LowPolyTownshipSet/Town_Hall/model.gltf';
|
|
279
|
-
// const path = 'data/models/Slaughter Mech/Slaugter Mech.gltf';
|
|
280
324
|
// const path = 'data/models/pica_pica/pica_pica.gltf';
|
|
325
|
+
// const path = 'data/models/samples/low_poly_classroom/no-glass/model.gltf';
|
|
326
|
+
// const path = 'data/models/samples/just_a_girl/scene.gltf';
|
|
327
|
+
// const path = 'data/models/samples/slum_house/scene.gltf';
|
|
328
|
+
// const path = 'data/models/samples/jack_trigger/scene.gltf';
|
|
329
|
+
// const path = 'data/models/samples/cornell_box/scene.gltf';
|
|
330
|
+
// const path = 'data/models/samples/cyberpunk_bike/scene.gltf';
|
|
331
|
+
// const path = 'data/models/samples/sd_macross_city_standoff_diorama/scene.gltf';
|
|
332
|
+
// const path = 'data/models/Slaughter Mech/Slaugter Mech.gltf';
|
|
333
|
+
// const path = 'data/models/sponza-pbr/gltf/sponza.glb';
|
|
334
|
+
// const path = 'data/models/samples/gi_box_01/model.glb';
|
|
281
335
|
|
|
282
336
|
const mesh_asset = await engine.assetManager.promise(path, 'model/gltf+json');
|
|
283
337
|
const gltf = mesh_asset.gltf;
|
|
284
338
|
|
|
339
|
+
console.log(gltf);
|
|
340
|
+
|
|
341
|
+
// add floor
|
|
342
|
+
|
|
285
343
|
// make_cornel_box(ecd);
|
|
286
344
|
|
|
287
345
|
const mesh_entity = new Entity();
|
|
@@ -290,6 +348,10 @@ async function main(engine) {
|
|
|
290
348
|
.add(SGMesh.fromURL(path))
|
|
291
349
|
;
|
|
292
350
|
|
|
351
|
+
createFloor({
|
|
352
|
+
level: mesh_asset.boundingBox.y0,
|
|
353
|
+
ecd
|
|
354
|
+
});
|
|
293
355
|
|
|
294
356
|
const composition = three_object_to_entity_composition(gltf.scene);
|
|
295
357
|
|
|
@@ -307,6 +369,8 @@ async function main(engine) {
|
|
|
307
369
|
});
|
|
308
370
|
|
|
309
371
|
composition.transform.scale.setScalar(1);
|
|
372
|
+
//
|
|
373
|
+
// composition.transform.rotation.fromEulerAngles(0, Math.PI, 0);
|
|
310
374
|
|
|
311
375
|
composition.build(ecd);
|
|
312
376
|
|
|
@@ -317,6 +381,10 @@ async function main(engine) {
|
|
|
317
381
|
const model_footprint = Math.hypot(mesh_bounds.getExtentsX(), mesh_bounds.getExtentsY(), mesh_bounds.getExtentsZ());
|
|
318
382
|
|
|
319
383
|
|
|
384
|
+
const camera = ecd.getAnyComponent(Camera);
|
|
385
|
+
camera.component.clip_far = max2(100, model_footprint);
|
|
386
|
+
ecd.getComponent(camera.entity, TopDownCameraController).distanceMax = model_footprint * 1.1;
|
|
387
|
+
|
|
320
388
|
const random = seededRandom();
|
|
321
389
|
|
|
322
390
|
for (let i = 0; i < 0; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH;IAk8BI;;;;;;OAMG;IACH,6DAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,qDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IA3iCD;;;;;;;OAOG;IACH,mBANW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,aACzI,MAAM,UACN,MAAM,WACN,MAAM,EAmDhB;IA7BG;;;OAGG;IACH,cAAkB;IAElB;;;OAGG;IACH,eAAoB;IAEpB;;;OAGG;IACH,iBAAwB;IAExB;;;OAGG;IACH,MAFU,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,CAEjH;IAEhB;;;OAGG;IACH,SAFU,MAAM,CAEA;IAGpB;;;;;;;OAOG;IACH,OALW,MAAM,KACN,MAAM,UACN,qCAA+B,GAC7B,MAAM,CAIlB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,6BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,2BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CA2DlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,QAUhB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAgFlB;IAED;;;;;;OAMG;IACH,oBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH;IAk8BI;;;;;;OAMG;IACH,6DAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,qDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IAED;;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G;IACH,mBAFY,MAAM,CAYjB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACR,OAAO,CAYlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAYjB;IAGD;;OAEG;IACH,SAFa,SAAS,CAerB;IAED;;;;;;MAUC;IAED;;;;;;aAwBC;IAgHL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;;kBAUS,MAAM"}
|
|
@@ -321,7 +321,7 @@ export class Sampler2D {
|
|
|
321
321
|
*
|
|
322
322
|
* @param {number} u
|
|
323
323
|
* @param {number} v
|
|
324
|
-
* @param {number[]} result
|
|
324
|
+
* @param {number[]|Float32Array} result
|
|
325
325
|
* @param {number} result_offset
|
|
326
326
|
*/
|
|
327
327
|
sampleBilinearUV(u, v, result, result_offset = 0) {
|
|
@@ -458,7 +458,7 @@ export class Sampler2D {
|
|
|
458
458
|
*
|
|
459
459
|
* @param {number} u
|
|
460
460
|
* @param {number} v
|
|
461
|
-
* @param {ArrayLike<number>} result
|
|
461
|
+
* @param {number[]|ArrayLike<number>} result
|
|
462
462
|
*/
|
|
463
463
|
sampleNearestUV(u, v, result) {
|
|
464
464
|
const w = this.width;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Given a path, which may be a local path, produce a fully qualified URL
|
|
3
|
+
* @example '/path' -> 'http://example.com/path'
|
|
4
|
+
* @example 'some/local/path' -> 'http://example.com/current_path/some/local/path'
|
|
3
5
|
* @param {string} path
|
|
4
6
|
* @return {string}
|
|
5
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertPathToURL.d.ts","sourceRoot":"","sources":["../../../../src/engine/network/convertPathToURL.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convertPathToURL.d.ts","sourceRoot":"","sources":["../../../../src/engine/network/convertPathToURL.js"],"names":[],"mappings":"AAuFA;;;;;;GAMG;AACH,uCAHW,MAAM,GACL,MAAM,CAcjB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { assert } from "../../core/assert.js";
|
|
2
|
+
|
|
1
3
|
const rx_url_schema = /[a-zA-Z0-9_\-]+\:\/\//;
|
|
2
4
|
|
|
3
5
|
/**
|
|
@@ -21,70 +23,85 @@ const ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENV
|
|
|
21
23
|
* @param {string} path
|
|
22
24
|
* @return {string}
|
|
23
25
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
function localPathToGlobal(path) {
|
|
27
|
+
/**
|
|
28
|
+
* @type {Window|DedicatedWorkerGlobalScope}
|
|
29
|
+
*/
|
|
30
|
+
let scope;
|
|
31
|
+
|
|
32
|
+
if (ENVIRONMENT_IS_WEB) {
|
|
33
|
+
scope = window;
|
|
34
|
+
} else if (ENVIRONMENT_IS_WORKER) {
|
|
35
|
+
scope = self;
|
|
36
|
+
} else if (ENVIRONMENT_IS_NODE) {
|
|
37
|
+
|
|
38
|
+
let normalized_path = `${process.cwd()}/`.replace(/\\/g, '/');
|
|
39
|
+
|
|
40
|
+
// remove multiple sequential slashes
|
|
41
|
+
normalized_path = normalized_path.replace(/\/+/g, '/');
|
|
42
|
+
|
|
43
|
+
if (normalized_path[0] !== '/') {
|
|
44
|
+
// Windows drive letter must be prefixed with a slash.
|
|
45
|
+
normalized_path = `/${normalized_path}`;
|
|
46
|
+
}
|
|
27
47
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
scope = {
|
|
49
|
+
location: {
|
|
50
|
+
pathname: normalized_path,
|
|
51
|
+
host: '',
|
|
52
|
+
protocol: 'file:'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
throw new Error('Unknown environment');
|
|
57
|
+
}
|
|
32
58
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} else if (ENVIRONMENT_IS_WORKER) {
|
|
36
|
-
scope = self;
|
|
37
|
-
} else if (ENVIRONMENT_IS_NODE) {
|
|
59
|
+
const location = scope.location;
|
|
60
|
+
const pathname = location.pathname;
|
|
38
61
|
|
|
39
|
-
|
|
62
|
+
let directoryPath;
|
|
40
63
|
|
|
41
|
-
|
|
42
|
-
|
|
64
|
+
/*
|
|
65
|
+
path name contains file name also, there are two options here, "a/b" or "a/b/" second is a directory
|
|
66
|
+
we need to extract directory to load relative path
|
|
67
|
+
*/
|
|
43
68
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
69
|
+
if (pathname.endsWith('/')) {
|
|
70
|
+
//path is to a directory, strip last slash
|
|
71
|
+
directoryPath = pathname.substring(0, pathname.length - 1);
|
|
72
|
+
} else {
|
|
73
|
+
//path is to a file
|
|
74
|
+
const i = pathname.lastIndexOf('/');
|
|
48
75
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
host: '',
|
|
53
|
-
protocol: 'file:'
|
|
54
|
-
}
|
|
55
|
-
};
|
|
76
|
+
if (i === -1) {
|
|
77
|
+
//root level file
|
|
78
|
+
directoryPath = ""
|
|
56
79
|
} else {
|
|
57
|
-
|
|
80
|
+
directoryPath = pathname.substring(0, i);
|
|
58
81
|
}
|
|
82
|
+
}
|
|
59
83
|
|
|
60
|
-
|
|
61
|
-
|
|
84
|
+
const urlBase = location.protocol + "//" + location.host + directoryPath + "/";
|
|
85
|
+
return urlBase + path;
|
|
86
|
+
}
|
|
62
87
|
|
|
63
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Given a path, which may be a local path, produce a fully qualified URL
|
|
90
|
+
* @example '/path' -> 'http://example.com/path'
|
|
91
|
+
* @example 'some/local/path' -> 'http://example.com/current_path/some/local/path'
|
|
92
|
+
* @param {string} path
|
|
93
|
+
* @return {string}
|
|
94
|
+
*/
|
|
95
|
+
export function convertPathToURL(path) {
|
|
96
|
+
assert.isString(path, 'path');
|
|
64
97
|
|
|
65
|
-
|
|
66
|
-
path name contains file name also, there are two options here, "a/b" or "a/b/" second is a directory
|
|
67
|
-
we need to extract directory to load relative path
|
|
68
|
-
*/
|
|
98
|
+
const is_global = isGlobalPath(path);
|
|
69
99
|
|
|
70
|
-
|
|
71
|
-
//path is to a directory, strip last slash
|
|
72
|
-
directoryPath = pathname.substring(0, pathname.length - 1);
|
|
73
|
-
} else {
|
|
74
|
-
//path is to a file
|
|
75
|
-
const i = pathname.lastIndexOf('/');
|
|
76
|
-
|
|
77
|
-
if (i === -1) {
|
|
78
|
-
//root level file
|
|
79
|
-
directoryPath = ""
|
|
80
|
-
} else {
|
|
81
|
-
directoryPath = pathname.substring(0, i);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
100
|
+
let result = path;
|
|
84
101
|
|
|
85
|
-
|
|
86
|
-
|
|
102
|
+
if (!is_global) {
|
|
103
|
+
result = localPathToGlobal(path);
|
|
87
104
|
}
|
|
88
105
|
|
|
89
|
-
return
|
|
106
|
+
return result;
|
|
90
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceVisualiser.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/SliceVisualiser.js"],"names":[],"mappings":"AAMA;IAsBI;;OAEG;IACH,cAMC;IAED,aAgCC;IAED,eAkBC;IAED;;;;OAIG;IACH,cAHW,WAAW,cACX,MAAM,EAAE,QAkElB;;CAEJ;
|
|
1
|
+
{"version":3,"file":"SliceVisualiser.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/SliceVisualiser.js"],"names":[],"mappings":"AAMA;IAsBI;;OAEG;IACH,cAMC;IAED,aAgCC;IAED,eAkBC;IAED;;;;OAIG;IACH,cAHW,WAAW,cACX,MAAM,EAAE,QAkElB;;CAEJ;sBAjKqB,qCAAqC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { float2uint8 } from "../../../core/binary/float2uint8.js";
|
|
1
|
+
import { float_to_uint8 } from "../../../core/binary/float_to_uint8.js";
|
|
3
2
|
import { max2 } from "../../../core/math/max2.js";
|
|
4
|
-
import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
5
3
|
import { CanvasView } from "../../../view/elements/CanvasView.js";
|
|
4
|
+
import EmptyView from "../../../view/elements/EmptyView.js";
|
|
5
|
+
import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
6
6
|
|
|
7
7
|
export class SliceVisualiser extends EmptyView {
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ export class SliceVisualiser extends EmptyView {
|
|
|
16
16
|
let i = 0;
|
|
17
17
|
|
|
18
18
|
for (; i < channelCount; i++) {
|
|
19
|
-
out[out_offset + i] =
|
|
19
|
+
out[out_offset + i] = float_to_uint8(sample[i])
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (channelCount < 4) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellFilterCache.d.ts","sourceRoot":"","sources":["../../../../../src/generation/filtering/numeric/CellFilterCache.js"],"names":[],"mappings":"AAIA;IAeI;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,eAAe,
|
|
1
|
+
{"version":3,"file":"CellFilterCache.d.ts","sourceRoot":"","sources":["../../../../../src/generation/filtering/numeric/CellFilterCache.js"],"names":[],"mappings":"AAIA;IAeI;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,eAAe,CAW3B;IA5BD;;;;OAIG;IACH,gBAAqC;IAErC;;;OAGG;IACH,OAFU,MAAM,CAEN;CA0Db;yCAzEwC,qCAAqC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"float2uint8.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/float2uint8.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,CAIlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uint82float.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/uint82float.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,CAIlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uint82float.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/uint82float.spec.js"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"randomizeArrayElementOrder.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/randomizeArrayElementOrder.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,kFAcC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { randomIntegerBetween } from "../../math/random/randomIntegerBetween.js";
|
|
2
|
-
import { array_swap_one } from "./array_swap_one.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Randomly re-orders of items in-place
|
|
6
|
-
* @template T
|
|
7
|
-
* @param {function} random
|
|
8
|
-
* @param {T[]} array
|
|
9
|
-
*/
|
|
10
|
-
export function randomizeArrayElementOrder(random, array) {
|
|
11
|
-
const n = array.length;
|
|
12
|
-
|
|
13
|
-
const lastValidIndex = n - 1;
|
|
14
|
-
|
|
15
|
-
for (let i = 0; i < n; i++) {
|
|
16
|
-
const t = randomIntegerBetween(random, 0, lastValidIndex);
|
|
17
|
-
|
|
18
|
-
if (t === i) {
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
array_swap_one(array, i, t);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"randomizeArrayElementOrder.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/randomizeArrayElementOrder.spec.js"],"names":[],"mappings":""}
|