@woosh/meep-engine 2.97.0 → 2.98.1
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/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +861 -670
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +861 -670
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.js +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.js +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.js +3 -2
- package/src/core/collection/array/arrayQuickSort.js +2 -2
- package/src/core/collection/array/array_compute_max.d.ts +9 -0
- package/src/core/collection/array/array_compute_max.d.ts.map +1 -0
- package/src/core/collection/array/{computeArrayMax.js → array_compute_max.js} +1 -1
- package/src/core/collection/array/array_compute_min.d.ts +9 -0
- package/src/core/collection/array/array_compute_min.d.ts.map +1 -0
- package/src/core/collection/array/{computeArrayMin.js → array_compute_min.js} +1 -1
- package/src/core/collection/array/array_compute_min_max.d.ts.map +1 -1
- package/src/core/collection/array/array_compute_min_max.js +1 -0
- package/src/core/collection/array/array_swap.d.ts.map +1 -1
- package/src/core/collection/array/array_swap.js +11 -8
- package/src/core/collection/array/array_swap_one.d.ts +8 -0
- package/src/core/collection/array/array_swap_one.d.ts.map +1 -0
- package/src/core/collection/array/{arraySwapElements.js → array_swap_one.js} +1 -1
- package/src/core/collection/array/iterator/AbstractArrayIterator.d.ts.map +1 -0
- package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts.map +1 -0
- package/src/core/collection/array/{ArrayIteratorRandom.js → iterator/ArrayIteratorRandom.js} +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorSequential.d.ts.map +1 -0
- package/src/core/collection/array/randomizeArrayElementOrder.js +2 -2
- package/src/core/collection/map/HashMap.js +10 -10
- package/src/core/collection/map/ObservedMap.d.ts +7 -4
- package/src/core/collection/map/ObservedMap.d.ts.map +1 -1
- package/src/core/collection/map/ObservedMap.js +4 -1
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +82 -36
- package/src/core/collection/set/compute_set_difference.d.ts.map +1 -1
- package/src/core/collection/set/compute_set_difference.js +8 -0
- package/src/core/collection/set/compute_set_difference.spec.d.ts +2 -0
- package/src/core/collection/set/compute_set_difference.spec.d.ts.map +1 -0
- package/src/core/collection/set/compute_set_difference.spec.js +45 -0
- package/src/core/collection/set/compute_set_intersection.d.ts +1 -0
- package/src/core/collection/set/compute_set_intersection.d.ts.map +1 -1
- package/src/core/collection/set/compute_set_intersection.js +9 -0
- package/src/core/collection/set/compute_set_intersection.spec.d.ts +2 -0
- package/src/core/collection/set/compute_set_intersection.spec.d.ts.map +1 -0
- package/src/core/collection/set/compute_set_intersection.spec.js +45 -0
- package/src/core/collection/set/set_remove.d.ts +2 -0
- package/src/core/collection/set/set_remove.d.ts.map +1 -1
- package/src/core/collection/set/set_remove.js +2 -0
- package/src/core/color/oklab/XYZ.spec.d.ts +2 -0
- package/src/core/color/oklab/XYZ.spec.d.ts.map +1 -0
- package/src/core/color/oklab/XYZ.spec.js +17 -0
- package/src/core/color/oklab/oklab_to_xyz.d.ts +9 -0
- package/src/core/color/oklab/oklab_to_xyz.d.ts.map +1 -0
- package/src/core/color/oklab/oklab_to_xyz.js +32 -0
- package/src/core/color/oklab/oklab_to_xyz.spec.d.ts +2 -0
- package/src/core/color/oklab/oklab_to_xyz.spec.d.ts.map +1 -0
- package/src/core/color/oklab/oklab_to_xyz.spec.js +31 -0
- package/src/core/color/oklab/xyz_to_oklab.d.ts +8 -0
- package/src/core/color/oklab/xyz_to_oklab.d.ts.map +1 -0
- package/src/core/color/oklab/xyz_to_oklab.js +29 -0
- package/src/core/color/oklab/xyz_to_oklab.spec.d.ts +2 -0
- package/src/core/color/oklab/xyz_to_oklab.spec.d.ts.map +1 -0
- package/src/core/color/oklab/xyz_to_oklab.spec.js +31 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +16 -5
- package/src/core/color/sRGB/sRGB_to_linear.d.ts.map +1 -1
- package/src/core/color/sRGB/sRGB_to_linear.js +17 -5
- package/src/core/color/xyz/rgb_to_xyz.d.ts +1 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
- package/src/core/color/xyz/rgb_to_xyz.js +4 -3
- package/src/core/color/xyz/xyz_to_rgb.d.ts +1 -1
- package/src/core/color/xyz/xyz_to_rgb.js +4 -4
- package/src/core/geom/3d/aabb/aabb3_intersects_ray.js +10 -10
- package/src/core/parser/simple/ParserError.d.ts +11 -6
- package/src/core/parser/simple/ParserError.d.ts.map +1 -1
- package/src/core/parser/simple/ParserError.js +51 -4
- package/src/core/parser/simple/Token.d.ts.map +1 -1
- package/src/core/parser/simple/Token.js +8 -2
- package/src/core/parser/simple/TokenType.d.ts +1 -5
- package/src/core/parser/simple/TokenType.d.ts.map +1 -1
- package/src/core/parser/simple/TokenType.js +1 -1
- package/src/core/parser/simple/readBooleanToken.d.ts.map +1 -1
- package/src/core/parser/simple/readBooleanToken.js +6 -1
- package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
- package/src/core/parser/simple/readHexToken.js +7 -2
- package/src/core/parser/simple/readIdentifierToken.d.ts.map +1 -1
- package/src/core/parser/simple/readIdentifierToken.js +6 -1
- package/src/core/parser/simple/readLiteralToken.d.ts.map +1 -1
- package/src/core/parser/simple/readLiteralToken.js +8 -3
- package/src/core/parser/simple/readNumberToken.d.ts.map +1 -1
- package/src/core/parser/simple/readNumberToken.js +7 -2
- package/src/core/parser/simple/readReferenceToken.d.ts.map +1 -1
- package/src/core/parser/simple/readReferenceToken.js +6 -1
- package/src/core/parser/simple/readStringToken.d.ts.map +1 -1
- package/src/core/parser/simple/readStringToken.js +6 -1
- package/src/core/parser/simple/readUnsignedIntegerToken.d.ts.map +1 -1
- package/src/core/parser/simple/readUnsignedIntegerToken.js +7 -2
- package/src/core/parser/simple/skipWhitespace.d.ts.map +1 -1
- package/src/core/parser/simple/skipWhitespace.js +8 -0
- package/src/core/primitives/strings/string_repeat.d.ts +9 -0
- package/src/core/primitives/strings/string_repeat.d.ts.map +1 -0
- package/src/core/primitives/strings/string_repeat.js +26 -0
- package/src/engine/asset/AssetManager.d.ts.map +1 -1
- package/src/engine/development/performance/RingBufferMetric.d.ts.map +1 -1
- package/src/engine/development/performance/RingBufferMetric.js +5 -5
- package/src/engine/ecs/terrain/ecs/BuildLightTexture.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/BuildLightTexture.js +15 -22
- package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/Camera.js +23 -16
- package/src/engine/graphics/filter/ImageFilter.d.ts +2 -2
- package/src/engine/graphics/filter/ImageFilter.d.ts.map +1 -1
- package/src/engine/graphics/filter/ImageFilter.js +3 -3
- package/src/engine/graphics/render/RendererPool.d.ts +14 -1
- package/src/engine/graphics/render/RendererPool.d.ts.map +1 -1
- package/src/engine/graphics/render/RendererPool.js +43 -1
- package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts +2 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +23 -50
- package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.d.ts +9 -0
- package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.js +53 -3
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +3 -3
- package/src/engine/graphics/texture/sampler/convertTexture2Sampler2D.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/convertTexture2Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/convertTexture2Sampler2D.js +42 -36
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler.d.ts +3 -0
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler.js +34 -0
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler_grid.d.ts +10 -0
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler_grid.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler_grid.js +89 -0
- package/src/engine/graphics/texture/sampler/debug/prototypeSamplerFiltering.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{prototypeSamplerFiltering.js → debug/prototypeSamplerFiltering.js} +105 -113
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +8 -8
- package/src/generation/markers/GridActionRuleSet.d.ts.map +1 -1
- package/src/generation/markers/GridActionRuleSet.js +5 -5
- package/src/core/binary/byteArrayToString.d.ts +0 -9
- package/src/core/binary/byteArrayToString.d.ts.map +0 -1
- package/src/core/binary/byteArrayToString.js +0 -28
- package/src/core/collection/array/AbstractArrayIterator.d.ts.map +0 -1
- package/src/core/collection/array/ArrayIteratorRandom.d.ts.map +0 -1
- package/src/core/collection/array/ArrayIteratorSequential.d.ts.map +0 -1
- package/src/core/collection/array/arrayPickMinElement.d.ts +0 -8
- package/src/core/collection/array/arrayPickMinElement.d.ts.map +0 -1
- package/src/core/collection/array/arrayPickMinElement.js +0 -43
- package/src/core/collection/array/arraySwapElements.d.ts +0 -8
- package/src/core/collection/array/arraySwapElements.d.ts.map +0 -1
- package/src/core/collection/array/computeArrayMax.d.ts +0 -9
- package/src/core/collection/array/computeArrayMax.d.ts.map +0 -1
- package/src/core/collection/array/computeArrayMin.d.ts +0 -9
- package/src/core/collection/array/computeArrayMin.d.ts.map +0 -1
- package/src/core/color/hsluv/HSLuv.d.ts +0 -13
- package/src/core/color/hsluv/HSLuv.d.ts.map +0 -1
- package/src/core/color/hsluv/HSLuv.js +0 -187
- package/src/engine/graphics/texture/sampler/prototypeSamplerFiltering.d.ts.map +0 -1
- /package/src/core/collection/array/{AbstractArrayIterator.d.ts → iterator/AbstractArrayIterator.d.ts} +0 -0
- /package/src/core/collection/array/{AbstractArrayIterator.js → iterator/AbstractArrayIterator.js} +0 -0
- /package/src/core/collection/array/{ArrayIteratorRandom.d.ts → iterator/ArrayIteratorRandom.d.ts} +0 -0
- /package/src/core/collection/array/{ArrayIteratorSequential.d.ts → iterator/ArrayIteratorSequential.d.ts} +0 -0
- /package/src/core/collection/array/{ArrayIteratorSequential.js → iterator/ArrayIteratorSequential.js} +0 -0
- /package/src/engine/graphics/texture/sampler/{prototypeSamplerFiltering.d.ts → debug/prototypeSamplerFiltering.d.ts} +0 -0
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @see https://github.com/hsluv/hsluv-c/blob/master/src/hsluv.c
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const temp_0 = new Float32Array(3);
|
|
6
|
-
const temp_1 = new Float32Array(3);
|
|
7
|
-
/* for RGB */
|
|
8
|
-
const m = new Float32Array([
|
|
9
|
-
3.24096994190452134377, -1.53738317757009345794, -0.49861076029300328366,
|
|
10
|
-
-0.96924363628087982613, 1.87596750150772066772, 0.04155505740717561247,
|
|
11
|
-
0.05563007969699360846, -0.20397695888897656435, 1.05697151424287856072
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
/* for XYZ */
|
|
15
|
-
const m_inv = new Float32Array([
|
|
16
|
-
0.41239079926595948129, 0.35758433938387796373, 0.18048078840183428751,
|
|
17
|
-
0.21263900587151035754, 0.71516867876775592746, 0.07219231536073371500,
|
|
18
|
-
0.01933081871559185069, 0.11919477979462598791, 0.95053215224966058086
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
function dot_product(t1, offset_1, t2, offset_2) {
|
|
22
|
-
return t1[offset_1] * t2[offset_2] + t1[offset_1 + 1] * t2[offset_2 + 1] + t1[offset_1 + 2] * t2[offset_2 + 2];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Used for rgb conversions */
|
|
26
|
-
|
|
27
|
-
function from_linear(c) {
|
|
28
|
-
if (c <= 0.0031308)
|
|
29
|
-
return 12.92 * c;
|
|
30
|
-
else
|
|
31
|
-
return 1.055 * Math.pow(c, 1.0 / 2.4) - 0.055;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function to_linear(c) {
|
|
35
|
-
if (c > 0.04045)
|
|
36
|
-
return Math.pow((c + 0.055) / 1.055, 2.4);
|
|
37
|
-
else
|
|
38
|
-
return c / 12.92;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const ref_u = 0.19783000664283680764;
|
|
42
|
-
const ref_v = 0.46831999493879100370;
|
|
43
|
-
|
|
44
|
-
const kappa = 903.29629629629629629630;
|
|
45
|
-
const epsilon = 0.00885645167903563082;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {number} theta
|
|
51
|
-
* @param {number[]|Float32Array} line
|
|
52
|
-
* @param {number} line_address
|
|
53
|
-
* @return {number}
|
|
54
|
-
*/
|
|
55
|
-
function ray_length_until_intersect(theta, line, line_address) {
|
|
56
|
-
return line[line_address + 1] / (Math.sin(theta) - line[line_address] * Math.cos(theta));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function get_bounds( l, bounds)
|
|
60
|
-
{
|
|
61
|
-
const tl = l + 16.0;
|
|
62
|
-
const sub1 = (tl * tl * tl) / 1560896.0;
|
|
63
|
-
const sub2 = (sub1 > epsilon ? sub1 : (l / kappa));
|
|
64
|
-
let channel;
|
|
65
|
-
let t;
|
|
66
|
-
|
|
67
|
-
for(channel = 0; channel < 3; channel++) {
|
|
68
|
-
const ch3 = channel*3;
|
|
69
|
-
let m1 = m[ch3];
|
|
70
|
-
let m2 = m[ch3+1];
|
|
71
|
-
let m3 = m[ch3+2];
|
|
72
|
-
|
|
73
|
-
for (t = 0; t < 2; t++) {
|
|
74
|
-
const top1 = (284517.0 * m1 - 94839.0 * m3) * sub2;
|
|
75
|
-
const top2 = (838422.0 * m3 + 769860.0 * m2 + 731718.0 * m1) * l * sub2 - 769860.0 * t * l;
|
|
76
|
-
const bottom = (632260.0 * m3 - 126452.0 * m2) * sub2 + 126452.0 * t;
|
|
77
|
-
|
|
78
|
-
const bounds_index = channel * 2 + t;
|
|
79
|
-
const bounds_address = bounds_index*2;
|
|
80
|
-
|
|
81
|
-
bounds[bounds_address] = top1 / bottom;
|
|
82
|
-
bounds[bounds_address] = top2 / bottom;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function max_chroma_for_lh(l, h) {
|
|
88
|
-
let min_len = Infinity;
|
|
89
|
-
const hrad = h * 0.01745329251994329577; /* (2 * pi / 360) */
|
|
90
|
-
const bounds = new Float32Array(12);
|
|
91
|
-
let i;
|
|
92
|
-
|
|
93
|
-
get_bounds(l, bounds);
|
|
94
|
-
|
|
95
|
-
for (i = 0; i < 6; i++) {
|
|
96
|
-
const len = ray_length_until_intersect(hrad, bounds, i * 2);
|
|
97
|
-
|
|
98
|
-
if (len >= 0 && len < min_len)
|
|
99
|
-
min_len = len;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return min_len;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function hsluv2lch(input, output) {
|
|
106
|
-
let h = input[0];
|
|
107
|
-
const s = input[1];
|
|
108
|
-
const l = input[2];
|
|
109
|
-
let c;
|
|
110
|
-
|
|
111
|
-
/* White and black: disambiguate chroma */
|
|
112
|
-
if (l > 99.9999999 || l < 0.00000001)
|
|
113
|
-
c = 0.0;
|
|
114
|
-
else
|
|
115
|
-
c = max_chroma_for_lh(l, h) / 100.0 * s;
|
|
116
|
-
|
|
117
|
-
/* Grays: disambiguate hue */
|
|
118
|
-
if (s < 0.00000001)
|
|
119
|
-
h = 0.0;
|
|
120
|
-
|
|
121
|
-
output[0] = l;
|
|
122
|
-
output[1] = c;
|
|
123
|
-
output[2] = h;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function lch2luv(input, output) {
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function luv2xyz(input, output) {
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function xyz2rgb(input, output) {
|
|
135
|
-
const r = from_linear(dot_product(m, 0, input, 0));
|
|
136
|
-
|
|
137
|
-
const g = from_linear(dot_product(m, 3, input, 0));
|
|
138
|
-
|
|
139
|
-
const b = from_linear(dot_product(m, 6, input, 0));
|
|
140
|
-
|
|
141
|
-
output[0] = r;
|
|
142
|
-
output[1] = g;
|
|
143
|
-
output[2] = b;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function rgb2xyz(input, output) {
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function xyz2luv(input, output) {
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function luv2lch(input, output) {
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function lch2hsluv(input, output) {
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
* @param {number[]} input
|
|
166
|
-
* @param {number[]} output
|
|
167
|
-
*/
|
|
168
|
-
export function rgb2hsluv(input, output) {
|
|
169
|
-
rgb2xyz(input, temp_0);
|
|
170
|
-
xyz2luv(temp_0, temp_1);
|
|
171
|
-
luv2lch(temp_1, temp_0);
|
|
172
|
-
lch2hsluv(temp_0, output);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @param {number[]} input
|
|
178
|
-
* @param {number[]} output
|
|
179
|
-
*/
|
|
180
|
-
export function hsluv2rgb(input, output) {
|
|
181
|
-
hsluv2lch(input, temp_0);
|
|
182
|
-
lch2luv(temp_0, temp_1);
|
|
183
|
-
luv2xyz(temp_1, temp_0);
|
|
184
|
-
xyz2rgb(temp_0, output);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prototypeSamplerFiltering.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/prototypeSamplerFiltering.js"],"names":[],"mappings":""}
|
|
File without changes
|
/package/src/core/collection/array/{AbstractArrayIterator.js → iterator/AbstractArrayIterator.js}
RENAMED
|
File without changes
|
/package/src/core/collection/array/{ArrayIteratorRandom.d.ts → iterator/ArrayIteratorRandom.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|