@adatechnology/game-vehicles-three

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

three.js output of the vehicles of @adatechnology/game-vehicles: a vehicle in a game frame (front on +z, centred, on the ground) at full detail or fused into six meshes (the team's Frota Leve light mode), coloured by seed, with its damageable boxes; and t

原始使用文档

@adatechnology/game-vehicles-three

A vehicle of @adatechnology/game-vehicles in a game frame, at full detail or fused into six meshes. A literal port of the team's Frota Leve (FrotaLeve.criar(...).construir).

import { createVehicleKit } from '@adatechnology/game-vehicles'
import { installFleet } from '@adatechnology/game-vehicles-fleet'
import { createVehiclesThree } from '@adatechnology/game-vehicles-three'

const kit = createVehicleKit({ THREE })
installFleet(kit)
const vehicles = createVehiclesThree(THREE, { kit })
const car = vehicles.build('midsize_sedan', { quality: 'lite', seed: 42 })
scene.add(car.group) // front on +z, right on -x, centred, wheels on y = 0
car.triangles // 19286 · car.drawCalls // 6 · car.damageables // metal, glass, rubber, fuel boxes in the game frame
  • quality: 'high' is the kit's vehicle (the context stays in car.context for damage), 'lite' fuses it into paint, trim, metal, glass, light and plate, dropping interiors and pieces under 3 cm.
  • The colour comes from color or from seed through the palette of the vehicle's group (colorFromSeed).
  • Tested against the team's page on three r160 (triangles, draw calls, size, per-class vertices, damageable boxes) and against DIMS for the 69 vehicles.

Test area

createVehiclesTestModule({ locale, document?, three?, vehicles?, effects? }) is a TestableModule for the shared test room (room.loadModule, or loadVehiclesTestModule(room), which learns the room's three.js to compute the door, hood and trunk clips). It lays the eight vehicles of the Frota test, each with its own DestructibleImpl, and brings 13 scenarios: the eleven of the team's test page, literal (vehicles_9mm_windshield, vehicles_shotgun_door, vehicles_ram_front, vehicles_engine_fire, vehicles_fuel_tank, vehicles_unbolt_wheel, vehicles_tear_bumper, vehicles_break_mirror, vehicles_kill_battery, vehicles_rollover, vehicles_melt; the page ids are in PAGE_SCENARIO_ALIASES), plus vehicles_drive_arcade and vehicles_drive_semi for @adatechnology/game-vehicles-driving.

The bench sets the quality (full or light mode), the paint by seed and palette, the driving mode and the surface, and drives a car down a lane; its layers show the damageable boxes by material, the zones by type and the axes of the output frame; its metrics read triangles, draw calls, the size against DIMS and the boxes by material. The module draws no particles: fire, explosion, glass, sparks, leaks and exhaust are requested by id through host.effects when the host has one (defaultEffectIds, replaceable by option). A pierced tank asks for leak (vehicle_leak: the pool and the drips only); when the leak catches fire (a spark, an incendiary round, a fire near, a blast) the ignite event of the tank asks for leakIgnited (vehicle_leak_ignited: the Garagem's whole sequence, the fire along the pool and then the blast). examples/vehicles-test-area loads it.

版本与发布记录

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

版本发布日期距今
0.9.2latest2026/11/08今天
0.9.12026/11/08今天
0.9.02026/11/07今天
0.8.72026/11/07今天
0.8.62026/11/07今天
0.8.52026/11/07今天

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

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

three.js output of the vehicles of @adatechnology/game-vehicles: a vehicle in a game frame (front on +z, centred, on the ground) at full detail or fused into six meshes (the team's Frota Leve light mode), coloured by seed, with its damageable boxes; and t

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

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

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

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

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

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

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

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

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

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

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

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