@adatechnology/game-vegetation-three 0.1.0 → 0.2.0
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/README.md +7 -0
- package/dist/index.global.js +1715 -197
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// src/test-area/module.ts
|
|
2
|
+
import { shapeGeometries as shapeGeometries2 } from "@adatechnology/game-shapes-three";
|
|
2
3
|
import * as GameVegetationMain from "@adatechnology/game-vegetation";
|
|
3
4
|
import * as GameVegetationAdapter from "@adatechnology/game-vegetation/three";
|
|
4
5
|
import * as GameVegetationSpeciesMain from "@adatechnology/game-vegetation-species";
|
|
5
6
|
|
|
6
7
|
// src/test-area/nursery.ts
|
|
8
|
+
import { shapeGeometries } from "@adatechnology/game-shapes-three";
|
|
7
9
|
var LOT = { W: 12, D: 20 };
|
|
8
10
|
var HOUSE = { x0: 2.5, x1: 9.5, z0: 6.5, z1: 13 };
|
|
9
11
|
var WAY = [[6, 1.2], [6, 5.4], [10.8, 5.4], [10.8, 14.2], [8, 18.6], [3, 18.6], [1.2, 14.2], [1.2, 5.4], [4, 3.2], [8, 3.2]];
|
|
@@ -78,6 +80,7 @@ function buildScenery(THREE) {
|
|
|
78
80
|
return g;
|
|
79
81
|
}
|
|
80
82
|
function createNursery(sdk, species, THREE, materials, parent, origin) {
|
|
83
|
+
const T = shapeGeometries(THREE);
|
|
81
84
|
const group = new THREE.Group();
|
|
82
85
|
group.name = "nursery";
|
|
83
86
|
group.position.set(origin[0], 0, origin[1]);
|
|
@@ -107,8 +110,8 @@ function createNursery(sdk, species, THREE, materials, parent, origin) {
|
|
|
107
110
|
const ensure = () => {
|
|
108
111
|
if (attached) return;
|
|
109
112
|
attached = true;
|
|
110
|
-
scenery = buildScenery(
|
|
111
|
-
const body =
|
|
113
|
+
scenery = buildScenery(T);
|
|
114
|
+
const body = T.CapsuleGeometry ? new T.CapsuleGeometry(0.28, 1, 4, 10) : new T.CylinderGeometry(0.28, 0.28, 1.56, 10);
|
|
112
115
|
actor = new THREE.Mesh(body, new THREE.MeshStandardMaterial({ color: 14254635, roughness: 0.7 }));
|
|
113
116
|
actor.castShadow = true;
|
|
114
117
|
actor.position.set(walker.x, 0.78, walker.z);
|
|
@@ -165,7 +168,7 @@ function createNursery(sdk, species, THREE, materials, parent, origin) {
|
|
|
165
168
|
});
|
|
166
169
|
dynamic.add(lotObject);
|
|
167
170
|
for (const c of data.colliders) {
|
|
168
|
-
const m = new THREE.Mesh(new
|
|
171
|
+
const m = new THREE.Mesh(new T.CylinderGeometry(c.r, c.r, c.h, 14, 1, true), new THREE.MeshBasicMaterial({ color: c.damage ? 16742938 : 15017245, wireframe: true }));
|
|
169
172
|
m.position.set(c.x, c.h / 2, c.z);
|
|
170
173
|
colliders.add(m);
|
|
171
174
|
}
|
|
@@ -989,7 +992,7 @@ function createVegetationTestModule(options = {}) {
|
|
|
989
992
|
};
|
|
990
993
|
if (host.bench.layer("colliders") && root.userData.collider && root.userData.collider.kind) {
|
|
991
994
|
const c = root.userData.collider;
|
|
992
|
-
const wire = new three.Mesh(new three.CylinderGeometry(c.radius, c.radius, c.height, 14, 1, true), new three.MeshBasicMaterial({ color: root.userData.thorny ? 16742938 : 15017245, wireframe: true }));
|
|
995
|
+
const wire = new three.Mesh(new (shapeGeometries2(three)).CylinderGeometry(c.radius, c.radius, c.height, 14, 1, true), new three.MeshBasicMaterial({ color: root.userData.thorny ? 16742938 : 15017245, wireframe: true }));
|
|
993
996
|
wire.position.set(0, c.height / 2, 0);
|
|
994
997
|
mark(wire);
|
|
995
998
|
}
|
|
@@ -1158,9 +1161,9 @@ function createVegetationTestModule(options = {}) {
|
|
|
1158
1161
|
{ kind: "choice", id: "season", name: text.controls.season, hint: text.hints.season, options: ["spring", "summer", "autumn", "winter"].map((id) => ({ id, name: text.options.season[id] })), default: "spring" },
|
|
1159
1162
|
{ kind: "number", id: "wind", name: text.controls.wind, hint: text.hints.wind, min: 0, max: 1, step: 0.05, default: 0.35 },
|
|
1160
1163
|
{ kind: "number", id: "gust", name: text.controls.gust, hint: text.hints.gust, min: 0, max: 1, step: 0.05, default: 0.15 },
|
|
1161
|
-
{ kind: "action", id: "plant_lot", name: text.actions.plant_lot },
|
|
1164
|
+
{ kind: "action", id: "plant_lot", name: text.actions.plant_lot, slow: true },
|
|
1162
1165
|
{ kind: "action", id: "clear_lot", name: text.actions.clear_lot },
|
|
1163
|
-
{ kind: "action", id: "toggle_walker", name: text.actions.toggle_walker }
|
|
1166
|
+
{ kind: "action", id: "toggle_walker", name: text.actions.toggle_walker, slow: true }
|
|
1164
1167
|
],
|
|
1165
1168
|
layers: () => ["colliders", "piece_boxes", "wood_axes"].map((id) => ({ id, name: text.layers[id], default: false })),
|
|
1166
1169
|
metrics: () => [
|