Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·part ofpackage threezero.package·originates fromworld 7767c52c-9…

ThreeApp

A component script.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 3mo ago
What it does

ThreeApp

A component script.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

ThreeApp Runs a three.js project on the host entity. `entry` is the VFS path of the project's main ES module (e.g. /zero/source/projects/hello_cube/main.js); imports of 'three' resolve to the ThreeZero shim and relative './file.js' specifiers resolve against the project folder. The app boots on the first play-mode tick, its requestAnimationFrame / setAnimationLoop callbacks run once per engine frame, and everything it spawned is torn down when play mode ends or the component is removed.

stopApp( ) → void

startApp( ) → void

update(dt: ?) → void

argtypedescription
dt?

editorUpdate(_dt: ?) → void

Returning to edit mode tears the app down so play-session entities never linger in the authoring view.

argtypedescription
_dt?

onDisable( ) → void

onDestroy( ) → void

status( ) → table

restart( ) → void

runJs(code: string) → string

Devtools console: run a JavaScript snippet inside the app's VM and return the completion value rendered as a string.

argtypedescription
codestring

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

8+items
▣
module · born here
❒asset
# runner A module script.
▲ 0↑ born
❒
package · born here
❒asset
# ThreeZero A three.js runtime for the Zero engine, built on the ZeroJS JavaScript interpreter. Drop an existing three.js project into the world's VFS, point a `ThreeApp` component at its entry module, and the project runs unmodified — `import * as THREE from 'three'` resolves to a THREE-compatible API whose scene graph renders through Zero's real renderer, GLTF models spawn through the engine's import pipeline, and keyboard/mouse events reach game code as DOM events. ## Pieces - `host.module` — the `__ZERO` host bridge: entity pools mirroring the THREE scene graph 1:1 (world composition happens in the native hierarchy), change-set-only batched transform sync, runtime meshes from BufferGeometry vertex data, GLTF bundle spawning, lights, the viewport camera, input snapshots/events, and screen/time queries. - `runner.module` — builds a ZeroJS VM per app: installs the browser prelude (window, document, performance, typed arrays, a real event registry), resolves ES imports (`three`, `three/addons/...`, relative `./file.js` paths), dispatches engine input as DOM `keydown`/`keyup`/mouse/touch events each frame, and pumps the VM event loop plus animation-frame callbacks with a self-healing loop. - `three.zJs` — the THREE API surface: math, the Object3D graph with mutation tracking (only changed transforms cross the bridge), geometries (parametric + real-vertex BufferGeometry), materials, lights, cameras, Clock, AnimationMixer, and a WebGLRenderer whose `render(scene, camera)` diffs arrivals/departures/dirty objects into host calls. - `OrbitControls.zJs` — `three/addons/controls/OrbitControls.js`: drag-orbit, scroll zoom, pan, damping, auto-rotate, from the engine input snapshot. - `GLTFLoader.zJs` — `three/addons/loaders/GLTFLoader.js`: binds models to imported bundles by URL basename; DRACOLoader/KTX2Loader accepted inert. - `ThreeApp.component` — attach to an entity, set `entry` to the project's main module VFS path; the app boots on play and tears down on edit. ## Running a project ThreeZero builds on the `zerojs` package and reaches it by the package alias `~zerojs`, which a package registers from the `name` in its `package.yaml` wherever it sits. Installing ThreeZero brings `zerojs` along as a dependency, so nothing has to be wired up by hand; `~threezero.runner` and `~threezero.host` address this package's own modules the same way. ``` /zero/source/projects/myapp/main.js ← unmodified three.js sources /zero/source/projects/myapp/models/*.glb ← model files (imported to bundles on upload) ``` ```luau entity.spawn("MyApp").component.add("ThreeApp", { entry = "/zero/source/projects/myapp/main.js" }) ``` Flip to play mode. `requestAnimationFrame` / `setAnimationLoop` run once per engine frame, and `addEventListener('keydown' | 'mousedown' | ...)` receives live input — playable games work end to end (see `/zero/source/projects/crossing`). ## Limitations - No optional chaining (`?.`), `#private` fields, or `Symbol` in project code. - Textures load as inert handles; material color/emissive/opacity drive the visual. - Points/Line/Sprite objects are skipped with a one-time warning. - Skinned-mesh submeshes from imported models render at bind pose or are hidden (engine importer limitation); AnimationMixer plays clips through the engine's ClipPlayer where the rig supports it.
▲ 0↑ born
backing path · threezero.package/ThreeApp.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.