@adatechnology/game-crowd-three 0.5.4 → 0.5.6
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/dist/index.global.js +120 -49
- package/dist/index.global.js.map +1 -1
- package/package.json +8 -8
package/dist/index.global.js
CHANGED
|
@@ -38,6 +38,7 @@ var GameCrowdThree = (() => {
|
|
|
38
38
|
|
|
39
39
|
// ../game-contracts/dist/index.js
|
|
40
40
|
var DEFAULT_BLAST_SHOVE = { coupling: 0.02, maxSpeed: 20, lift: 0.3, minSpeed: 0.3, falloffPower: 2 };
|
|
41
|
+
var clampShare = (share) => Math.min(1, Math.max(0, share));
|
|
41
42
|
function blastShove(blast, target, options = {}) {
|
|
42
43
|
const o = { ...DEFAULT_BLAST_SHOVE, ...options };
|
|
43
44
|
const dx = target.position[0] - blast.point[0];
|
|
@@ -47,7 +48,8 @@ var GameCrowdThree = (() => {
|
|
|
47
48
|
if (!(blast.radius > 0) || distance2 > blast.radius) return void 0;
|
|
48
49
|
const falloff = (1 - distance2 / blast.radius) ** o.falloffPower;
|
|
49
50
|
const mass = Math.max(target.mass, 0.05);
|
|
50
|
-
const
|
|
51
|
+
const reach = clampShare(blast.reach ?? 1);
|
|
52
|
+
const speed = Math.sqrt(reach) * Math.min(o.maxSpeed, Math.sqrt(2 * blast.energy * o.coupling / mass)) * falloff;
|
|
51
53
|
if (!(speed >= o.minSpeed)) return void 0;
|
|
52
54
|
const direction = distance2 > 1e-4 ? [dx / distance2, dy / distance2 + o.lift, dz / distance2] : [0, 1, 0];
|
|
53
55
|
const length = Math.hypot(direction[0], direction[1], direction[2]);
|
|
@@ -150,6 +152,8 @@ var GameCrowdThree = (() => {
|
|
|
150
152
|
mortar: "concrete",
|
|
151
153
|
stone: "concrete",
|
|
152
154
|
brick: "concrete",
|
|
155
|
+
cobble: "concrete",
|
|
156
|
+
paver: "concrete",
|
|
153
157
|
plaster: "concrete",
|
|
154
158
|
asphalt: "asphalt",
|
|
155
159
|
wood_soft: "wood",
|
|
@@ -160,6 +164,8 @@ var GameCrowdThree = (() => {
|
|
|
160
164
|
ceramic: "tile",
|
|
161
165
|
plastic: "tile",
|
|
162
166
|
soil: "dirt",
|
|
167
|
+
mud: "dirt",
|
|
168
|
+
clay: "dirt",
|
|
163
169
|
wax: "dirt",
|
|
164
170
|
flesh_fruit: "dirt",
|
|
165
171
|
turf: "grass",
|
|
@@ -167,6 +173,8 @@ var GameCrowdThree = (() => {
|
|
|
167
173
|
cactus: "grass",
|
|
168
174
|
gravel: "gravel",
|
|
169
175
|
sand: "sand",
|
|
176
|
+
// no snow surface yet: packed snow crunches closest to sand underfoot
|
|
177
|
+
snow: "sand",
|
|
170
178
|
steel: "metal",
|
|
171
179
|
cast_iron: "metal",
|
|
172
180
|
aluminium: "metal",
|
|
@@ -1512,7 +1520,7 @@ var GameCrowdThree = (() => {
|
|
|
1512
1520
|
var POSE_CLIPS = pose_clips_default.clips;
|
|
1513
1521
|
var POSE_CLIP_LOCALES = pose_clips_default.locales;
|
|
1514
1522
|
|
|
1515
|
-
// ../game-audio/dist/chunk-
|
|
1523
|
+
// ../game-audio/dist/chunk-UUWKSG4J.js
|
|
1516
1524
|
var DISTANCE_CURVES = {
|
|
1517
1525
|
/** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
|
|
1518
1526
|
game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
|
|
@@ -1947,6 +1955,7 @@ var GameCrowdThree = (() => {
|
|
|
1947
1955
|
burst: 20,
|
|
1948
1956
|
burstSpacing: 0.06
|
|
1949
1957
|
};
|
|
1958
|
+
var CATALOG = new Map([...SFX_CATALOG, ...SFX_IMPACTS].map((entry) => [entry.id, entry]));
|
|
1950
1959
|
var PT = {
|
|
1951
1960
|
group: "Som",
|
|
1952
1961
|
name: "Painel de som (arquivos e C1\u2013C10)",
|
|
@@ -2021,9 +2030,9 @@ var GameCrowdThree = (() => {
|
|
|
2021
2030
|
strengths: { light: "leve", medium: "m\xE9dio", heavy: "forte" },
|
|
2022
2031
|
states: { file: "A", synth: "S", missing: "F" },
|
|
2023
2032
|
criteria: { C1: "C1 Sincronia", C2: "C2 Certo p/ a\xE7\xE3o", C3: "C3 Dist\xE2ncia", C4: "C4 Posi\xE7\xE3o", C5: "C5 Varia\xE7\xE3o", C6: "C6 Volume", C7: "C7 Intensidade", C8: "C8 Cauda", C9: "C9 Rajada", C10: "C10 Escuta" },
|
|
2024
|
-
metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo" },
|
|
2033
|
+
metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo", unlicensed: "1 \xB7 Arquivo sem licen\xE7a" },
|
|
2025
2034
|
run: { idle: "parada", measuring: "medindo\u2026", done: "pronta", failed: "falhou", recording: "gravando\u2026", recorded: "grava\xE7\xE3o baixada" },
|
|
2026
|
-
words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono" },
|
|
2035
|
+
words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono", local_file: "arquivo do pacote local", sdk_file: "grava\xE7\xE3o do SDK", synth: "s\xEDntese do SDK" },
|
|
2027
2036
|
sources: { sdk: "SDK", user: "seu som", synth: "sintetizado" },
|
|
2028
2037
|
probe: "Fonte do som",
|
|
2029
2038
|
wall: "Parede (oclus\xE3o)",
|
|
@@ -2094,9 +2103,9 @@ var GameCrowdThree = (() => {
|
|
|
2094
2103
|
environments: { indoor: "indoor", outdoor: "outdoor" },
|
|
2095
2104
|
strengths: { light: "light", medium: "medium", heavy: "heavy" },
|
|
2096
2105
|
criteria: { C1: "C1 Sync", C2: "C2 Right sound", C3: "C3 Distance", C4: "C4 Position", C5: "C5 Variation", C6: "C6 Level", C7: "C7 Strength", C8: "C8 Tail", C9: "C9 Burst", C10: "C10 Listening" },
|
|
2097
|
-
metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue" },
|
|
2106
|
+
metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue", unlicensed: "1 \xB7 File without licence" },
|
|
2098
2107
|
run: { idle: "idle", measuring: "measuring\u2026", done: "done", failed: "failed", recording: "recording\u2026", recorded: "recording downloaded" },
|
|
2099
|
-
words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner" },
|
|
2108
|
+
words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner", local_file: "local pack file", sdk_file: "SDK recording", synth: "SDK synthesis" },
|
|
2100
2109
|
sources: { sdk: "SDK", user: "your sound", synth: "synthesized" },
|
|
2101
2110
|
probe: "Sound source",
|
|
2102
2111
|
wall: "Wall (occlusion)",
|
|
@@ -2179,6 +2188,66 @@ var GameCrowdThree = (() => {
|
|
|
2179
2188
|
sources: [`cena:${line}`]
|
|
2180
2189
|
};
|
|
2181
2190
|
}
|
|
2191
|
+
var hz = (midi) => 440 * 2 ** ((midi - 69) / 12);
|
|
2192
|
+
var layer = (note, beat, wave, level) => {
|
|
2193
|
+
const [at, midi, beats] = note;
|
|
2194
|
+
const length = beats * beat;
|
|
2195
|
+
return {
|
|
2196
|
+
at: at * beat,
|
|
2197
|
+
duration: length,
|
|
2198
|
+
source: { kind: "osc", wave, frequency: { set: hz(midi) } },
|
|
2199
|
+
envelope: [[0, 1e-4, "set"], [0.01, level, "linear"], [Math.max(0.02, length * 0.9), level * 0.35, "linear"], [length, 1e-4, "exp", "fixed"]]
|
|
2200
|
+
};
|
|
2201
|
+
};
|
|
2202
|
+
function radioTrack(spec) {
|
|
2203
|
+
const beat = 60 / spec.bpm;
|
|
2204
|
+
const recipes = Array.from({ length: spec.bars }, (_, bar) => {
|
|
2205
|
+
const inBar = (notes) => notes.filter((n) => n[0] >= bar * 4 && n[0] < bar * 4 + 4).map((n) => [n[0] - bar * 4, n[1], n[2]]);
|
|
2206
|
+
const layers = [
|
|
2207
|
+
...inBar(spec.bass).map((n) => layer(n, beat, "triangle", 0.16)),
|
|
2208
|
+
...inBar(spec.chords).map((n) => layer(n, beat, "sine", 0.05)),
|
|
2209
|
+
...inBar(spec.melody).map((n) => layer(n, beat, spec.wave, 0.07))
|
|
2210
|
+
];
|
|
2211
|
+
return { id: `${spec.id}_${bar}`, bus: "world", duration: 4 * beat, layers, falloff: { model: "none" } };
|
|
2212
|
+
});
|
|
2213
|
+
return { song: { id: spec.id, barSeconds: 4 * beat, bars: recipes.map((r) => r.id) }, recipes };
|
|
2214
|
+
}
|
|
2215
|
+
var chord = (bar, root, minor = false) => [[bar * 4, root, 4], [bar * 4, root + (minor ? 3 : 4), 4], [bar * 4, root + 7, 4]];
|
|
2216
|
+
var bassLine = (roots, pattern) => roots.flatMap((root, bar) => pattern.map((b) => [bar * 4 + b, root - 12, 0.9]));
|
|
2217
|
+
var TRACKS = [
|
|
2218
|
+
// a bright pop loop: I–V–vi–IV in C
|
|
2219
|
+
radioTrack({
|
|
2220
|
+
id: "radio_track_pop",
|
|
2221
|
+
bpm: 112,
|
|
2222
|
+
bars: 4,
|
|
2223
|
+
wave: "square",
|
|
2224
|
+
bass: bassLine([48, 55, 57, 53], [0, 1.5, 2, 3]),
|
|
2225
|
+
chords: [...chord(0, 60), ...chord(1, 55), ...chord(2, 57, true), ...chord(3, 53)],
|
|
2226
|
+
melody: [[0, 76, 1], [1, 74, 0.5], [1.5, 72, 1.5], [4, 74, 1], [5, 76, 1], [6, 79, 2], [8, 76, 1], [9, 74, 1], [10, 72, 2], [12, 72, 1], [13, 74, 1], [14, 72, 2]]
|
|
2227
|
+
}),
|
|
2228
|
+
// a syncopated loop in A minor, the bass on the off-beats
|
|
2229
|
+
radioTrack({
|
|
2230
|
+
id: "radio_track_groove",
|
|
2231
|
+
bpm: 100,
|
|
2232
|
+
bars: 4,
|
|
2233
|
+
wave: "triangle",
|
|
2234
|
+
bass: bassLine([57, 62, 64, 57], [0, 0.75, 1.5, 2.5, 3.25]),
|
|
2235
|
+
chords: [...chord(0, 57, true), ...chord(1, 62, true), ...chord(2, 64), ...chord(3, 57, true)],
|
|
2236
|
+
melody: [[0.5, 72, 0.5], [1.25, 76, 0.75], [2.5, 74, 1], [4.5, 77, 0.5], [5.25, 74, 0.75], [6.5, 72, 1.5], [8.5, 71, 0.5], [9.25, 74, 0.75], [10.5, 76, 1.5], [12.5, 72, 0.5], [13.25, 69, 2]]
|
|
2237
|
+
}),
|
|
2238
|
+
// a slow blues-like loop in F with a swung melody
|
|
2239
|
+
radioTrack({
|
|
2240
|
+
id: "radio_track_slow",
|
|
2241
|
+
bpm: 76,
|
|
2242
|
+
bars: 4,
|
|
2243
|
+
wave: "sine",
|
|
2244
|
+
bass: bassLine([53, 58, 53, 60], [0, 2]),
|
|
2245
|
+
chords: [...chord(0, 65), ...chord(1, 58), ...chord(2, 65), ...chord(3, 60)],
|
|
2246
|
+
melody: [[0, 72, 1.5], [1.67, 75, 0.33], [2, 77, 2], [4, 74, 1], [5, 72, 1], [6, 70, 2], [8, 72, 1.5], [9.67, 69, 0.33], [10, 65, 2], [12, 67, 1], [13, 70, 1], [14, 72, 2]]
|
|
2247
|
+
})
|
|
2248
|
+
];
|
|
2249
|
+
var RADIO_TRACKS = TRACKS.map((t) => t.song);
|
|
2250
|
+
var RADIO_BANK = { id: "vehicle_radio", sounds: TRACKS.flatMap((t) => t.recipes), loops: [] };
|
|
2182
2251
|
var FOLEY_FALLOFF = {
|
|
2183
2252
|
model: "inverse_square",
|
|
2184
2253
|
k: 0.02,
|
|
@@ -2785,11 +2854,11 @@ var GameCrowdThree = (() => {
|
|
|
2785
2854
|
...s.splash ? [sceneNoise({ type: "bandpass", f: s.splash.f * take.f, f2: s.splash.f2 * take.f, q: 1.4, d: s.splash.d * take.t * weight ** 0.4, vol: s.splash.vol * gait.vol * take.v * weight ** 0.5 })] : []
|
|
2786
2855
|
];
|
|
2787
2856
|
}
|
|
2788
|
-
var quieter = (level, layers) => layers.map((
|
|
2789
|
-
const gain =
|
|
2790
|
-
if (typeof gain === "number") return { ...
|
|
2791
|
-
if (Array.isArray(gain)) return { ...
|
|
2792
|
-
return
|
|
2857
|
+
var quieter = (level, layers) => layers.map((layer2) => {
|
|
2858
|
+
const gain = layer2.gain ?? 1;
|
|
2859
|
+
if (typeof gain === "number") return { ...layer2, gain: gain * level };
|
|
2860
|
+
if (Array.isArray(gain)) return { ...layer2, gain: [gain[0] * level, gain[1] * level] };
|
|
2861
|
+
return layer2;
|
|
2793
2862
|
});
|
|
2794
2863
|
var recipe = (id, layers, falloff, bus = "world") => ({ id, bus, pan: true, layers, falloff, sources: ["sdk"] });
|
|
2795
2864
|
var takeId = (id, index) => `${id}_${String(index + 1).padStart(2, "0")}`;
|
|
@@ -2805,7 +2874,7 @@ var GameCrowdThree = (() => {
|
|
|
2805
2874
|
(take) => quieter(LANDING_LEVEL, [
|
|
2806
2875
|
// both feet, a hair apart, then the knees taking the weight (a low body thump) and the clothes settling
|
|
2807
2876
|
...footLayers(surface, take, GAITS.run, LANDINGS[landing2].weight),
|
|
2808
|
-
...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((
|
|
2877
|
+
...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((layer2) => ({ ...layer2, at: (typeof layer2.at === "number" ? layer2.at : 0) + 0.018 * take.t })),
|
|
2809
2878
|
sceneTone({ f: 60 * take.f, f2: 38, d: 0.14 * LANDINGS[landing2].weight * take.t, vol: 0.22 * LANDINGS[landing2].weight ** 0.7 * take.v, delay: 0.02 }),
|
|
2810
2879
|
sceneNoise({ type: "bandpass", f: [1800, 2600], q: 0.8, d: 0.18, vol: LANDINGS[landing2].cloth * take.v, delay: 0.04 })
|
|
2811
2880
|
]),
|
|
@@ -2851,7 +2920,7 @@ var GameCrowdThree = (() => {
|
|
|
2851
2920
|
fall_damage: (take) => [
|
|
2852
2921
|
...BODY.body_fall(take),
|
|
2853
2922
|
sceneNoise({ type: "highpass", f: 2800, d: 0.02, vol: 0.35 * take.v, delay: 0.01 }),
|
|
2854
|
-
...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((
|
|
2923
|
+
...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((layer2) => ({ ...layer2, at: 0.08 }))
|
|
2855
2924
|
],
|
|
2856
2925
|
player_hurt: voice({ f0: 150, f1: 105, d: 0.26, fA: 620, fB: 1100, noise: 0.3, vol: 0.35 }),
|
|
2857
2926
|
player_breath_run: (take) => [
|
|
@@ -2909,7 +2978,7 @@ var GameCrowdThree = (() => {
|
|
|
2909
2978
|
};
|
|
2910
2979
|
var BODY_FOLEY_SET_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
2911
2980
|
|
|
2912
|
-
// ../game-shapes/dist/chunk-
|
|
2981
|
+
// ../game-shapes/dist/chunk-FZQTELDQ.js
|
|
2913
2982
|
function canonicalJson(value) {
|
|
2914
2983
|
if (value === null) return "null";
|
|
2915
2984
|
if (typeof value === "number") return Object.is(value, -0) ? "-0" : Number.isFinite(value) ? String(value) : JSON.stringify(String(value));
|
|
@@ -3785,17 +3854,19 @@ var GameCrowdThree = (() => {
|
|
|
3785
3854
|
if (p2.prevZ) p2.prevZ.nextZ = p2.nextZ;
|
|
3786
3855
|
if (p2.nextZ) p2.nextZ.prevZ = p2.prevZ;
|
|
3787
3856
|
}
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3857
|
+
var Node = class {
|
|
3858
|
+
constructor(i, x, y) {
|
|
3859
|
+
this.i = i;
|
|
3860
|
+
this.x = x;
|
|
3861
|
+
this.y = y;
|
|
3862
|
+
this.prev = null;
|
|
3863
|
+
this.next = null;
|
|
3864
|
+
this.z = 0;
|
|
3865
|
+
this.prevZ = null;
|
|
3866
|
+
this.nextZ = null;
|
|
3867
|
+
this.steiner = false;
|
|
3868
|
+
}
|
|
3869
|
+
};
|
|
3799
3870
|
function signedArea(data, start, end, dim) {
|
|
3800
3871
|
let sum = 0;
|
|
3801
3872
|
for (let i = start, j = end - dim; i < end; i += dim) {
|
|
@@ -4062,8 +4133,8 @@ var GameCrowdThree = (() => {
|
|
|
4062
4133
|
const face = faces[i];
|
|
4063
4134
|
f3(face[2] + offset, face[1] + offset, face[0] + offset);
|
|
4064
4135
|
}
|
|
4065
|
-
const
|
|
4066
|
-
offset = vlen *
|
|
4136
|
+
const layer2 = steps + bevelSegments * 2;
|
|
4137
|
+
offset = vlen * layer2;
|
|
4067
4138
|
for (let i = 0; i < flen; i++) {
|
|
4068
4139
|
const face = faces[i];
|
|
4069
4140
|
f3(face[0] + offset, face[1] + offset, face[2] + offset);
|
|
@@ -4510,7 +4581,7 @@ var GameCrowdThree = (() => {
|
|
|
4510
4581
|
return releaseObject3D(list2, { keep });
|
|
4511
4582
|
}
|
|
4512
4583
|
|
|
4513
|
-
// ../game-characters-three/dist/chunk-
|
|
4584
|
+
// ../game-characters-three/dist/chunk-IBMIWGWX.js
|
|
4514
4585
|
var UNDEAD_VOICE_GROUP = "undead_voice";
|
|
4515
4586
|
var voiced = { bus: "voices", group: UNDEAD_VOICE_GROUP };
|
|
4516
4587
|
var p = (param) => ({ param });
|
|
@@ -5641,7 +5712,7 @@ var GameCrowdThree = (() => {
|
|
|
5641
5712
|
}
|
|
5642
5713
|
}
|
|
5643
5714
|
});
|
|
5644
|
-
const
|
|
5715
|
+
const layer2 = (bytes) => {
|
|
5645
5716
|
const texture2 = new three.DataTexture(bytes, stride, rows * cellHeight, three.RGBAFormat, three.UnsignedByteType);
|
|
5646
5717
|
texture2.minFilter = three.NearestFilter;
|
|
5647
5718
|
texture2.magFilter = three.NearestFilter;
|
|
@@ -5649,8 +5720,8 @@ var GameCrowdThree = (() => {
|
|
|
5649
5720
|
texture2.needsUpdate = true;
|
|
5650
5721
|
return texture2;
|
|
5651
5722
|
};
|
|
5652
|
-
const texture =
|
|
5653
|
-
const colorTexture =
|
|
5723
|
+
const texture = layer2(pixels);
|
|
5724
|
+
const colorTexture = layer2(colorPixels);
|
|
5654
5725
|
return { texture, colorTexture, silhouettes: bodies.length, cellWidth, cellHeight, columns, rows, boxes, pixels, colorPixels, dispose: () => (texture.dispose(), colorTexture.dispose()) };
|
|
5655
5726
|
};
|
|
5656
5727
|
var ACCESSORY_BIT = { CAP: 1, HELMET: 2, BACKPACK: 4, EXTRA: 8 };
|
|
@@ -7110,9 +7181,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
7110
7181
|
for (let i = 0; i < view.n; i++) {
|
|
7111
7182
|
if (!workspace.takesPart[i]) continue;
|
|
7112
7183
|
const hx = Math.floor(store.x[i] + grid.half);
|
|
7113
|
-
const
|
|
7114
|
-
if (hx < 0 ||
|
|
7115
|
-
const cell =
|
|
7184
|
+
const hz2 = Math.floor(store.z[i] + grid.half);
|
|
7185
|
+
if (hx < 0 || hz2 < 0 || hx >= side || hz2 >= side) continue;
|
|
7186
|
+
const cell = hz2 * side + hx;
|
|
7116
7187
|
if (workspace.head[cell] === -1) workspace.touched[workspace.touchedCount++] = cell;
|
|
7117
7188
|
workspace.next[i] = workspace.head[cell];
|
|
7118
7189
|
workspace.head[cell] = i;
|
|
@@ -7144,12 +7215,12 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
7144
7215
|
for (let i = 0; i < view.n; i++) {
|
|
7145
7216
|
if (!workspace.takesPart[i]) continue;
|
|
7146
7217
|
const hx = Math.floor(store.x[i] + grid.half);
|
|
7147
|
-
const
|
|
7148
|
-
if (hx < 0 ||
|
|
7149
|
-
addPairsOfCell(view, i,
|
|
7218
|
+
const hz2 = Math.floor(store.z[i] + grid.half);
|
|
7219
|
+
if (hx < 0 || hz2 < 0 || hx >= side || hz2 >= side) continue;
|
|
7220
|
+
addPairsOfCell(view, i, hz2 * side + hx, true);
|
|
7150
7221
|
for (let k = 0; k < FORWARD_CELLS.length; k += 2) {
|
|
7151
7222
|
const qx = hx + FORWARD_CELLS[k];
|
|
7152
|
-
const qz =
|
|
7223
|
+
const qz = hz2 + FORWARD_CELLS[k + 1];
|
|
7153
7224
|
if (qx >= 0 && qz >= 0 && qx < side && qz < side) addPairsOfCell(view, i, qz * side + qx, false);
|
|
7154
7225
|
}
|
|
7155
7226
|
}
|
|
@@ -8148,14 +8219,14 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
8148
8219
|
const x = pool.x[slot];
|
|
8149
8220
|
const z = pool.z[slot];
|
|
8150
8221
|
const hx = Math.floor(x + grid.half);
|
|
8151
|
-
const
|
|
8222
|
+
const hz2 = Math.floor(z + grid.half);
|
|
8152
8223
|
const mass = massOf(slot);
|
|
8153
8224
|
const speed = Math.hypot(pool.vx[slot], pool.vz[slot]);
|
|
8154
8225
|
const reach = options.landingRadius * options.landingRadius;
|
|
8155
8226
|
for (let oz = -1; oz <= 1; oz++)
|
|
8156
8227
|
for (let ox = -1; ox <= 1; ox++) {
|
|
8157
|
-
if (hx + ox < 0 ||
|
|
8158
|
-
for (let j = contact.workspace.head[(
|
|
8228
|
+
if (hx + ox < 0 || hz2 + oz < 0 || hx + ox >= side || hz2 + oz >= side) continue;
|
|
8229
|
+
for (let j = contact.workspace.head[(hz2 + oz) * side + hx + ox]; j !== -1; j = contact.workspace.next[j]) {
|
|
8159
8230
|
const ex = store.x[j] - x;
|
|
8160
8231
|
const ez = store.z[j] - z;
|
|
8161
8232
|
if (j === pool.agent[slot] || ex * ex + ez * ez > reach || !takesPartInContact(store, j)) continue;
|
|
@@ -9367,9 +9438,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
9367
9438
|
Z.attackTimer[i] -= tdt;
|
|
9368
9439
|
if (Z.attackTimer[i] <= 0) {
|
|
9369
9440
|
const hx = Math.floor(Z.x[i] + HALF);
|
|
9370
|
-
const
|
|
9371
|
-
if (hx >= 0 &&
|
|
9372
|
-
for (let j = hHead[
|
|
9441
|
+
const hz2 = Math.floor(Z.z[i] + HALF);
|
|
9442
|
+
if (hx >= 0 && hz2 >= 0 && hx < HN && hz2 < HN)
|
|
9443
|
+
for (let j = hHead[hz2 * HN + hx]; j !== -1; j = hNext[j]) {
|
|
9373
9444
|
if (j !== i && (Z.x[j] - Z.x[i]) ** 2 + (Z.z[j] - Z.z[i]) ** 2 < ss.hitRadius2) {
|
|
9374
9445
|
Z.attackTimer[i] = N.attackEvery;
|
|
9375
9446
|
hurtOther(j, C.damage);
|
|
@@ -9568,9 +9639,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
9568
9639
|
for (let i = 0; i < Z.n; i++) {
|
|
9569
9640
|
if (Z.band[i] !== 0 || engine.active && Z.balance[i] === BALANCE.THROWN) continue;
|
|
9570
9641
|
const hx = Math.floor(Z.x[i] + HALF);
|
|
9571
|
-
const
|
|
9572
|
-
if (hx < 0 ||
|
|
9573
|
-
const h =
|
|
9642
|
+
const hz2 = Math.floor(Z.z[i] + HALF);
|
|
9643
|
+
if (hx < 0 || hz2 < 0 || hx >= HN || hz2 >= HN) continue;
|
|
9644
|
+
const h = hz2 * HN + hx;
|
|
9574
9645
|
if (engine.active && hHead[h] === -1) hashTouched[hashTouchedN++] = h;
|
|
9575
9646
|
hNext[i] = hHead[h];
|
|
9576
9647
|
hHead[h] = i;
|
|
@@ -9732,11 +9803,11 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
9732
9803
|
let sz = 0;
|
|
9733
9804
|
if (b === 0) {
|
|
9734
9805
|
const hx = Math.floor(Z.x[i] + HALF);
|
|
9735
|
-
const
|
|
9806
|
+
const hz2 = Math.floor(Z.z[i] + HALF);
|
|
9736
9807
|
for (let oz = -1; oz <= 1; oz++)
|
|
9737
9808
|
for (let ox = -1; ox <= 1; ox++) {
|
|
9738
9809
|
const qx = hx + ox;
|
|
9739
|
-
const qz =
|
|
9810
|
+
const qz = hz2 + oz;
|
|
9740
9811
|
if (qx < 0 || qz < 0 || qx >= HN || qz >= HN) continue;
|
|
9741
9812
|
for (let j = hHead[qz * HN + qx]; j !== -1; j = hNext[j]) {
|
|
9742
9813
|
if (j === i || Z.state[j] === STATE.PILE_STEP || Z.state[j] === STATE.DORMANT || balanceOn && (Z.balance[j] === BALANCE.FALLEN || Z.balance[j] === BALANCE.GETTING_UP)) continue;
|