@adatechnology/game-animals-three 0.4.20 → 0.4.21
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 +8 -6
- package/dist/index.global.js.map +1 -1
- package/package.json +4 -4
package/dist/index.global.js
CHANGED
|
@@ -105,7 +105,7 @@ var GameAnimalsThree = (() => {
|
|
|
105
105
|
var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
106
106
|
var SWING_LEAD_SECONDS = { punch: 0.07, kick: 0.09, shove: 0, blade: 0.05, blunt: 0.1, chop: 0.11 };
|
|
107
107
|
|
|
108
|
-
// ../game-audio/dist/chunk-
|
|
108
|
+
// ../game-audio/dist/chunk-ZFNHDQRV.js
|
|
109
109
|
var DISTANCE_CURVES = {
|
|
110
110
|
/** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
|
|
111
111
|
game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
|
|
@@ -4281,11 +4281,12 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
4281
4281
|
const geometry = mesh2.geometry;
|
|
4282
4282
|
return geometry.attributes.position !== void 0 && Object.keys(geometry.morphAttributes).length === 0;
|
|
4283
4283
|
};
|
|
4284
|
-
var signatureOf = (mesh2) => {
|
|
4284
|
+
var signatureOf = (mesh2, materialKey2) => {
|
|
4285
4285
|
const { attributes } = mesh2.geometry;
|
|
4286
4286
|
const present = ATTRIBUTES.filter((name) => attributes[name] !== void 0).map((name) => `${name}${attributes[name].itemSize}`);
|
|
4287
|
-
return `${mesh2.material
|
|
4287
|
+
return `${materialKey2(mesh2.material)}|${present.join(",")}|${mesh2.castShadow ? 1 : 0}${mesh2.receiveShadow ? 1 : 0}`;
|
|
4288
4288
|
};
|
|
4289
|
+
var uuidOf = (material) => material.uuid;
|
|
4289
4290
|
var sameMatrix = (a, b) => a.elements.every((value, index) => Math.abs(value - b.elements[index]) < MATRIX_EPSILON);
|
|
4290
4291
|
function createStaticBatcher(THREE, root, options = {}) {
|
|
4291
4292
|
const include = options.include ?? (() => true);
|
|
@@ -4296,7 +4297,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
4296
4297
|
root.traverse((object2) => {
|
|
4297
4298
|
const mesh2 = object2;
|
|
4298
4299
|
if (!mesh2.isMesh || !isShown(mesh2, root) || !isBatchable(mesh2) || !include(mesh2)) return;
|
|
4299
|
-
const key = signatureOf(mesh2);
|
|
4300
|
+
const key = signatureOf(mesh2, options.materialKey ?? uuidOf);
|
|
4300
4301
|
groups.set(key, [...groups.get(key) ?? [], mesh2]);
|
|
4301
4302
|
});
|
|
4302
4303
|
const group = new THREE.Group();
|
|
@@ -4306,7 +4307,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
4306
4307
|
const mergeSome = (deadline) => {
|
|
4307
4308
|
while (pending.length > 0) {
|
|
4308
4309
|
const meshes = pending.shift();
|
|
4309
|
-
if (meshes.every((mesh2) => isShown(mesh2, root))) sources.push(...mergeGroup(THREE, { meshes, inverse: new THREE.Matrix4().copy(root.matrixWorld).invert(), group, follow }));
|
|
4310
|
+
if (meshes.every((mesh2) => isShown(mesh2, root))) sources.push(...mergeGroup(THREE, { meshes, inverse: new THREE.Matrix4().copy(root.matrixWorld).invert(), group, follow, onBatch: options.onBatch }));
|
|
4310
4311
|
if (performance.now() >= deadline) return;
|
|
4311
4312
|
}
|
|
4312
4313
|
};
|
|
@@ -4404,7 +4405,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
4404
4405
|
mesh2.frustumCulled = false;
|
|
4405
4406
|
return mesh2;
|
|
4406
4407
|
}
|
|
4407
|
-
function mergeGroup(THREE, { meshes, inverse: rootInverse, group, follow }) {
|
|
4408
|
+
function mergeGroup(THREE, { meshes, inverse: rootInverse, group, follow, onBatch }) {
|
|
4408
4409
|
const identity = new THREE.Matrix4();
|
|
4409
4410
|
const inverse = follow ? identity : rootInverse;
|
|
4410
4411
|
const first = meshes[0];
|
|
@@ -4441,6 +4442,7 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
4441
4442
|
merged.computeBoundingBox();
|
|
4442
4443
|
merged.computeBoundingSphere();
|
|
4443
4444
|
group.add(mesh2);
|
|
4445
|
+
onBatch?.(mesh2, meshes);
|
|
4444
4446
|
const batch = { mesh: mesh2, live: pieces.length, index: indexAttribute };
|
|
4445
4447
|
const sources = [];
|
|
4446
4448
|
let vertexOffset = 0;
|