@adatechnology/game-vegetation-three

中文文档
0.3.9发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 1988

The vegetation test module for the shared test room: the 18 plants of the Viveiro as destructible items (separable pieces, joints, real wood thickness, sway clips), its 13 scenarios and the nursery lot with the walker that bends the plants.

原始使用文档
文档目录5 节
  1. Items
  2. Scenarios
  3. Bench
  4. Tests
  5. Geometry

@adatechnology/game-vegetation-three

The vegetation test module for the shared test room: the 18 plants of the Viveiro as destructible items, their 13 scenarios and the nursery lot. A literal port of the team's vegetation-module.js.

import { loadVegetationTestModule } from '@adatechnology/game-vegetation-three'

loadVegetationTestModule(room, { locale: 'en' }) // or room.loadModule(createVegetationTestModule(options))
room.openArea('vegetation')

Without options the module uses @adatechnology/game-vegetation (with its three.js adapter) and @adatechnology/game-vegetation-species; a game that brings its own build passes GameVegetation and GameVegetationSpecies.

Items

mango_tree, mango_young_15, mango_young_30, yellow_ipe, coconut_palm, banana_with_bunch, araucaria, dead_tree, hibiscus_shrub, boxwood_hedge, rose_bush_red, sunflower, mandacaru, prickly_pear, crown_cactus, potted_fern, potted_cactus, lawn_tuft. Each piece of a plant (trunk, branch, crown, fruit, arm, pad, spines, pot, soil) is one mesh named after the piece, with its destruction spec: the shape from the real thickness of the wood (radius, length and axis that generate gives each wood piece), the joints (stem between a branch and the trunk, tie for leaves, flowers and spines, resting for the soil in a pot), the fixed root piece, tags, mass and fill, and a sway clip for the wind. The young mango trees are the 15 and 30 cm trunks on which the SDK documents the number of axe swings; the terracotta pot has 25 hp, so 1 to 3 shots of 9 mm break it.

Scenarios

The 13 of the page, with its ids: veg_axe_fells_crown, veg_axe_fells_30cm, veg_axe_cuts_branch_joint, veg_shot_cannot_fell, veg_saw_cuts_branch, veg_lighter_ignites_foliage, veg_shot_strips_leaves, veg_shot_breaks_pot, veg_machete_arm, veg_pad_pulled, veg_dead_burns_faster, veg_hedge_cut_pieces, veg_walk_on_grass. The room gives every tool a draw time that the team's page did not know, so each scenario waits for the tool to be ready.

Bench

  • Controls: the seed, quality (high or game), detail (LOD 0 to 2), condition and season of the nursery lot, the wind and the gusts. Actions: plant the lot, remove it, start or stop the walker. Changing a lot control plants the lot again.
  • The nursery is the 12 x 20 m plot of the Viveiro's lot demo (house, walls, street, sidewalk, path), planted by scatterRulesFor of @adatechnology/game-vegetation-species over the front yard, the backyard, the side strips and the sidewalk tree, and built by buildLot. The walker crosses it along WAY, stays out of the house and the trunks, and bends the plants through the wind shader's actors.
  • Layers: colliders (the trunks and cactus bodies as wire cylinders), piece_boxes (the box of every piece) and wood_axes (a line along the centreline of each wood piece).
  • Metrics: plants, pieces, triangles and draw calls of the items, and the triangles, plants, colliders, plants by LOD and build time of the lot.

The module draws no particles and asks for no effects: leaves, sap and fire come from the events of the default destruction world, which the room shows.

Tests

tests/team-golden-module.test.ts runs the module of the Viveiro artifact against the kit's room and compares it with this one: the 18 items (names in both languages, meshes, specs, clips) and the 13 scenarios (the same checks and the same count of every log line). tests/team-golden-nursery.test.ts cuts buildLotVeg from the page and compares the placements, triangles, plants, colliders and species for 8 seeds. examples/vegetation-test-area loads the module, and so does examples/interactables-test-area.

Geometry

The nursery's scenery (ground, street, walls, house and roof), its colliders and walker, and the colliders layer are made through shapeGeometries(THREE) of @adatechnology/game-shapes-three: the same bytes as three's constructors (tests/exact-golden.test.ts), cached by parameters. The plants themselves are @adatechnology/game-vegetation's own buffers (PlantMesh, with the per-vertex sway of the wind), drawn by its adapter.

版本与发布记录

@adatechnology/game-vegetation-three 共发布 21 个版本,首次发布于 2026/10/25;过去 12 个月发布了 21 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.9latest2026/11/08今天
0.3.82026/11/07今天
0.3.72026/11/07今天
0.3.62026/11/07今天
0.3.52026/11/071 天前
0.3.42026/11/061 天前

关于 @adatechnology/game-vegetation-three 的常见问题

@adatechnology/game-vegetation-three 是什么?

The vegetation test module for the shared test room: the 18 plants of the Viveiro as destructible items (separable pieces, joints, real wood thickness, sway clips), its 13 scenarios and the nursery lot with the walker that bends the plants.

如何安装 @adatechnology/game-vegetation-three?

在项目目录运行 npm install @adatechnology/game-vegetation-three,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:three(^0.160.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@adatechnology/game-vegetation-three 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@adatechnology/game-vegetation-three 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adatechnology/game-vegetation-three 可以商用吗?

@adatechnology/game-vegetation-three 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adatechnology/game-vegetation-three 的下载量有多少?

根据 npm 官方下载统计,@adatechnology/game-vegetation-three 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,988 次,日均约 66 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adatechnology/game-vegetation-three 还在维护吗?

最新版本 0.3.9 发布于 2026/11/08(今天);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/10/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。