Skip to content

Overview

This section is the specification of the surface Structured 3D exposes: the types, classes, functions, and methods an implementation of the engine provides, with their parameters, return values, defaults, and error conditions. An implementer satisfies these pages; a game and a validator read them as reference.

The package @clockwyrks/structured-3d has one entry point.

SpecifierProvides
@clockwyrks/structured-3dcreateEngine, the framework classes, the built-in components, the clocks, TOUCH_LAYOUTS, the viewport functions, the math helpers and constants, and every type a game or a validator names.

three is a peer dependency of the package. A build declares three itself, and the engine, the build, and @clockwyrks/voxel-runtime/three share that one instance. The engine re-exports nothing from three; a game imports it directly where it needs a three object, such as a texture, a geometry, or an Object3D.

A game and a validator both import the package. A validator constructs the engine over the build’s own game definition, installs a scripted clock, steps it with engine.advance, and reads the world, the scene, and the debug surface back off the engine it holds, so the surface a validator exercises is the surface the game was written against.

PageCovers
EnginecreateEngine, EngineOptions, SurfaceMetrics, RunOptions, FrameInfo, the Engine object’s lifecycle, and EngineEvents with its event map.
Game InstanceGameDefinition, GameInstance, the InitApi its initialize receives, and the debug surface it returns.
WorldsLevelDefinition, ActorSpec, LoadApi, the World object, its timers, WorldAudio with positional playback, and the transition sequence.
Game ModeGameMode, GameState, PlayerState, MatchPhase, and the player and bot calls.
ActorsActor, Pawn, Transform, the tag calls, and the deferred destroy.
ComponentsComponent and the built-in render, mesh, model, light, object, sprite, shape, text, draw, and camera components.
ControllersController, PlayerController, AIController, InputReader, and possession.
RenderingRenderer, RenderMode, the collision overlay switch, shadows, the screen layer, and the pipeline’s ordering.
CollisionColliderComponent, ColliderShape, CollisionResponse, CollisionWorld, Manifold, Hit, and the queries.
CameraCamera, CameraSnapshot, Projected, Ray, Viewport, fitViewport, applyViewport, syncCanvas, and the three spaces.
MathVec2, Vec3, Quat, Mat4, Box3, the constants, and the vector, quaternion, and transform helpers.
ClocksThe Clock interface and the five clocks a run’s deltas can come from.
InputAction registration, ActionBinding, the read methods, the pointer, and TOUCH_LAYOUTS.
AudioCueSpec, WorldAudio, PlayOptions, synthesized and file-backed cues, looping, positional playback, and the mute and unlock calls.
AssetsloadImage, loadTexture, loadModel, Model, loadAudio, load, resolve, and the asset root.
DiagnosticsSource registration on the instance and the world, the values a read returns, FrameMetrics, the overlay, and its toggle.
RecordingThe recorder’s engine members, Recording and RecordedFrame, frame boundaries, what a frame holds, the VP9 WebM encoding with its timestamps and keyframes, the frame bound, and the errors.