{"_id":"@aperture-engine/simulation","_rev":"3-e5b42170416f4fb70df54690120971d8","name":"@aperture-engine/simulation","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@aperture-engine/simulation","version":"0.1.0","keywords":["aperture","ecs","webgpu","game-engine","typescript","transform","scene-graph"],"author":{"name":"Felix Zhang"},"license":"MIT","_id":"@aperture-engine/simulation@0.1.0","maintainers":[{"name":"felixtrz","email":"felixtrz96@gmail.com"}],"homepage":"https://github.com/felixtrz/aperture/tree/main/packages/simulation#readme","bugs":{"url":"https://github.com/felixtrz/aperture/issues"},"dist":{"shasum":"1d3f06fbdb63d7feb508502dcf3ffcbe22a7aae1","tarball":"https://registry.npmjs.org/@aperture-engine/simulation/-/simulation-0.1.0.tgz","fileCount":135,"integrity":"sha512-qO+/hZ66uWnNZkKe0T7YgO2BWTJCASlh3k8PLffd6ZV/Lm47eQJ/U7enBjXDEMTUQPXhuvuLnH2h+wB8SpSr9g==","signatures":[{"sig":"MEUCIDsxXzrsLcF2Kz4PS0fBJiY1h3uKQHZF2mn0YYCT5rcHAiEA2vmytgDwgRq/yBhyTviJdUo06xbkGo4esPiFXxFoAws=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":636739},"main":"./dist/index.js","type":"module","_from":"file:aperture-engine-simulation-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"felixtrz","email":"felixtrz96@gmail.com"},"_resolved":"/private/var/folders/xc/nttyc9pj3xngmbjsfbgdbddc0000gn/T/4bdab3a4f1de3b48947ca606926f94d9/aperture-engine-simulation-0.1.0.tgz","_integrity":"sha512-qO+/hZ66uWnNZkKe0T7YgO2BWTJCASlh3k8PLffd6ZV/Lm47eQJ/U7enBjXDEMTUQPXhuvuLnH2h+wB8SpSr9g==","repository":{"url":"git+https://github.com/felixtrz/aperture.git","type":"git","directory":"packages/simulation"},"_npmVersion":"11.12.1","description":"Headless ECS, assets, math, diagnostics, and transform foundation for Aperture.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","dependencies":{"elics":"^3.4.2","@aperture-engine/math":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/simulation_0.1.0_1782151627905_0.9256358116406915","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aperture-engine/simulation","version":"0.2.0","keywords":["aperture","ecs","webgpu","game-engine","typescript","transform","scene-graph"],"author":{"name":"Felix Zhang"},"license":"MIT","_id":"@aperture-engine/simulation@0.2.0","maintainers":[{"name":"felixtrz","email":"felixtrz96@gmail.com"}],"homepage":"https://github.com/felixtrz/aperture/tree/main/packages/simulation#readme","bugs":{"url":"https://github.com/felixtrz/aperture/issues"},"dist":{"shasum":"3aabc821509f0d55a10dde7f744e1bc4f37a7cbf","tarball":"https://registry.npmjs.org/@aperture-engine/simulation/-/simulation-0.2.0.tgz","fileCount":135,"integrity":"sha512-XfEd4F/tOsc/3Mqai64gJwvsIjoCtQAHwrpslRiOz2QCurwBvGeI00Uhy9ofefhKT2dGBDWXYSkjIWyd9lEFNg==","signatures":[{"sig":"MEYCIQCEtnJ7qRbqGzhkRAvvXPXsPECMw6LpneCNy+DE1wy+bgIhAJuoJDoi3rhwiWPluL+ICJ22wwtlic72MjKasJcHwCsK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":636739},"main":"./dist/index.js","type":"module","_from":"file:aperture-engine-simulation-0.2.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"felixtrz","email":"felixtrz96@gmail.com"},"_resolved":"/private/var/folders/xc/nttyc9pj3xngmbjsfbgdbddc0000gn/T/0c7cf178a376c2f0e28447f878e6321d/aperture-engine-simulation-0.2.0.tgz","_integrity":"sha512-XfEd4F/tOsc/3Mqai64gJwvsIjoCtQAHwrpslRiOz2QCurwBvGeI00Uhy9ofefhKT2dGBDWXYSkjIWyd9lEFNg==","repository":{"url":"git+https://github.com/felixtrz/aperture.git","type":"git","directory":"packages/simulation"},"_npmVersion":"11.12.1","description":"Headless ECS, assets, math, diagnostics, and transform foundation for Aperture.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","dependencies":{"elics":"^3.4.2","@aperture-engine/math":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/simulation_0.2.0_1782246144820_0.9136469330734744","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aperture-engine/simulation","version":"0.3.0","description":"Headless ECS, assets, math, diagnostics, and transform foundation for Aperture.","author":{"name":"Felix Zhang"},"repository":{"type":"git","url":"git+https://github.com/felixtrz/aperture.git","directory":"packages/simulation"},"homepage":"https://github.com/felixtrz/aperture/tree/main/packages/simulation#readme","bugs":{"url":"https://github.com/felixtrz/aperture/issues"},"keywords":["aperture","ecs","webgpu","game-engine","typescript","transform","scene-graph"],"type":"module","license":"MIT","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"dependencies":{"elics":"^3.4.2","@aperture-engine/math":"^0.3.0"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json"},"_id":"@aperture-engine/simulation@0.3.0","_integrity":"sha512-zCQPiduNHk1Fn1PkAWGsCSZdSDleGl/At9E7qcglAkKGVX6prUDx7bv/7VdKeSjbI3hTdWv86C0DtXp8DpVhmQ==","_resolved":"/private/var/folders/xc/nttyc9pj3xngmbjsfbgdbddc0000gn/T/10a3553459ab82ccc7ca3e44e8153fc0/aperture-engine-simulation-0.3.0.tgz","_from":"file:aperture-engine-simulation-0.3.0.tgz","_nodeVersion":"26.0.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-zCQPiduNHk1Fn1PkAWGsCSZdSDleGl/At9E7qcglAkKGVX6prUDx7bv/7VdKeSjbI3hTdWv86C0DtXp8DpVhmQ==","shasum":"67942a47e51b06fb01f63a6d4422b2dbf2069dd2","tarball":"https://registry.npmjs.org/@aperture-engine/simulation/-/simulation-0.3.0.tgz","fileCount":139,"unpackedSize":656834,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEr4oFGDEtZEMLJiefTGAhLp51vsZ0pOqZqDxjpNL6ctAiEA/lXkH1Q3EGoAKTeQi3xUfO4IM52LW2KN+ghSuwHuWVk="}]},"_npmUser":{"name":"felixtrz","email":"felixtrz96@gmail.com"},"directories":{},"maintainers":[{"name":"felixtrz","email":"felixtrz96@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simulation_0.3.0_1783122760196_0.7329392116050273"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-22T18:07:07.693Z","modified":"2026-07-03T23:52:40.511Z","0.1.0":"2026-06-22T18:07:08.096Z","0.2.0":"2026-06-23T20:22:25.027Z","0.3.0":"2026-07-03T23:52:40.398Z"},"bugs":{"url":"https://github.com/felixtrz/aperture/issues"},"author":{"name":"Felix Zhang"},"license":"MIT","homepage":"https://github.com/felixtrz/aperture/tree/main/packages/simulation#readme","keywords":["aperture","ecs","webgpu","game-engine","typescript","transform","scene-graph"],"repository":{"type":"git","url":"git+https://github.com/felixtrz/aperture.git","directory":"packages/simulation"},"description":"Headless ECS, assets, math, diagnostics, and transform foundation for Aperture.","maintainers":[{"name":"felixtrz","email":"felixtrz96@gmail.com"}],"readme":"# @aperture-engine/simulation\n\nHeadless ECS, assets, math, diagnostics, and transform foundation for the Aperture WebGPU game engine.\n\n## Install\n\n```sh\npnpm add @aperture-engine/simulation\n```\n\nThis package is part of the [Aperture](https://github.com/felixtrz/aperture) engine. It is the authoritative simulation core and is normally used together with the other `@aperture-engine/*` packages (rendering, platform, etc.).\n\n## What it does\n\n`@aperture-engine/simulation` is the headless, DOM-free heart of Aperture. It wraps the [`elics`](https://www.npmjs.com/package/elics) ECS with change-version tracking and adds the engine's authoritative data model: transform components (local/world matrices, parent/child hierarchy), an asset registry with handles and collections, spatial acceleration (BVH), scene/prefab serialization, and diagnostics. Because it has no rendering or browser dependencies, it runs identically on the main thread, in a worker, or in tests.\n\n### Math\n\n3D math lives in its own zero-dependency package, [`@aperture-engine/math`](../math) — a `Float32Array`-native, WebGPU-first kernel with fused transform fast paths (`composeTRS`, `mulAffine`, `invertAffine`), benchmarked as the fastest option for the engine's transform workload. For convenience the entire math surface is **re-exported** from `@aperture-engine/simulation`, so existing imports keep working:\n\n```ts\nimport {\n  composeTrsMatrix,\n  makePerspective,\n  Vec3,\n} from \"@aperture-engine/simulation\";\n// …or import it directly:\nimport { composeTrsMatrix } from \"@aperture-engine/math\";\n```\n\n## Usage\n\n```ts\nimport {\n  createWorld,\n  registerTransformComponents,\n  LocalTransform,\n  createRootTransform,\n  resolveWorldTransforms,\n} from \"@aperture-engine/simulation\";\n\nconst world = createWorld();\nregisterTransformComponents(world);\n\nconst root = createRootTransform({ translation: [0, 1, 0] });\nconst entity = world.createEntity();\nentity.addComponent(LocalTransform, root.local);\n\n// Derive world matrices from the local transform + parent hierarchy.\nconst report = resolveWorldTransforms(world);\nconsole.log(report.resolved, report.diagnostics);\n```\n\n## Entry points\n\nThe package exposes a single entry point; everything is re-exported from the root:\n\n- `@aperture-engine/simulation` — the full public API:\n  - **ECS** — `createWorld`, `defineComponent`, `createSystem`, `EcsType`, and ECS types.\n  - **Transform** — `LocalTransform` / `WorldTransform` / `Parent` / `Children` components, `registerTransformComponents`, `setParent`, `resolveWorldTransforms`.\n  - **Assets** — `AssetRegistry`, asset handles, collections, and animation-clip data.\n  - **Math** — vectors, quaternions, `Mat4` helpers, projections, bounds, and rays.\n  - **Spatial** — entity-bounds and mesh BVH structures.\n  - **Serialization** — scene documents, prefabs, and component codecs.\n  - **Diagnostics** — `summarizeDiagnostics` and related types.\n  - **Raycaster** — ray/scene intersection utilities.\n\n## License\n\nPart of the [Aperture](https://github.com/felixtrz/aperture) monorepo. MIT licensed.\n","readmeFilename":"README.md"}