@bendyline/molen-ambient 0.0.10 → 0.0.11
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/client.d.mts +41 -1
- package/dist/client.mjs +745 -1
- package/dist/kernel.d.mts +2 -1
- package/dist/kernel.mjs +181 -1
- package/dist/wildlife-B4EL0z-N.d.mts +87 -0
- package/package.json +2 -2
package/dist/client.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { p as WildlifeSpecies, r as WildlifeAgent } from "./wildlife-B4EL0z-N.mjs";
|
|
1
2
|
import { World } from "@bendyline/molen-kernel/world";
|
|
2
3
|
import { AircraftSpec, VehicleData } from "@bendyline/molen-schema";
|
|
3
4
|
import * as THREE from "three";
|
|
@@ -189,4 +190,43 @@ interface AmbientRenderer {
|
|
|
189
190
|
}
|
|
190
191
|
declare function createAmbientRenderer(options: AmbientRendererOptions): AmbientRenderer;
|
|
191
192
|
//#endregion
|
|
192
|
-
|
|
193
|
+
//#region src/client/wildlife.d.ts
|
|
194
|
+
interface WildlifeRenderBudget {
|
|
195
|
+
animals: number;
|
|
196
|
+
radius: number;
|
|
197
|
+
posesPerFrame: number;
|
|
198
|
+
}
|
|
199
|
+
/** One opaque skinned draw per visible animal. Geometry is shared and released on disposal. */
|
|
200
|
+
declare class WildlifeRenderer {
|
|
201
|
+
private readonly prepare?;
|
|
202
|
+
readonly group: THREE.Group;
|
|
203
|
+
private readonly material;
|
|
204
|
+
private readonly cache;
|
|
205
|
+
private readonly active;
|
|
206
|
+
private frame;
|
|
207
|
+
private cursor;
|
|
208
|
+
private budget;
|
|
209
|
+
constructor(prepare?: ((object: THREE.Object3D) => void) | undefined);
|
|
210
|
+
setBudget(budget: Partial<WildlifeRenderBudget>): void;
|
|
211
|
+
get count(): number;
|
|
212
|
+
get triangles(): number;
|
|
213
|
+
private remove;
|
|
214
|
+
update(agents: readonly WildlifeAgent[], species: ReadonlyMap<string, WildlifeSpecies>, camera: readonly [number, number, number], seconds: number, appearance?: (agent: WildlifeAgent, recipe: WildlifeSpecies) => WildlifeSpecies): void;
|
|
215
|
+
dispose(): void;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/client/wildlife-geometry.d.ts
|
|
219
|
+
type WildlifeTier = 0 | 1 | 2;
|
|
220
|
+
interface WildlifeJoint {
|
|
221
|
+
name: string;
|
|
222
|
+
pivot: [number, number, number];
|
|
223
|
+
}
|
|
224
|
+
interface WildlifeGeometry {
|
|
225
|
+
geometry: THREE.BufferGeometry;
|
|
226
|
+
joints: WildlifeJoint[];
|
|
227
|
+
triangles: number;
|
|
228
|
+
}
|
|
229
|
+
/** +Z is the head/front. All geometry is baked in bind pose and skin weights are rigid. */
|
|
230
|
+
declare function wildlifeGeometry(species: WildlifeSpecies, tier: WildlifeTier): WildlifeGeometry;
|
|
231
|
+
//#endregion
|
|
232
|
+
export { type AmbientAircraftModels, AmbientFigures, type AmbientRenderBudget, type AmbientRenderStats, type AmbientRenderer, type AmbientRendererOptions, type AmbientVehicleKindOptions, type AmbientVehicleModels, type DetailCandidate, type FigureBudget, ProxyBatches, type ProxyDimensions, type ProxyInstance, type ProxyShape, type WalkerView, type WildlifeGeometry, type WildlifeRenderBudget, WildlifeRenderer, type WildlifeTier, ambientVehicleKind, createAmbientRenderer, proxyGeometry, proxyHeight, proxyShapeFor, wildlifeGeometry };
|
package/dist/client.mjs
CHANGED
|
@@ -1066,6 +1066,750 @@ function createAmbientRenderer(options) {
|
|
|
1066
1066
|
};
|
|
1067
1067
|
}
|
|
1068
1068
|
//#endregion
|
|
1069
|
+
//#region src/client/wildlife-geometry.ts
|
|
1070
|
+
/** Faceted, opaque, bounded animal families. One skinned draw per animal; shared recipe geometry. */
|
|
1071
|
+
/** +Z is the head/front. All geometry is baked in bind pose and skin weights are rigid. */
|
|
1072
|
+
function wildlifeGeometry(species, tier) {
|
|
1073
|
+
const positions = [], normals = [], colors = [], skin = [], weights = [];
|
|
1074
|
+
const joints = [{
|
|
1075
|
+
name: "body",
|
|
1076
|
+
pivot: [
|
|
1077
|
+
0,
|
|
1078
|
+
0,
|
|
1079
|
+
0
|
|
1080
|
+
]
|
|
1081
|
+
}];
|
|
1082
|
+
const body = species.body, h = body.height, l = body.length, w = body.width;
|
|
1083
|
+
const detail = (name) => body.details.includes(name);
|
|
1084
|
+
const joint = (name, pivot) => {
|
|
1085
|
+
joints.push({
|
|
1086
|
+
name,
|
|
1087
|
+
pivot
|
|
1088
|
+
});
|
|
1089
|
+
return joints.length - 1;
|
|
1090
|
+
};
|
|
1091
|
+
const add = (geometry, matrix, color, bone = 0) => {
|
|
1092
|
+
const source = geometry.index === null ? geometry : geometry.toNonIndexed();
|
|
1093
|
+
source.applyMatrix4(matrix);
|
|
1094
|
+
source.computeVertexNormals();
|
|
1095
|
+
const p = source.getAttribute("position"), n = source.getAttribute("normal");
|
|
1096
|
+
const c = new THREE.Color(color);
|
|
1097
|
+
for (let i = 0; i < p.count; i++) {
|
|
1098
|
+
positions.push(p.getX(i), p.getY(i), p.getZ(i));
|
|
1099
|
+
normals.push(n.getX(i), n.getY(i), n.getZ(i));
|
|
1100
|
+
colors.push(c.r, c.g, c.b);
|
|
1101
|
+
skin.push(bone, 0, 0, 0);
|
|
1102
|
+
weights.push(1, 0, 0, 0);
|
|
1103
|
+
}
|
|
1104
|
+
source.dispose();
|
|
1105
|
+
if (source !== geometry) geometry.dispose();
|
|
1106
|
+
};
|
|
1107
|
+
const ellipsoid = (center, size, color = body.color, bone = 0) => {
|
|
1108
|
+
add(new THREE.SphereGeometry(1, tier === 0 ? 8 : tier === 1 ? 6 : 4, tier === 0 ? 5 : tier === 1 ? 4 : 3), new THREE.Matrix4().compose(new THREE.Vector3(...center), new THREE.Quaternion(), new THREE.Vector3(...size)), color, bone);
|
|
1109
|
+
};
|
|
1110
|
+
const segment = (a, b, r1, r2, color = body.color, bone = 0) => {
|
|
1111
|
+
const start = new THREE.Vector3(...a), end = new THREE.Vector3(...b), delta = end.clone().sub(start);
|
|
1112
|
+
add(new THREE.CylinderGeometry(r2, r1, delta.length(), tier === 0 ? 6 : 4, 1, false), new THREE.Matrix4().compose(start.add(end).multiplyScalar(.5), new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 1, 0), delta.normalize()), new THREE.Vector3(1, 1, 1)), color, bone);
|
|
1113
|
+
};
|
|
1114
|
+
const wedge = (points, thickness, color, bone) => {
|
|
1115
|
+
const [a, b, c] = points;
|
|
1116
|
+
if (a === void 0 || b === void 0 || c === void 0) return;
|
|
1117
|
+
const vertices = [
|
|
1118
|
+
a,
|
|
1119
|
+
b,
|
|
1120
|
+
c,
|
|
1121
|
+
[
|
|
1122
|
+
a[0],
|
|
1123
|
+
a[1] + thickness,
|
|
1124
|
+
a[2]
|
|
1125
|
+
],
|
|
1126
|
+
[
|
|
1127
|
+
b[0],
|
|
1128
|
+
b[1] + thickness,
|
|
1129
|
+
b[2]
|
|
1130
|
+
],
|
|
1131
|
+
[
|
|
1132
|
+
c[0],
|
|
1133
|
+
c[1] + thickness,
|
|
1134
|
+
c[2]
|
|
1135
|
+
]
|
|
1136
|
+
];
|
|
1137
|
+
const indices = [
|
|
1138
|
+
0,
|
|
1139
|
+
2,
|
|
1140
|
+
1,
|
|
1141
|
+
3,
|
|
1142
|
+
4,
|
|
1143
|
+
5,
|
|
1144
|
+
0,
|
|
1145
|
+
1,
|
|
1146
|
+
4,
|
|
1147
|
+
0,
|
|
1148
|
+
4,
|
|
1149
|
+
3,
|
|
1150
|
+
1,
|
|
1151
|
+
2,
|
|
1152
|
+
5,
|
|
1153
|
+
1,
|
|
1154
|
+
5,
|
|
1155
|
+
4,
|
|
1156
|
+
2,
|
|
1157
|
+
0,
|
|
1158
|
+
3,
|
|
1159
|
+
2,
|
|
1160
|
+
3,
|
|
1161
|
+
5
|
|
1162
|
+
];
|
|
1163
|
+
const geometry = new THREE.BufferGeometry();
|
|
1164
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices.flat(), 3));
|
|
1165
|
+
geometry.setIndex(indices);
|
|
1166
|
+
add(geometry, new THREE.Matrix4(), color, bone);
|
|
1167
|
+
};
|
|
1168
|
+
const eye = (x, y, z, radius, bone = 0) => {
|
|
1169
|
+
if (tier !== 0) return;
|
|
1170
|
+
ellipsoid([
|
|
1171
|
+
x,
|
|
1172
|
+
y,
|
|
1173
|
+
z
|
|
1174
|
+
], [
|
|
1175
|
+
radius,
|
|
1176
|
+
radius,
|
|
1177
|
+
radius * .55
|
|
1178
|
+
], "#272a26", bone);
|
|
1179
|
+
};
|
|
1180
|
+
if (body.family === "bird" || body.family === "insect") {
|
|
1181
|
+
const insect = body.family === "insect";
|
|
1182
|
+
const flying = species.motion === "fly";
|
|
1183
|
+
const y = flying ? 0 : detail("wader") ? h * .66 : h * .48;
|
|
1184
|
+
ellipsoid([
|
|
1185
|
+
0,
|
|
1186
|
+
y,
|
|
1187
|
+
0
|
|
1188
|
+
], [
|
|
1189
|
+
w * .5,
|
|
1190
|
+
h * (detail("wader") ? .19 : .3),
|
|
1191
|
+
l * .38
|
|
1192
|
+
]);
|
|
1193
|
+
const headY = y + h * (detail("wader") ? .23 : .21), headZ = l * .36;
|
|
1194
|
+
if (detail("wader")) segment([
|
|
1195
|
+
0,
|
|
1196
|
+
y,
|
|
1197
|
+
l * .2
|
|
1198
|
+
], [
|
|
1199
|
+
0,
|
|
1200
|
+
headY,
|
|
1201
|
+
headZ
|
|
1202
|
+
], w * .16, w * .12);
|
|
1203
|
+
ellipsoid([
|
|
1204
|
+
0,
|
|
1205
|
+
headY,
|
|
1206
|
+
headZ
|
|
1207
|
+
], [
|
|
1208
|
+
w * .32,
|
|
1209
|
+
h * .17,
|
|
1210
|
+
l * .17
|
|
1211
|
+
], body.accent);
|
|
1212
|
+
segment([
|
|
1213
|
+
0,
|
|
1214
|
+
headY,
|
|
1215
|
+
l * .46
|
|
1216
|
+
], [
|
|
1217
|
+
0,
|
|
1218
|
+
headY - h * .035,
|
|
1219
|
+
l * (detail("wader") ? .87 : .66)
|
|
1220
|
+
], w * .1, w * .012, "#a2966e");
|
|
1221
|
+
eye(-w * .27, headY + h * .035, l * .45, h * .045);
|
|
1222
|
+
eye(w * .27, headY + h * .035, l * .45, h * .045);
|
|
1223
|
+
for (const side of [-1, 1]) {
|
|
1224
|
+
const wing = joint(side < 0 ? "wing.l" : "wing.r", [
|
|
1225
|
+
side * w * .25,
|
|
1226
|
+
y,
|
|
1227
|
+
l * .04
|
|
1228
|
+
]);
|
|
1229
|
+
if (flying) {
|
|
1230
|
+
const span = l * (detail("raptor") ? 1.65 : insect ? .9 : 1.05);
|
|
1231
|
+
wedge([
|
|
1232
|
+
[
|
|
1233
|
+
side * w * .25,
|
|
1234
|
+
y,
|
|
1235
|
+
l * .25
|
|
1236
|
+
],
|
|
1237
|
+
[
|
|
1238
|
+
side * span,
|
|
1239
|
+
y - h * .08,
|
|
1240
|
+
-l * .1
|
|
1241
|
+
],
|
|
1242
|
+
[
|
|
1243
|
+
side * w * .4,
|
|
1244
|
+
y,
|
|
1245
|
+
-l * .42
|
|
1246
|
+
]
|
|
1247
|
+
], h * .045, body.accent, wing);
|
|
1248
|
+
if (tier === 0 && !insect) for (let i = 0; i < 3; i++) wedge([
|
|
1249
|
+
[
|
|
1250
|
+
side * span * (.65 + i * .1),
|
|
1251
|
+
y - h * .05,
|
|
1252
|
+
-l * .04
|
|
1253
|
+
],
|
|
1254
|
+
[
|
|
1255
|
+
side * span * (.82 + i * .1),
|
|
1256
|
+
y - h * .08,
|
|
1257
|
+
-l * (.23 + i * .03)
|
|
1258
|
+
],
|
|
1259
|
+
[
|
|
1260
|
+
side * span * (.61 + i * .1),
|
|
1261
|
+
y,
|
|
1262
|
+
-l * .22
|
|
1263
|
+
]
|
|
1264
|
+
], h * .025, body.color, wing);
|
|
1265
|
+
} else ellipsoid([
|
|
1266
|
+
side * w * .38,
|
|
1267
|
+
y + h * .05,
|
|
1268
|
+
-l * .03
|
|
1269
|
+
], [
|
|
1270
|
+
w * .16,
|
|
1271
|
+
h * .2,
|
|
1272
|
+
l * .34
|
|
1273
|
+
], body.accent, wing);
|
|
1274
|
+
if (!flying && species.motion !== "swim") {
|
|
1275
|
+
const leg = joint(side < 0 ? "leg.l" : "leg.r", [
|
|
1276
|
+
side * w * .2,
|
|
1277
|
+
y,
|
|
1278
|
+
0
|
|
1279
|
+
]);
|
|
1280
|
+
segment([
|
|
1281
|
+
side * w * .2,
|
|
1282
|
+
y,
|
|
1283
|
+
0
|
|
1284
|
+
], [
|
|
1285
|
+
side * w * .2,
|
|
1286
|
+
h * .03,
|
|
1287
|
+
l * .04
|
|
1288
|
+
], w * .045, w * .03, "#655f4a", leg);
|
|
1289
|
+
segment([
|
|
1290
|
+
side * w * .2,
|
|
1291
|
+
h * .03,
|
|
1292
|
+
l * .04
|
|
1293
|
+
], [
|
|
1294
|
+
side * w * .2,
|
|
1295
|
+
h * .03,
|
|
1296
|
+
l * .18
|
|
1297
|
+
], w * .03, w * .025, "#655f4a", leg);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
wedge([
|
|
1301
|
+
[
|
|
1302
|
+
-w * .22,
|
|
1303
|
+
y,
|
|
1304
|
+
-l * .3
|
|
1305
|
+
],
|
|
1306
|
+
[
|
|
1307
|
+
w * .22,
|
|
1308
|
+
y,
|
|
1309
|
+
-l * .3
|
|
1310
|
+
],
|
|
1311
|
+
[
|
|
1312
|
+
0,
|
|
1313
|
+
y - h * .08,
|
|
1314
|
+
-l * (detail("long-tail") ? 1 : .64)
|
|
1315
|
+
]
|
|
1316
|
+
], h * .05, body.accent, 0);
|
|
1317
|
+
} else if (body.family === "fish") {
|
|
1318
|
+
ellipsoid([
|
|
1319
|
+
0,
|
|
1320
|
+
0,
|
|
1321
|
+
0
|
|
1322
|
+
], [
|
|
1323
|
+
w * .5,
|
|
1324
|
+
h * .48,
|
|
1325
|
+
l * .4
|
|
1326
|
+
]);
|
|
1327
|
+
const tail = joint("tail", [
|
|
1328
|
+
0,
|
|
1329
|
+
0,
|
|
1330
|
+
-l * .32
|
|
1331
|
+
]);
|
|
1332
|
+
ellipsoid([
|
|
1333
|
+
0,
|
|
1334
|
+
0,
|
|
1335
|
+
-l * .5
|
|
1336
|
+
], [
|
|
1337
|
+
w * .08,
|
|
1338
|
+
h * .65,
|
|
1339
|
+
l * .13
|
|
1340
|
+
], body.accent, tail);
|
|
1341
|
+
for (const side of [-1, 1]) wedge([
|
|
1342
|
+
[
|
|
1343
|
+
side * w * .2,
|
|
1344
|
+
0,
|
|
1345
|
+
l * .1
|
|
1346
|
+
],
|
|
1347
|
+
[
|
|
1348
|
+
side * w,
|
|
1349
|
+
-h * .12,
|
|
1350
|
+
-l * .18
|
|
1351
|
+
],
|
|
1352
|
+
[
|
|
1353
|
+
side * w * .25,
|
|
1354
|
+
0,
|
|
1355
|
+
-l * .2
|
|
1356
|
+
]
|
|
1357
|
+
], h * .04, body.accent, 0);
|
|
1358
|
+
eye(-w * .4, h * .14, l * .25, h * .09);
|
|
1359
|
+
eye(w * .4, h * .14, l * .25, h * .09);
|
|
1360
|
+
} else if (body.family === "reptile") {
|
|
1361
|
+
ellipsoid([
|
|
1362
|
+
0,
|
|
1363
|
+
h * .48,
|
|
1364
|
+
-l * .05
|
|
1365
|
+
], [
|
|
1366
|
+
w * .5,
|
|
1367
|
+
h * .28,
|
|
1368
|
+
l * .36
|
|
1369
|
+
]);
|
|
1370
|
+
const head = joint("head", [
|
|
1371
|
+
0,
|
|
1372
|
+
h * .44,
|
|
1373
|
+
l * .28
|
|
1374
|
+
]);
|
|
1375
|
+
ellipsoid([
|
|
1376
|
+
0,
|
|
1377
|
+
h * .43,
|
|
1378
|
+
l * .39
|
|
1379
|
+
], [
|
|
1380
|
+
w * .34,
|
|
1381
|
+
h * .2,
|
|
1382
|
+
l * .18
|
|
1383
|
+
], body.color, head);
|
|
1384
|
+
for (const side of [-1, 1]) {
|
|
1385
|
+
eye(side * w * .29, h * .54, l * .42, h * .045, head);
|
|
1386
|
+
for (const front of [false, true]) {
|
|
1387
|
+
const z = (front ? 1 : -1) * l * .22;
|
|
1388
|
+
const pivot = [
|
|
1389
|
+
side * w * .35,
|
|
1390
|
+
h * .4,
|
|
1391
|
+
z
|
|
1392
|
+
];
|
|
1393
|
+
const leg = joint(`leg.${front ? "front" : "rear"}.${side < 0 ? "l" : "r"}`, pivot);
|
|
1394
|
+
const knee = [
|
|
1395
|
+
side * w * .85,
|
|
1396
|
+
h * .2,
|
|
1397
|
+
z + (front ? -1 : 1) * l * .09
|
|
1398
|
+
];
|
|
1399
|
+
const foot = [
|
|
1400
|
+
side * w * .98,
|
|
1401
|
+
h * .04,
|
|
1402
|
+
z + (front ? 1 : -1) * l * .1
|
|
1403
|
+
];
|
|
1404
|
+
segment(pivot, knee, w * .12, w * .08, body.color, leg);
|
|
1405
|
+
segment(knee, foot, w * .08, w * .035, body.color, leg);
|
|
1406
|
+
if (tier < 2) ellipsoid(foot, [
|
|
1407
|
+
w * .12,
|
|
1408
|
+
h * .025,
|
|
1409
|
+
l * .055
|
|
1410
|
+
], body.accent, leg);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
const tail = joint("tail", [
|
|
1414
|
+
0,
|
|
1415
|
+
h * .4,
|
|
1416
|
+
-l * .34
|
|
1417
|
+
]);
|
|
1418
|
+
const bend = [
|
|
1419
|
+
w * .12,
|
|
1420
|
+
h * .14,
|
|
1421
|
+
-l * .77
|
|
1422
|
+
];
|
|
1423
|
+
segment([
|
|
1424
|
+
0,
|
|
1425
|
+
h * .4,
|
|
1426
|
+
-l * .34
|
|
1427
|
+
], bend, w * .22, w * .1, body.color, tail);
|
|
1428
|
+
segment(bend, [
|
|
1429
|
+
w * .32,
|
|
1430
|
+
h * .06,
|
|
1431
|
+
-l * 1.3
|
|
1432
|
+
], w * .1, w * .005, body.color, tail);
|
|
1433
|
+
} else {
|
|
1434
|
+
const hopper = body.family === "hopper", low = ["rodent", "lagomorph"].includes(body.family), elephant = body.family === "elephant";
|
|
1435
|
+
const torsoY = h * (hopper ? .57 : low ? .5 : .72);
|
|
1436
|
+
const torsoRadius = h * (hopper ? .3 : low ? .31 : elephant ? .32 : .19);
|
|
1437
|
+
ellipsoid([
|
|
1438
|
+
0,
|
|
1439
|
+
torsoY,
|
|
1440
|
+
-l * .04
|
|
1441
|
+
], [
|
|
1442
|
+
w * .5,
|
|
1443
|
+
torsoRadius,
|
|
1444
|
+
l * (hopper ? .28 : .38)
|
|
1445
|
+
]);
|
|
1446
|
+
if (tier === 0) ellipsoid([
|
|
1447
|
+
0,
|
|
1448
|
+
torsoY - torsoRadius * .48,
|
|
1449
|
+
l * .04
|
|
1450
|
+
], [
|
|
1451
|
+
w * .39,
|
|
1452
|
+
torsoRadius * .62,
|
|
1453
|
+
l * .29
|
|
1454
|
+
], elephant ? body.color : body.accent);
|
|
1455
|
+
const neckTop = h * (hopper ? .92 : low ? .61 : elephant ? .9 : detail("long-neck") ? 1.38 : 1.1);
|
|
1456
|
+
const headZ = l * (hopper ? .3 : .47), headR = h * (elephant ? .18 : low ? .23 : .13);
|
|
1457
|
+
segment([
|
|
1458
|
+
0,
|
|
1459
|
+
torsoY,
|
|
1460
|
+
l * .27
|
|
1461
|
+
], [
|
|
1462
|
+
0,
|
|
1463
|
+
neckTop - headR * .4,
|
|
1464
|
+
headZ - l * .07
|
|
1465
|
+
], w * (elephant ? .4 : low ? .32 : .23), w * (low ? .28 : .17));
|
|
1466
|
+
const head = joint("head", [
|
|
1467
|
+
0,
|
|
1468
|
+
neckTop - headR * .6,
|
|
1469
|
+
headZ - l * .06
|
|
1470
|
+
]);
|
|
1471
|
+
ellipsoid([
|
|
1472
|
+
0,
|
|
1473
|
+
neckTop,
|
|
1474
|
+
headZ
|
|
1475
|
+
], [
|
|
1476
|
+
w * (elephant ? .4 : low ? .34 : .28),
|
|
1477
|
+
headR,
|
|
1478
|
+
l * (elephant || low ? .16 : .12)
|
|
1479
|
+
], body.color, head);
|
|
1480
|
+
if (!elephant) ellipsoid([
|
|
1481
|
+
0,
|
|
1482
|
+
neckTop - headR * .28,
|
|
1483
|
+
headZ + l * .11
|
|
1484
|
+
], [
|
|
1485
|
+
w * .17,
|
|
1486
|
+
headR * .55,
|
|
1487
|
+
l * .1
|
|
1488
|
+
], body.accent, head);
|
|
1489
|
+
for (const side of [-1, 1]) {
|
|
1490
|
+
const earHeight = body.family === "lagomorph" ? h * .45 : hopper ? h * .2 : elephant ? h * .25 : low ? h * .075 : h * .11;
|
|
1491
|
+
ellipsoid([
|
|
1492
|
+
side * w * (elephant ? .52 : .22),
|
|
1493
|
+
neckTop + headR * (elephant ? .15 : .8),
|
|
1494
|
+
headZ - l * .04
|
|
1495
|
+
], [
|
|
1496
|
+
w * (elephant ? .35 : .1),
|
|
1497
|
+
earHeight,
|
|
1498
|
+
l * .035
|
|
1499
|
+
], elephant ? body.color : body.accent, head);
|
|
1500
|
+
eye(side * w * (low ? .3 : .25), neckTop + headR * .1, headZ + l * .09, headR * .1, head);
|
|
1501
|
+
if (detail("horns") || detail("antlers")) {
|
|
1502
|
+
const base = [
|
|
1503
|
+
side * w * .22,
|
|
1504
|
+
neckTop + headR * .8,
|
|
1505
|
+
headZ
|
|
1506
|
+
];
|
|
1507
|
+
const tip = [
|
|
1508
|
+
side * w * .42,
|
|
1509
|
+
neckTop + h * .36,
|
|
1510
|
+
headZ - l * .04
|
|
1511
|
+
];
|
|
1512
|
+
segment(base, tip, w * .045, w * .013, "#817963", head);
|
|
1513
|
+
if (detail("antlers") && tier < 2) for (let branch = 0; branch < (tier === 0 ? 3 : 1); branch++) {
|
|
1514
|
+
const t = .3 + branch * .2;
|
|
1515
|
+
segment([
|
|
1516
|
+
base[0] + (tip[0] - base[0]) * t,
|
|
1517
|
+
base[1] + (tip[1] - base[1]) * t,
|
|
1518
|
+
base[2] + (tip[2] - base[2]) * t
|
|
1519
|
+
], [
|
|
1520
|
+
side * w * (.6 + branch * .1),
|
|
1521
|
+
neckTop + h * (.18 + branch * .09),
|
|
1522
|
+
headZ + l * .04
|
|
1523
|
+
], w * .027, w * .008, "#817963", head);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
for (const front of [false, true]) {
|
|
1527
|
+
const legZ = (front ? 1 : -1) * l * (hopper ? .15 : .25);
|
|
1528
|
+
const pivot = [
|
|
1529
|
+
side * w * .34,
|
|
1530
|
+
torsoY - torsoRadius * .2,
|
|
1531
|
+
legZ
|
|
1532
|
+
];
|
|
1533
|
+
const leg = joint(`leg.${front ? "front" : "rear"}.${side < 0 ? "l" : "r"}`, pivot);
|
|
1534
|
+
const footY = hopper && front ? h * .42 : h * .055;
|
|
1535
|
+
const knee = [
|
|
1536
|
+
pivot[0],
|
|
1537
|
+
(pivot[1] + footY) * .5,
|
|
1538
|
+
legZ + (hopper && !front ? l * .14 : -l * .02)
|
|
1539
|
+
];
|
|
1540
|
+
const radius = w * (elephant ? .2 : hopper && !front ? .22 : low ? .13 : .1);
|
|
1541
|
+
segment(pivot, knee, radius, radius * .7, body.color, leg);
|
|
1542
|
+
segment(knee, [
|
|
1543
|
+
pivot[0],
|
|
1544
|
+
footY,
|
|
1545
|
+
legZ
|
|
1546
|
+
], radius * .7, radius * .46, body.color, leg);
|
|
1547
|
+
if (tier < 2) ellipsoid([
|
|
1548
|
+
pivot[0],
|
|
1549
|
+
footY,
|
|
1550
|
+
legZ + (hopper && !front ? l * .12 : l * .035)
|
|
1551
|
+
], [
|
|
1552
|
+
radius * .65,
|
|
1553
|
+
Math.max(h * .025, footY * .65),
|
|
1554
|
+
l * (hopper && !front ? .16 : .055)
|
|
1555
|
+
], elephant ? body.color : body.accent, leg);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
const tail = joint("tail", [
|
|
1559
|
+
0,
|
|
1560
|
+
torsoY,
|
|
1561
|
+
-l * .34
|
|
1562
|
+
]);
|
|
1563
|
+
if (body.family === "rodent" && detail("bushy-tail")) {
|
|
1564
|
+
segment([
|
|
1565
|
+
0,
|
|
1566
|
+
torsoY,
|
|
1567
|
+
-l * .34
|
|
1568
|
+
], [
|
|
1569
|
+
0,
|
|
1570
|
+
h * 1.12,
|
|
1571
|
+
-l * .65
|
|
1572
|
+
], w * .19, w * .16, body.color, tail);
|
|
1573
|
+
ellipsoid([
|
|
1574
|
+
0,
|
|
1575
|
+
h * 1,
|
|
1576
|
+
-l * .6
|
|
1577
|
+
], [
|
|
1578
|
+
w * .36,
|
|
1579
|
+
h * .57,
|
|
1580
|
+
l * .27
|
|
1581
|
+
], body.color, tail);
|
|
1582
|
+
} else if (detail("long-tail") || detail("bushy-tail") || [
|
|
1583
|
+
"canid",
|
|
1584
|
+
"feline",
|
|
1585
|
+
"elephant"
|
|
1586
|
+
].includes(body.family)) {
|
|
1587
|
+
const end = [
|
|
1588
|
+
0,
|
|
1589
|
+
elephant ? h * .12 : hopper ? h * .08 : torsoY * .55,
|
|
1590
|
+
-l * (elephant ? .44 : detail("long-tail") ? 1.1 : .88)
|
|
1591
|
+
];
|
|
1592
|
+
segment([
|
|
1593
|
+
0,
|
|
1594
|
+
torsoY,
|
|
1595
|
+
-l * .34
|
|
1596
|
+
], end, w * (detail("bushy-tail") ? .2 : hopper ? .18 : .06), w * .025, body.color, tail);
|
|
1597
|
+
if (detail("bushy-tail")) ellipsoid([
|
|
1598
|
+
0,
|
|
1599
|
+
torsoY * .72,
|
|
1600
|
+
-l * .68
|
|
1601
|
+
], [
|
|
1602
|
+
w * .22,
|
|
1603
|
+
h * .14,
|
|
1604
|
+
l * .2
|
|
1605
|
+
], body.accent, tail);
|
|
1606
|
+
} else if (body.family !== "rodent") ellipsoid([
|
|
1607
|
+
0,
|
|
1608
|
+
torsoY,
|
|
1609
|
+
-l * .39
|
|
1610
|
+
], [
|
|
1611
|
+
w * .1,
|
|
1612
|
+
h * .05,
|
|
1613
|
+
l * .05
|
|
1614
|
+
], body.accent, tail);
|
|
1615
|
+
if (elephant) {
|
|
1616
|
+
const trunk = joint("trunk", [
|
|
1617
|
+
0,
|
|
1618
|
+
neckTop - headR * .3,
|
|
1619
|
+
headZ + l * .11
|
|
1620
|
+
]);
|
|
1621
|
+
segment([
|
|
1622
|
+
0,
|
|
1623
|
+
neckTop - headR * .3,
|
|
1624
|
+
headZ + l * .11
|
|
1625
|
+
], [
|
|
1626
|
+
0,
|
|
1627
|
+
h * .38,
|
|
1628
|
+
headZ + l * .17
|
|
1629
|
+
], w * .14, w * .09, body.color, trunk);
|
|
1630
|
+
segment([
|
|
1631
|
+
0,
|
|
1632
|
+
h * .38,
|
|
1633
|
+
headZ + l * .17
|
|
1634
|
+
], [
|
|
1635
|
+
0,
|
|
1636
|
+
h * .16,
|
|
1637
|
+
headZ + l * .22
|
|
1638
|
+
], w * .09, w * .04, body.color, trunk);
|
|
1639
|
+
}
|
|
1640
|
+
if (detail("stripes") && tier < 2) for (let i = 0; i < 6; i++) {
|
|
1641
|
+
const z = -l * .25 + i * l * .09;
|
|
1642
|
+
for (const side of [-1, 1]) segment([
|
|
1643
|
+
side * w * .45,
|
|
1644
|
+
torsoY - torsoRadius * .4,
|
|
1645
|
+
z
|
|
1646
|
+
], [
|
|
1647
|
+
side * w * .4,
|
|
1648
|
+
torsoY + torsoRadius * .55,
|
|
1649
|
+
z + l * .02
|
|
1650
|
+
], w * .025, w * .018, body.accent);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
const geometry = new THREE.BufferGeometry();
|
|
1654
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
|
|
1655
|
+
geometry.setAttribute("normal", new THREE.Float32BufferAttribute(normals, 3));
|
|
1656
|
+
geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));
|
|
1657
|
+
geometry.setAttribute("skinIndex", new THREE.Uint16BufferAttribute(skin, 4));
|
|
1658
|
+
geometry.setAttribute("skinWeight", new THREE.Float32BufferAttribute(weights, 4));
|
|
1659
|
+
geometry.computeBoundingBox();
|
|
1660
|
+
geometry.computeBoundingSphere();
|
|
1661
|
+
return {
|
|
1662
|
+
geometry,
|
|
1663
|
+
joints,
|
|
1664
|
+
triangles: positions.length / 9
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
//#endregion
|
|
1668
|
+
//#region src/client/wildlife.ts
|
|
1669
|
+
/** One opaque skinned draw per visible animal. Geometry is shared and released on disposal. */
|
|
1670
|
+
var WildlifeRenderer = class {
|
|
1671
|
+
prepare;
|
|
1672
|
+
group = new THREE.Group();
|
|
1673
|
+
material = new THREE.MeshStandardMaterial({
|
|
1674
|
+
vertexColors: true,
|
|
1675
|
+
roughness: .85,
|
|
1676
|
+
metalness: 0,
|
|
1677
|
+
flatShading: true
|
|
1678
|
+
});
|
|
1679
|
+
cache = /* @__PURE__ */ new Map();
|
|
1680
|
+
active = /* @__PURE__ */ new Map();
|
|
1681
|
+
frame = 0;
|
|
1682
|
+
cursor = 0;
|
|
1683
|
+
budget = {
|
|
1684
|
+
animals: 32,
|
|
1685
|
+
radius: 180,
|
|
1686
|
+
posesPerFrame: 16
|
|
1687
|
+
};
|
|
1688
|
+
constructor(prepare) {
|
|
1689
|
+
this.prepare = prepare;
|
|
1690
|
+
this.group.name = "ambient:wildlife";
|
|
1691
|
+
}
|
|
1692
|
+
setBudget(budget) {
|
|
1693
|
+
this.budget = {
|
|
1694
|
+
...this.budget,
|
|
1695
|
+
...budget
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
get count() {
|
|
1699
|
+
return this.active.size;
|
|
1700
|
+
}
|
|
1701
|
+
get triangles() {
|
|
1702
|
+
let count = 0;
|
|
1703
|
+
for (const animal of this.active.values()) count += animal.geometry.triangles;
|
|
1704
|
+
return count;
|
|
1705
|
+
}
|
|
1706
|
+
remove(id, animal) {
|
|
1707
|
+
animal.mesh.skeleton.dispose();
|
|
1708
|
+
animal.root.removeFromParent();
|
|
1709
|
+
this.active.delete(id);
|
|
1710
|
+
}
|
|
1711
|
+
update(agents, species, camera, seconds, appearance) {
|
|
1712
|
+
this.frame++;
|
|
1713
|
+
const visible = agents.map((agent) => ({
|
|
1714
|
+
agent,
|
|
1715
|
+
distance: Math.hypot(agent.position[0] - camera[0], agent.position[1] - camera[1], agent.position[2] - camera[2])
|
|
1716
|
+
})).filter(({ distance }) => distance < this.budget.radius).sort((a, b) => a.distance - b.distance || (a.agent.id < b.agent.id ? -1 : 1)).slice(0, this.budget.animals);
|
|
1717
|
+
const pose = [];
|
|
1718
|
+
for (const { agent, distance } of visible) {
|
|
1719
|
+
const base = species.get(agent.species);
|
|
1720
|
+
const recipe = base === void 0 ? void 0 : appearance?.(agent, base) ?? base;
|
|
1721
|
+
if (recipe === void 0 || recipe.body.family === "insect" && distance > 10 || recipe.body.height < .1 && distance > 25) continue;
|
|
1722
|
+
const tier = distance < 35 ? 0 : distance < 100 ? 1 : 2;
|
|
1723
|
+
const key = `${recipe.id}@${recipe.version}/${recipe.body.color}/${tier}`;
|
|
1724
|
+
let animal = this.active.get(agent.id);
|
|
1725
|
+
if (animal?.key !== key) {
|
|
1726
|
+
if (animal !== void 0) this.remove(agent.id, animal);
|
|
1727
|
+
let geometry = this.cache.get(key);
|
|
1728
|
+
if (geometry === void 0) {
|
|
1729
|
+
geometry = wildlifeGeometry(recipe, tier);
|
|
1730
|
+
this.cache.set(key, geometry);
|
|
1731
|
+
}
|
|
1732
|
+
const mesh = new THREE.SkinnedMesh(geometry.geometry, this.material);
|
|
1733
|
+
const bones = geometry.joints.map((joint) => {
|
|
1734
|
+
const bone = new THREE.Bone();
|
|
1735
|
+
bone.name = joint.name;
|
|
1736
|
+
bone.position.set(...joint.pivot);
|
|
1737
|
+
mesh.add(bone);
|
|
1738
|
+
return bone;
|
|
1739
|
+
});
|
|
1740
|
+
mesh.bind(new THREE.Skeleton(bones));
|
|
1741
|
+
mesh.castShadow = tier === 0;
|
|
1742
|
+
mesh.receiveShadow = true;
|
|
1743
|
+
const root = new THREE.Group();
|
|
1744
|
+
root.add(mesh);
|
|
1745
|
+
root.userData.walkIgnore = true;
|
|
1746
|
+
root.traverse((object) => {
|
|
1747
|
+
object.userData.walkIgnore = true;
|
|
1748
|
+
});
|
|
1749
|
+
this.group.add(root);
|
|
1750
|
+
this.prepare?.(root);
|
|
1751
|
+
animal = {
|
|
1752
|
+
root,
|
|
1753
|
+
mesh,
|
|
1754
|
+
bones,
|
|
1755
|
+
geometry,
|
|
1756
|
+
key,
|
|
1757
|
+
seen: this.frame
|
|
1758
|
+
};
|
|
1759
|
+
this.active.set(agent.id, animal);
|
|
1760
|
+
}
|
|
1761
|
+
animal.seen = this.frame;
|
|
1762
|
+
animal.root.position.set(...agent.position);
|
|
1763
|
+
animal.root.rotation.y = agent.heading;
|
|
1764
|
+
pose.push({
|
|
1765
|
+
animal,
|
|
1766
|
+
agent,
|
|
1767
|
+
species: recipe
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
for (const [id, animal] of this.active) if (animal.seen !== this.frame) this.remove(id, animal);
|
|
1771
|
+
const count = Math.min(pose.length, this.budget.posesPerFrame);
|
|
1772
|
+
const near = Math.ceil(count / 2), remaining = pose.length - near;
|
|
1773
|
+
for (let i = 0; i < count; i++) {
|
|
1774
|
+
const entry = pose[i < near ? i : near + (this.cursor + i - near) % remaining];
|
|
1775
|
+
if (entry === void 0) continue;
|
|
1776
|
+
const { animal, agent, species: recipe } = entry;
|
|
1777
|
+
const gait = agent.phase * Math.PI * 2;
|
|
1778
|
+
const flying = recipe.motion === "fly";
|
|
1779
|
+
const flapping = Math.sin(seconds * (recipe.body.family === "insect" ? 45 : 6 / Math.max(.3, recipe.body.length)) + agent.seed % 100);
|
|
1780
|
+
animal.root.position.y = agent.position[1] + (recipe.motion === "hop" && agent.speed > .01 ? Math.abs(Math.sin(gait)) * recipe.body.height * .12 : 0);
|
|
1781
|
+
for (let index = 0; index < animal.bones.length; index++) {
|
|
1782
|
+
const bone = animal.bones[index];
|
|
1783
|
+
if (bone === void 0) continue;
|
|
1784
|
+
const name = animal.geometry.joints[index]?.name ?? "";
|
|
1785
|
+
bone.rotation.set(0, 0, 0);
|
|
1786
|
+
if (name.startsWith("leg.") && agent.speed > .01) {
|
|
1787
|
+
const reverse = name.includes("rear") !== name.endsWith(".r");
|
|
1788
|
+
bone.rotation.x = Math.sin(gait + (recipe.motion === "hop" ? 0 : reverse ? Math.PI : 0)) * (recipe.motion === "hop" ? .22 : .27);
|
|
1789
|
+
} else if (name.startsWith("wing.") && flying) bone.rotation.z = flapping * (name.endsWith(".l") ? -.55 : .55);
|
|
1790
|
+
else if (name === "tail") bone.rotation.y = Math.sin(recipe.motion === "swim" ? seconds * 5 : gait) * .15;
|
|
1791
|
+
else if (name === "head" && agent.speed < .01) bone.rotation.x = Math.sin(seconds * .4 + agent.seed % 30) * .08;
|
|
1792
|
+
else if (name === "trunk") bone.rotation.x = Math.sin(seconds * .7) * .06;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
if (remaining > 0) this.cursor = (this.cursor + count - near) % remaining;
|
|
1796
|
+
if (this.cache.size > 96) {
|
|
1797
|
+
const used = new Set([...this.active.values()].map((animal) => animal.key));
|
|
1798
|
+
for (const [key, geometry] of this.cache) if (!used.has(key)) {
|
|
1799
|
+
geometry.geometry.dispose();
|
|
1800
|
+
this.cache.delete(key);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
dispose() {
|
|
1805
|
+
for (const [id, animal] of this.active) this.remove(id, animal);
|
|
1806
|
+
for (const geometry of this.cache.values()) geometry.geometry.dispose();
|
|
1807
|
+
this.cache.clear();
|
|
1808
|
+
this.material.dispose();
|
|
1809
|
+
this.group.removeFromParent();
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
//#endregion
|
|
1069
1813
|
//#region src/client.ts
|
|
1070
1814
|
/**
|
|
1071
1815
|
* @bendyline/molen-ambient/client — rendering for ambient NPCs: instanced vehicle proxies with
|
|
@@ -1074,4 +1818,4 @@ function createAmbientRenderer(options) {
|
|
|
1074
1818
|
*/
|
|
1075
1819
|
registerAmbientSchema();
|
|
1076
1820
|
//#endregion
|
|
1077
|
-
export { AmbientFigures, ProxyBatches, ambientVehicleKind, createAmbientRenderer, proxyGeometry, proxyHeight, proxyShapeFor };
|
|
1821
|
+
export { AmbientFigures, ProxyBatches, WildlifeRenderer, ambientVehicleKind, createAmbientRenderer, proxyGeometry, proxyHeight, proxyShapeFor, wildlifeGeometry };
|
package/dist/kernel.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as WildlifeWorld, c as WILDLIFE_FAMILIES, d as WildlifeHabitat, f as WildlifeMotion, i as WildlifeBudget, l as WildlifeChoice, m as wildlifeSpeciesSchema, n as WILDLIFE_TICK_RATE, o as stepWildlife, p as WildlifeSpecies, r as WildlifeAgent, s as wildlifeCandidates, t as WILDLIFE_CELL_METERS, u as WildlifeFamily } from "./wildlife-B4EL0z-N.mjs";
|
|
1
2
|
import { Quat } from "@bendyline/molen-kernel/determinism";
|
|
2
3
|
import { ComponentType, JsonObject, World } from "@bendyline/molen-kernel/world";
|
|
3
4
|
import { ComponentMap, EntityId, SceneManifest } from "@bendyline/molen-schema";
|
|
@@ -892,4 +893,4 @@ interface ObserverView {
|
|
|
892
893
|
keep?: number;
|
|
893
894
|
}
|
|
894
895
|
//#endregion
|
|
895
|
-
export { AMBIENT_AGENT_COMPONENT, AMBIENT_ENTITY, AMBIENT_KINDS, AMBIENT_OBSERVER_COMPONENT, AMBIENT_ROLE_COMPONENT, AMBIENT_STATE_COMPONENT, type AgentEnv, AmbientAgent, type AmbientAgentData, type AmbientAirCorridor, type AmbientBox, type AmbientBudget, type AmbientCapabilityOptions, type AmbientClassPolicy, type AmbientHandle, type AmbientKind, AmbientObserver, type AmbientObserverData, type AmbientObserverState, type AmbientOptions, type AmbientPedestrianType, type AmbientPolicy, type AmbientPolyline, AmbientRole, type AmbientRoleData, type AmbientRoleVisual, type AmbientSolid, type AmbientSpawnInfo, AmbientState, type AmbientStateData, type AmbientStats, type AmbientTemplate, type AmbientTileInput, type AmbientTypes, type AmbientVehicleType, CAR_COLORS, DEFAULT_POLICY, DEFAULT_TEMPLATES, DEFAULT_TYPES, type DeepPartial, type DriverParams, type EdgeDraft, type EdgeSpan, GRID_CELL, type JunctionArm, type JunctionControl, KIND_SPEED, LaneGrid, type LaneMovement, type LaneSample, type LaneStop, type ObserverView, type PlanarNode, type PlanarPiece, type PlanarResult, type RoadKind, type SignalColor, type SignalTiming, TRANSPORT_NETWORK_EXAMPLE, TRANSPORT_NETWORK_FORMAT, type TransportClass, type TransportCrossing, type TransportEdge, type TransportJunction, type TransportLane, TransportNetwork, type TransportNetworkAerodrome, type TransportNetworkDocument, type TransportNetworkOptions, type TransportNetworkPoint, type TransportNetworkSignal, type TransportNetworkStation, type TransportNetworkStats, type TransportNetworkWay, type TransportNode, type TransportRunway, type TurnKind, type WorldPoi, agentRotation, agentSample, allRed, ambientCapability, ambientOf, ambientScriptApi, chooseNext, classifyFeature, clipPolyline, edgeHeight, featureDrafts, fmix32, idmAcceleration, installAmbient, laneCoordinate, laneEdgeDistance, laneSample, mergePolicy, networkToDocument, pickWeighted, planarSplit, policyForBudget, pseudoAngle, registerAmbientSchema, sampleConnector, sampleLaneBody, signalColor, signalTiming, stepAgents, stoppingDistance, unit01, walkBack };
|
|
896
|
+
export { AMBIENT_AGENT_COMPONENT, AMBIENT_ENTITY, AMBIENT_KINDS, AMBIENT_OBSERVER_COMPONENT, AMBIENT_ROLE_COMPONENT, AMBIENT_STATE_COMPONENT, type AgentEnv, AmbientAgent, type AmbientAgentData, type AmbientAirCorridor, type AmbientBox, type AmbientBudget, type AmbientCapabilityOptions, type AmbientClassPolicy, type AmbientHandle, type AmbientKind, AmbientObserver, type AmbientObserverData, type AmbientObserverState, type AmbientOptions, type AmbientPedestrianType, type AmbientPolicy, type AmbientPolyline, AmbientRole, type AmbientRoleData, type AmbientRoleVisual, type AmbientSolid, type AmbientSpawnInfo, AmbientState, type AmbientStateData, type AmbientStats, type AmbientTemplate, type AmbientTileInput, type AmbientTypes, type AmbientVehicleType, CAR_COLORS, DEFAULT_POLICY, DEFAULT_TEMPLATES, DEFAULT_TYPES, type DeepPartial, type DriverParams, type EdgeDraft, type EdgeSpan, GRID_CELL, type JunctionArm, type JunctionControl, KIND_SPEED, LaneGrid, type LaneMovement, type LaneSample, type LaneStop, type ObserverView, type PlanarNode, type PlanarPiece, type PlanarResult, type RoadKind, type SignalColor, type SignalTiming, TRANSPORT_NETWORK_EXAMPLE, TRANSPORT_NETWORK_FORMAT, type TransportClass, type TransportCrossing, type TransportEdge, type TransportJunction, type TransportLane, TransportNetwork, type TransportNetworkAerodrome, type TransportNetworkDocument, type TransportNetworkOptions, type TransportNetworkPoint, type TransportNetworkSignal, type TransportNetworkStation, type TransportNetworkStats, type TransportNetworkWay, type TransportNode, type TransportRunway, type TurnKind, WILDLIFE_CELL_METERS, WILDLIFE_FAMILIES, WILDLIFE_TICK_RATE, type WildlifeAgent, type WildlifeBudget, type WildlifeChoice, type WildlifeFamily, type WildlifeHabitat, type WildlifeMotion, type WildlifeSpecies, type WildlifeWorld, type WorldPoi, agentRotation, agentSample, allRed, ambientCapability, ambientOf, ambientScriptApi, chooseNext, classifyFeature, clipPolyline, edgeHeight, featureDrafts, fmix32, idmAcceleration, installAmbient, laneCoordinate, laneEdgeDistance, laneSample, mergePolicy, networkToDocument, pickWeighted, planarSplit, policyForBudget, pseudoAngle, registerAmbientSchema, sampleConnector, sampleLaneBody, signalColor, signalTiming, stepAgents, stepWildlife, stoppingDistance, unit01, walkBack, wildlifeCandidates, wildlifeSpeciesSchema };
|
package/dist/kernel.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { _ as KIND_SPEED, a as AmbientRole, b as featureDrafts, c as AMBIENT_OBS
|
|
|
2
2
|
import { createRng, dmath, lookRotation, quatRotateVec3, seedToInt } from "@bendyline/molen-kernel/determinism";
|
|
3
3
|
import { Transform, componentHandle } from "@bendyline/molen-kernel/world";
|
|
4
4
|
import { deepMergeJson, resolvePrefab, validateByKind } from "@bendyline/molen-schema";
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
import { PATH_SURFACE_LIFT, ROAD_SURFACE_LIFT, bridgeDeckHeightFn, lineSegmentIndex, sampleTerrainLine } from "@bendyline/molen-terrain/kernel";
|
|
6
7
|
//#region src/kernel/agents/idm.ts
|
|
7
8
|
/** Intelligent Driver Model: acceleration from speed, desired speed and the gap to a leader. */
|
|
@@ -3974,7 +3975,186 @@ function networkToDocument(network, meta = {}, options = {}) {
|
|
|
3974
3975
|
};
|
|
3975
3976
|
}
|
|
3976
3977
|
//#endregion
|
|
3978
|
+
//#region src/kernel/wildlife.ts
|
|
3979
|
+
/** Bounded, fixed-step ambient wildlife. No global randomness, timers, geography or renderer. */
|
|
3980
|
+
const WILDLIFE_TICK_RATE = 20;
|
|
3981
|
+
const WILDLIFE_CELL_METERS = 96;
|
|
3982
|
+
function suitable(species, habitat) {
|
|
3983
|
+
return habitat?.safe === true && Number.isFinite(habitat.height) && (species.motion === "fly" || (species.motion === "swim" ? habitat.water : !habitat.water));
|
|
3984
|
+
}
|
|
3985
|
+
function heightFor(species, habitat) {
|
|
3986
|
+
return habitat.height + (species.motion === "fly" ? species.clearance : species.motion === "swim" ? -species.clearance : 0);
|
|
3987
|
+
}
|
|
3988
|
+
/** Stable world-grid candidates. Adding an unrelated species does not reroll an existing one. */
|
|
3989
|
+
function wildlifeCandidates(world, observer, budget, tick = 0) {
|
|
3990
|
+
const radius = Math.max(0, Math.min(2e3, budget.radius));
|
|
3991
|
+
const density = dmath.clamp(budget.density, 0, 1);
|
|
3992
|
+
const limit = Math.max(0, Math.min(256, Math.floor(budget.animals)));
|
|
3993
|
+
if (limit === 0 || density === 0 || !observer.every(Number.isFinite)) return [];
|
|
3994
|
+
const size = 96;
|
|
3995
|
+
const found = [];
|
|
3996
|
+
for (let row = Math.floor((observer[2] - radius) / size); row <= Math.floor((observer[2] + radius) / size); row++) for (let column = Math.floor((observer[0] - radius) / size); column <= Math.floor((observer[0] + radius) / size); column++) {
|
|
3997
|
+
const choices = world.choices((column + .5) * size, (row + .5) * size);
|
|
3998
|
+
for (const choice of choices) {
|
|
3999
|
+
const species = choice.species;
|
|
4000
|
+
const id = `${species.id}@${species.version}/${column}/${row}`;
|
|
4001
|
+
const seed = fnv1a(id);
|
|
4002
|
+
if (unit01(seed, 0) >= Math.min(1, choice.density * size * size / 1e6) * density) continue;
|
|
4003
|
+
const x = q4((column + .15 + unit01(seed, 1) * .7) * size);
|
|
4004
|
+
const z = q4((row + .15 + unit01(seed, 2) * .7) * size);
|
|
4005
|
+
const distance = (x - observer[0]) ** 2 + (z - observer[2]) ** 2;
|
|
4006
|
+
if (distance > radius * radius) continue;
|
|
4007
|
+
const actual = world.choices(x, z).find((entry) => entry.species.id === species.id);
|
|
4008
|
+
if (actual === void 0 || unit01(seed, 0) >= Math.min(1, actual.density * size * size / 1e6) * density) continue;
|
|
4009
|
+
const habitat = world.habitat(x, z, species.margin);
|
|
4010
|
+
if (!suitable(species, habitat) || !actual.habitats.includes(habitat.kind)) continue;
|
|
4011
|
+
const y = heightFor(species, habitat);
|
|
4012
|
+
if ((y - observer[1]) ** 2 + distance > radius * radius) continue;
|
|
4013
|
+
found.push({
|
|
4014
|
+
distance,
|
|
4015
|
+
agent: {
|
|
4016
|
+
id,
|
|
4017
|
+
species: species.id,
|
|
4018
|
+
seed,
|
|
4019
|
+
anchor: [x, z],
|
|
4020
|
+
position: [
|
|
4021
|
+
x,
|
|
4022
|
+
q4(y),
|
|
4023
|
+
z
|
|
4024
|
+
],
|
|
4025
|
+
target: [x, z],
|
|
4026
|
+
heading: unit01(seed, 3) * dmath.PI * 2,
|
|
4027
|
+
speed: 0,
|
|
4028
|
+
since: tick,
|
|
4029
|
+
nextDecision: tick,
|
|
4030
|
+
decisions: 0,
|
|
4031
|
+
phase: unit01(seed, 4)
|
|
4032
|
+
}
|
|
4033
|
+
});
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
return found.sort((a, b) => a.distance - b.distance || (a.agent.id < b.agent.id ? -1 : 1)).slice(0, limit).map(({ agent }) => agent);
|
|
4037
|
+
}
|
|
4038
|
+
/** Advance one 1/20-second step. A host can snapshot these plain records without hidden state. */
|
|
4039
|
+
function stepWildlife(agents, speciesById, world, tick) {
|
|
4040
|
+
const next = [];
|
|
4041
|
+
for (const previous of agents) {
|
|
4042
|
+
const species = speciesById.get(previous.species);
|
|
4043
|
+
if (species === void 0) continue;
|
|
4044
|
+
const start = world.habitat(previous.position[0], previous.position[2], species.margin);
|
|
4045
|
+
const currentChoice = world.choices(previous.position[0], previous.position[2]).find((choice) => choice.species.id === species.id);
|
|
4046
|
+
if (!suitable(species, start) || currentChoice === void 0 || !currentChoice.habitats.includes(start.kind)) continue;
|
|
4047
|
+
const agent = {
|
|
4048
|
+
...previous,
|
|
4049
|
+
position: [...previous.position],
|
|
4050
|
+
target: [...previous.target]
|
|
4051
|
+
};
|
|
4052
|
+
if (tick >= agent.nextDecision) {
|
|
4053
|
+
const stream = 10 + agent.decisions++ * 4;
|
|
4054
|
+
const angle = unit01(agent.seed, stream) * dmath.PI * 2;
|
|
4055
|
+
const radius = species.roam * dmath.sqrt(unit01(agent.seed, stream + 1));
|
|
4056
|
+
agent.target = species.motion !== "fly" && species.motion !== "swim" && unit01(agent.seed, stream + 2) < species.rest ? [agent.position[0], agent.position[2]] : [q4(agent.anchor[0] + dmath.cos(angle) * radius), q4(agent.anchor[1] + dmath.sin(angle) * radius)];
|
|
4057
|
+
agent.nextDecision = tick + Math.floor((4 + unit01(agent.seed, stream + 3) * 8) * 20);
|
|
4058
|
+
agent.since = tick;
|
|
4059
|
+
}
|
|
4060
|
+
const dx = agent.target[0] - agent.position[0];
|
|
4061
|
+
const dz = agent.target[1] - agent.position[2];
|
|
4062
|
+
const distance = dmath.sqrt(dx * dx + dz * dz);
|
|
4063
|
+
const travel = Math.min(distance, species.speed / 20);
|
|
4064
|
+
agent.speed = 0;
|
|
4065
|
+
if (distance > .01) {
|
|
4066
|
+
const x = q4(agent.position[0] + dx / distance * travel);
|
|
4067
|
+
const z = q4(agent.position[2] + dz / distance * travel);
|
|
4068
|
+
const steps = Math.max(1, Math.ceil(travel / Math.max(.1, species.margin)));
|
|
4069
|
+
let destination;
|
|
4070
|
+
for (let i = 1; i <= steps; i++) {
|
|
4071
|
+
const sx = agent.position[0] + (x - agent.position[0]) * i / steps;
|
|
4072
|
+
const sz = agent.position[2] + (z - agent.position[2]) * i / steps;
|
|
4073
|
+
const habitat = world.habitat(sx, sz, species.margin);
|
|
4074
|
+
const choice = world.choices(sx, sz).find((entry) => entry.species.id === species.id);
|
|
4075
|
+
if (!suitable(species, habitat) || choice === void 0 || !choice.habitats.includes(habitat.kind)) {
|
|
4076
|
+
destination = void 0;
|
|
4077
|
+
break;
|
|
4078
|
+
}
|
|
4079
|
+
destination = habitat;
|
|
4080
|
+
}
|
|
4081
|
+
if (destination !== void 0) {
|
|
4082
|
+
agent.position = [
|
|
4083
|
+
x,
|
|
4084
|
+
q4(heightFor(species, destination)),
|
|
4085
|
+
z
|
|
4086
|
+
];
|
|
4087
|
+
agent.heading = dmath.atan2(dx, dz);
|
|
4088
|
+
agent.speed = q4(travel * 20);
|
|
4089
|
+
agent.phase = q4((agent.phase + travel / Math.max(.1, species.body.length)) % 1);
|
|
4090
|
+
} else agent.nextDecision = tick + 1;
|
|
4091
|
+
} else if (species.motion === "fly" || species.motion === "swim") agent.nextDecision = tick + 1;
|
|
4092
|
+
next.push(agent);
|
|
4093
|
+
}
|
|
4094
|
+
return next;
|
|
4095
|
+
}
|
|
4096
|
+
//#endregion
|
|
4097
|
+
//#region src/kernel/wildlife-types.ts
|
|
4098
|
+
/** Data-only animal silhouettes and habitat populations. Content owns species and range facts. */
|
|
4099
|
+
const WILDLIFE_FAMILIES = [
|
|
4100
|
+
"ungulate",
|
|
4101
|
+
"canid",
|
|
4102
|
+
"feline",
|
|
4103
|
+
"rodent",
|
|
4104
|
+
"lagomorph",
|
|
4105
|
+
"hopper",
|
|
4106
|
+
"elephant",
|
|
4107
|
+
"bird",
|
|
4108
|
+
"reptile",
|
|
4109
|
+
"fish",
|
|
4110
|
+
"insect"
|
|
4111
|
+
];
|
|
4112
|
+
const id = z.string().regex(/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/);
|
|
4113
|
+
const color = z.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
4114
|
+
const wildlifeSpeciesSchema = z.strictObject({
|
|
4115
|
+
id,
|
|
4116
|
+
version: z.int().positive(),
|
|
4117
|
+
title: z.string().min(1),
|
|
4118
|
+
taxon: z.string().min(1).optional(),
|
|
4119
|
+
range: z.string().min(1).optional(),
|
|
4120
|
+
winterColor: color.optional(),
|
|
4121
|
+
inactiveInWinter: z.boolean().optional(),
|
|
4122
|
+
body: z.strictObject({
|
|
4123
|
+
family: z.enum(WILDLIFE_FAMILIES),
|
|
4124
|
+
height: z.number().min(.01).max(7),
|
|
4125
|
+
length: z.number().min(.01).max(12),
|
|
4126
|
+
width: z.number().min(.005).max(5),
|
|
4127
|
+
color,
|
|
4128
|
+
accent: color,
|
|
4129
|
+
details: z.array(z.enum([
|
|
4130
|
+
"antlers",
|
|
4131
|
+
"horns",
|
|
4132
|
+
"long-neck",
|
|
4133
|
+
"bushy-tail",
|
|
4134
|
+
"stripes",
|
|
4135
|
+
"spots",
|
|
4136
|
+
"wader",
|
|
4137
|
+
"waterfowl",
|
|
4138
|
+
"raptor",
|
|
4139
|
+
"parrot",
|
|
4140
|
+
"long-tail"
|
|
4141
|
+
]))
|
|
4142
|
+
}),
|
|
4143
|
+
motion: z.enum([
|
|
4144
|
+
"walk",
|
|
4145
|
+
"hop",
|
|
4146
|
+
"fly",
|
|
4147
|
+
"swim",
|
|
4148
|
+
"crawl"
|
|
4149
|
+
]),
|
|
4150
|
+
speed: z.number().min(.01).max(30),
|
|
4151
|
+
roam: z.number().min(1).max(200),
|
|
4152
|
+
clearance: z.number().min(0).max(80),
|
|
4153
|
+
rest: z.number().min(0).max(1),
|
|
4154
|
+
margin: z.number().min(.02).max(8)
|
|
4155
|
+
}).refine((species) => species.taxon === void 0 === (species.range === void 0), { message: "Named wildlife taxa require an attributed range; unnamed functional groups omit both." });
|
|
4156
|
+
//#endregion
|
|
3977
4157
|
//#region src/kernel.ts
|
|
3978
4158
|
registerAmbientSchema();
|
|
3979
4159
|
//#endregion
|
|
3980
|
-
export { AMBIENT_AGENT_COMPONENT, AMBIENT_ENTITY, AMBIENT_KINDS, AMBIENT_OBSERVER_COMPONENT, AMBIENT_ROLE_COMPONENT, AMBIENT_STATE_COMPONENT, AmbientAgent, AmbientObserver, AmbientRole, AmbientState, CAR_COLORS, DEFAULT_POLICY, DEFAULT_TEMPLATES, DEFAULT_TYPES, GRID_CELL, KIND_SPEED, LaneGrid, TRANSPORT_NETWORK_EXAMPLE, TRANSPORT_NETWORK_FORMAT, TransportNetwork, agentRotation, agentSample, allRed, ambientCapability, ambientOf, ambientScriptApi, chooseNext, classifyFeature, clipPolyline, edgeHeight, featureDrafts, fmix32, idmAcceleration, installAmbient, laneCoordinate, laneEdgeDistance, laneSample, mergePolicy, networkToDocument, pickWeighted, planarSplit, policyForBudget, pseudoAngle, registerAmbientSchema, sampleConnector, sampleLaneBody, signalColor, signalTiming, stepAgents, stoppingDistance, unit01, walkBack };
|
|
4160
|
+
export { AMBIENT_AGENT_COMPONENT, AMBIENT_ENTITY, AMBIENT_KINDS, AMBIENT_OBSERVER_COMPONENT, AMBIENT_ROLE_COMPONENT, AMBIENT_STATE_COMPONENT, AmbientAgent, AmbientObserver, AmbientRole, AmbientState, CAR_COLORS, DEFAULT_POLICY, DEFAULT_TEMPLATES, DEFAULT_TYPES, GRID_CELL, KIND_SPEED, LaneGrid, TRANSPORT_NETWORK_EXAMPLE, TRANSPORT_NETWORK_FORMAT, TransportNetwork, WILDLIFE_CELL_METERS, WILDLIFE_FAMILIES, WILDLIFE_TICK_RATE, agentRotation, agentSample, allRed, ambientCapability, ambientOf, ambientScriptApi, chooseNext, classifyFeature, clipPolyline, edgeHeight, featureDrafts, fmix32, idmAcceleration, installAmbient, laneCoordinate, laneEdgeDistance, laneSample, mergePolicy, networkToDocument, pickWeighted, planarSplit, policyForBudget, pseudoAngle, registerAmbientSchema, sampleConnector, sampleLaneBody, signalColor, signalTiming, stepAgents, stepWildlife, stoppingDistance, unit01, walkBack, wildlifeCandidates, wildlifeSpeciesSchema };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/kernel/wildlife-types.d.ts
|
|
4
|
+
declare const WILDLIFE_FAMILIES: readonly ["ungulate", "canid", "feline", "rodent", "lagomorph", "hopper", "elephant", "bird", "reptile", "fish", "insect"];
|
|
5
|
+
type WildlifeFamily = (typeof WILDLIFE_FAMILIES)[number];
|
|
6
|
+
type WildlifeMotion = "walk" | "hop" | "fly" | "swim" | "crawl";
|
|
7
|
+
interface WildlifeSpecies {
|
|
8
|
+
id: string;
|
|
9
|
+
version: number;
|
|
10
|
+
title: string;
|
|
11
|
+
/** Omitted for functional habitat groups that make no precise species claim. */
|
|
12
|
+
taxon?: string;
|
|
13
|
+
/** Identifier in an attributed range document. Named taxa require a range at the Earth binding. */
|
|
14
|
+
range?: string;
|
|
15
|
+
/** Coarse seasonal appearance/activity; not a weather or migration model. */
|
|
16
|
+
winterColor?: string;
|
|
17
|
+
inactiveInWinter?: boolean;
|
|
18
|
+
body: {
|
|
19
|
+
family: WildlifeFamily; /** Meters: standing height, nose-to-rump length, torso width. Wings and tails may extend them. */
|
|
20
|
+
height: number;
|
|
21
|
+
length: number;
|
|
22
|
+
width: number;
|
|
23
|
+
color: string;
|
|
24
|
+
accent: string;
|
|
25
|
+
details: Array<"antlers" | "horns" | "long-neck" | "bushy-tail" | "stripes" | "spots" | "wader" | "waterfowl" | "raptor" | "parrot" | "long-tail">;
|
|
26
|
+
};
|
|
27
|
+
motion: WildlifeMotion;
|
|
28
|
+
/** Meters per second. This is ambient travel, not maximum running speed. */
|
|
29
|
+
speed: number;
|
|
30
|
+
/** Maximum travel from the stable spawn anchor in meters. */
|
|
31
|
+
roam: number;
|
|
32
|
+
/** Height above ground/water for flight; depth below the surface for swimming. */
|
|
33
|
+
clearance: number;
|
|
34
|
+
/** Probability of resting at a target. Flying/swimming animals keep moving. */
|
|
35
|
+
rest: number;
|
|
36
|
+
/** Body-size clearance from obstacles, meters. */
|
|
37
|
+
margin: number;
|
|
38
|
+
}
|
|
39
|
+
/** Already selected by the host's regional/range resolver. Density is a visual population prior. */
|
|
40
|
+
interface WildlifeChoice {
|
|
41
|
+
species: WildlifeSpecies;
|
|
42
|
+
density: number;
|
|
43
|
+
habitats: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
interface WildlifeHabitat {
|
|
46
|
+
/** Actual mapped surface, not potential vegetation from a biome map. */
|
|
47
|
+
kind: string;
|
|
48
|
+
height: number;
|
|
49
|
+
water: boolean;
|
|
50
|
+
/** False on roads, buildings, steep terrain, or insufficiently known terrain. */
|
|
51
|
+
safe: boolean;
|
|
52
|
+
}
|
|
53
|
+
declare const wildlifeSpeciesSchema: z.ZodType<WildlifeSpecies>;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/kernel/wildlife.d.ts
|
|
56
|
+
declare const WILDLIFE_TICK_RATE = 20;
|
|
57
|
+
declare const WILDLIFE_CELL_METERS = 96;
|
|
58
|
+
interface WildlifeAgent {
|
|
59
|
+
id: string;
|
|
60
|
+
species: string;
|
|
61
|
+
seed: number;
|
|
62
|
+
anchor: [number, number];
|
|
63
|
+
position: [number, number, number];
|
|
64
|
+
target: [number, number];
|
|
65
|
+
heading: number;
|
|
66
|
+
speed: number;
|
|
67
|
+
since: number;
|
|
68
|
+
nextDecision: number;
|
|
69
|
+
decisions: number;
|
|
70
|
+
phase: number;
|
|
71
|
+
}
|
|
72
|
+
interface WildlifeWorld {
|
|
73
|
+
choices(x: number, z: number): readonly WildlifeChoice[];
|
|
74
|
+
habitat(x: number, z: number, margin: number): WildlifeHabitat | undefined;
|
|
75
|
+
}
|
|
76
|
+
interface WildlifeBudget {
|
|
77
|
+
animals: number;
|
|
78
|
+
radius: number;
|
|
79
|
+
/** 0..1 stable thinning. Changing quality keeps existing candidate identities. */
|
|
80
|
+
density: number;
|
|
81
|
+
}
|
|
82
|
+
/** Stable world-grid candidates. Adding an unrelated species does not reroll an existing one. */
|
|
83
|
+
declare function wildlifeCandidates(world: WildlifeWorld, observer: readonly [number, number, number], budget: WildlifeBudget, tick?: number): WildlifeAgent[];
|
|
84
|
+
/** Advance one 1/20-second step. A host can snapshot these plain records without hidden state. */
|
|
85
|
+
declare function stepWildlife(agents: readonly WildlifeAgent[], speciesById: ReadonlyMap<string, WildlifeSpecies>, world: WildlifeWorld, tick: number): WildlifeAgent[];
|
|
86
|
+
//#endregion
|
|
87
|
+
export { WildlifeWorld as a, WILDLIFE_FAMILIES as c, WildlifeHabitat as d, WildlifeMotion as f, WildlifeBudget as i, WildlifeChoice as l, wildlifeSpeciesSchema as m, WILDLIFE_TICK_RATE as n, stepWildlife as o, WildlifeSpecies as p, WildlifeAgent as r, wildlifeCandidates as s, WILDLIFE_CELL_METERS as t, WildlifeFamily as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/molen-ambient",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@bendyline/molen-figures": "0.0.9",
|
|
46
46
|
"@bendyline/molen-schema": "0.0.7",
|
|
47
47
|
"@bendyline/molen-kernel": "0.0.7",
|
|
48
|
-
"@bendyline/molen-terrain": "0.0.
|
|
48
|
+
"@bendyline/molen-terrain": "0.0.11"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"three": ">=0.184.0 <0.187.0",
|