{"_id":"3dfusion","name":"3dfusion","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"3dfusion","version":"0.1.0","description":"Deterministic 3D world systems in the browser.","type":"module","main":"./index.js","module":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.js","default":"./index.js"},"./debug":"./pkg/debug.js","./runtime":"./pkg/core.js","./package.json":"./package.json"},"keywords":["wasm","webassembly","3d","terrain","streaming","physics","rendering"],"dependencies":{"lucide":"^1.11.0"},"publishConfig":{"access":"public"},"_id":"3dfusion@0.1.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.4","dist":{"integrity":"sha512-CmEe/CHKEOJijhlZCVuyHd3Dz7S055hWRGUtbf94pLjjd3qfbFQz0VF8QhTyZlZSSBfSB1AoLIm/db9o9B/EOA==","shasum":"bb182ff485be95b56f376589d564649a551df9ee","tarball":"https://registry.npmjs.org/3dfusion/-/3dfusion-0.1.0.tgz","fileCount":11,"unpackedSize":2918358,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDUQ2drJhCloZnFHuoqpmplwjNAfIh4DSm5L2Hi0DqepQIhAP93lFVfuW1ed4pChrKEqvOVmLRNmS8hcGB7QAI4oz5J"}]},"_npmUser":{"name":"radiiplus","email":"positivevibez032@gmail.com"},"directories":{},"maintainers":[{"name":"radiiplus","email":"positivevibez032@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/3dfusion_0.1.0_1777238972856_0.015980568265428152"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-26T21:29:32.749Z","0.1.0":"2026-04-26T21:29:33.036Z","modified":"2026-04-26T21:29:33.531Z"},"maintainers":[{"name":"radiiplus","email":"positivevibez032@gmail.com"}],"description":"Deterministic 3D world systems in the browser.","keywords":["wasm","webassembly","3d","terrain","streaming","physics","rendering"],"readme":"# 3dfusion\n\nA deterministic, 3D world runtime for modern browsers.\n\n## Overview\n\n`3dfusion` is a packaged runtime that moves core 3D simulation, procedural generation, and rendering orchestration into WebAssembly, exposing a clean, predictable API for JavaScript and TypeScript consumers. Designed for browser delivery, it provides deterministic terrain and chunk generation, memory-managed mesh pipelines, rigid-body physics, adaptive streaming, and runtime telemetry without requiring consumers to manage internal engine architecture.\n\nThe project emphasizes:\n- **Predictable outputs** from stable seeds and deterministic pipelines\n- **Browser-first delivery** with optimized WASM artifacts and lightweight JS bindings\n- **Explicit resource management** to maintain stable memory profiles in long-running sessions\n\n## Key Features\n\n- **Deterministic Generation & Streaming**  \n  Seeded terrain and chunk production, heightfield sampling, and bounded streaming around a moving viewpoint with motion-aware prioritization.\n- **Geometry & Mesh Pipeline**  \n  Primitive and semantic geometry construction, procedural mesh generation with LOD support, and direct vertex and index buffer access.\n- **Physics & Rendering Orchestration**  \n  Fixed-step rigid-body simulation, configurable spatial broadphase, and renderer-side draw queueing with material and shader variant support.\n- **Performance & Memory Management**  \n  Frame scheduling, execution-path optimization, memory budgeting with priority-based upload queues, and automated resource eviction.\n- **Telemetry & Diagnostics**  \n  Centralized dashboard payload generation, debug control overrides, mobile and touch input tracking, and per-stage performance breakdowns.\n- **Explicit Lifetime Management**  \n  Structured disposal via `free()` and `[Symbol.dispose]()` for deterministic cleanup of native WASM resources.\n\n## Quick Start\n\n```bash\nnpm install 3dfusion\n```\n\n```javascript\nimport { init, TerrainGenHandle, MeshGeneratorHandle, StreamerHandle } from \"3dfusion\";\n\nasync function main() {\n  await init();\n\n  const terrainGen = new TerrainGenHandle(0, 50.0, 0.01, 64, 64.0);\n  const streamer = new StreamerHandle(12345n, \"\", 0, 50.0, 0.01, 64, 64.0);\n  streamer.set_active_region(3, 2, 2);\n  streamer.set_budget(8, 12);\n  streamer.update(0, 0, 0);\n\n  const heightfield = terrainGen.generate_heightfield(12345n, 0, 0, 0, 0);\n  const mesh = heightfield.toMesh(terrainGen, 12345n, 0, 0, 0, 0);\n\n  console.log(`Generated mesh: ${mesh.vertex_count()} vertices`);\n}\n\nmain();\n```\n\n## Architecture\n\n`3dfusion` follows a strict separation between the core simulation layer and the browser integration surface:\n\n1. **Rust Core**: All deterministic logic, simulation, and data structures are implemented in Rust.\n2. **WebAssembly Compilation**: The core is compiled to `wasm32-unknown-unknown` for near-native browser execution.\n3. **Binding Generation**: `wasm-pack` produces JavaScript and TypeScript bindings, handles memory marshaling, and exposes the public API surface.\n4. **Supplemental Tooling**: Debug panels, diagnostic dashboards, and platform harnesses are bundled as lightweight JS modules.\n5. **Distribution**: The final artifact is packaged for direct consumption via standard module bundlers.\n\n## Development\n\n### Prerequisites\n- Rust stable toolchain\n- `wasm-pack`\n- Node.js\n\n### Setup & Commands\n```bash\nrustup target add wasm32-unknown-unknown\nnpm install\nnpm run build:wasm\nnpm run dev\n```\n\n### Build Script Behavior\n- If `wasm-pack` is unavailable but `cargo` is present, the build script installs it automatically.\n- `wasm-opt` is applied when available to reduce release artifact size; builds gracefully fall back if absent.\n- The development script installs missing `vite` dependencies before launching the local server.\n\n## Documentation\n\nThe complete API reference, including handle constructors, method signatures, and expected behavior, is documented in [FUNCTIONALITY.md](FUNCTIONALITY.md).\n\nThe reference covers:\n- runtime bootstrap\n- semantic parsing and geometry authoring\n- mesh generation, bounds reporting, and buffer extraction\n- terrain and chunk generation plus streaming controls\n- physics, rendering, scheduling, optimization, and memory management\n- platform diagnostics and telemetry payloads\n\n## Best Practices\n\n- **Explicit Disposal**: Always call `handle.free()` or use `[Symbol.dispose]()` when handles are no longer needed.\n- **Frame Budgets**: Respect work and upload budgets to maintain consistent frame pacing, especially on mobile or constrained environments.\n- **Deterministic Seeding**: Use consistent `world_seed` values for reproducible terrain, chunk, and streaming outputs.\n\n---\nFor integration support, bug reports, or contribution guidelines, refer to the project repository.\n","readmeFilename":"README.md","_rev":"1-c27c84176234ef0ea6d66dae2417da45"}