Wave3D Handbook
v0.1

Core API Reference

A Java-doc-style map of the Wave3D types and methods you will use first—paired with short explanations, safe examples, returns, and common traps.

Status: curated v0.1 Evidence: official public declarations Examples: declaration-checked Audit: 1 September 2026
On this page
  1. Reference scope
  2. Primitive geometry
  3. Entity basics
  4. Transforms
  5. Time and input
  6. Scene and terrain
  7. Object systems
  8. Global values

Reference scope

This page intentionally documents a small, useful center of the Wave3D authoring surface. The official declaration file contains thousands of entries and is the complete machine-readable source of truth. Where declarations have little or no prose, the explanations here are tutorial guidance—not additional vendor guarantees.

Evidence labels used here

Official API reproduces a public declaration or allowed value. Declaration-checked example means the code matches those declarations; it does not mean the example was Clean-Run inside the current WaveStudio runtime.

For a quick lookup, type a class, method, concept, or value below. Filtering happens only on this page.

Primitive geometry

The canonical public classes use constructors. WaveStudio also exposes the shorter cube(), sphere(), and cylinder() functions through its separate Studio-alias declaration file. This handbook teaches the canonical new wave… forms because their type ownership is unambiguous.

waveCube

Class · primitive geometry · official API

class waveCube extends waveGeometry constructor( width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number );

Creates a box-shaped geometry entity. The first three optional values describe its base dimensions; the final three control segmentation.

ItemMeaning
width, height, depthOptional numeric base dimensions.
*SegmentsOptional subdivision counts for the matching axis.
ReturnsA new waveCube, inheriting entity, transform, model, material, and physics surfaces.
AvailabilityPublic WaveStudio global declarations. The cube() factory is a separate Studio-only alias.
Declaration-checked example
const block = new waveCube(3, 1, 2)
  .setName("Blue block")
  .setColor(PALETTE.BLUE)
  .placeAt(0, 0.5, 0);

Gotcha: there is no required options object. Constructor arguments are positional, so label complex dimensions with variables if their meaning is not obvious.

Official declaration

waveStudio-globals.d.ts · Studio aliases

waveSphere

Class · primitive geometry · official API

class waveSphere extends waveGeometry constructor(radius?: number, segments?: number);

Creates a sphere geometry entity. radius controls size and segments controls geometric subdivision.

ItemMeaning
radius?Optional radius of the new sphere.
segments?Optional segment count.
ReturnsA new waveSphere.
RelatedasDome(), asIcoSphere(), and asSphere() are declared on the class.
Declaration-checked example
const sun = new waveSphere(1.4, 24)
  .setName("Sun")
  .setColor(PALETTE.GOLD)
  .placeAt(0, 5, 0);

Gotcha: higher subdivision counts usually imply more geometry. The declarations do not prescribe a performance budget.

Official declaration

waveStudio-globals.d.ts

waveCylinder

Class · primitive geometry · official API

class waveCylinder extends waveGeometry constructor( height?: number, diameterTop?: number, diameterBottom?: number, tessellation?: number, heightSegments?: number );

Creates a cylinder-like geometry entity. Different top and bottom diameters can describe a tapered form.

ItemMeaning
height?Optional total height.
diameterTop?, diameterBottom?Optional end diameters.
tessellation?Optional radial subdivision count.
heightSegments?Optional vertical subdivision count.
ReturnsA new waveCylinder.
Declaration-checked example
const tower = new waveCylinder(4, 1.5, 2, 24, 1)
  .setName("Tower")
  .setColor(PALETTE.TERRACOTTA)
  .placeAt(0, 2, 0);

Gotcha: the constructor begins with height, not radius. Both diameter arguments come before tessellation.

Official declaration

waveStudio-globals.d.ts

Entity basics

The primitive classes inherit a broad surface. The useful ownership chain is waveCube → waveGeometry → waveProp → wave3DObject → wave3DAbstract → WaveObject → WaveEntity. Methods such as setName() come from WaveEntity; transforms come from wave3DAbstract; visuals and physics are exposed by wave3DObject.

WaveEntity

Abstract class · lifecycle foundation · official API

abstract class WaveEntity<TState = unknown> readonly id: number; get name(): string; get typeName(): string; get isEnabled(): boolean; get isDestroyed(): boolean; get isSpawned(): boolean; get scene(): WaveScene;

The shared entity foundation provides identity, scene access, lifecycle, delayed actions, state helpers, components, cloning, and update callbacks.

MemberReturnsUse
idnumberRead-only numeric identity.
namestringCurrent authored name.
sceneWaveSceneThe owning scene.
isEnabledbooleanWhether the entity is enabled.
isDestroyedbooleanWhether destruction has occurred.

Gotcha: WaveEntity is abstract. Beginners normally receive its methods through a concrete object such as waveCube.

Official declaration

waveStudio-globals.d.ts

setName()

WaveEntity method · official API

setName(name: string): this;

Assigns the entity’s authored name and returns the same entity for chaining.

ParameterTypeDescription
namestringThe new name.
ReturnsthisThe same concrete entity type.
AvailabilityWaveEntity and its descendants.
Declaration-checked example
const gem = new waveSphere(0.6).setName("Treasure gem");

Gotcha: a JavaScript variable name such as gem and the entity’s Wave3D name are separate things.

Official declaration

waveStudio-globals.d.ts

setColor()

waveGeometry / wave3DObject method · official API

setColor( color: Parameters<cmp_visual3DModel["setColor"]>[0] ): this;

Sets the visual color. The public declaration reuses the visual-model component’s input type; PALETTE values are the simplest documented inputs to teach.

ItemDescription
colorThe declared visual-model color input.
Returnsthis for the immediate overload.
Advanced overloadsSnapshot and Animate overloads return material-property builders.
AvailabilitywaveGeometry and wave3DObject.
Declaration-checked example
const leaf = new waveSphere(0.4)
  .setColor(PALETTE.EMERALD);

Gotcha: do not guess hexadecimal swatches for named palette colors. Use an official PALETTE key or an official color constructor.

Official declaration

waveStudio-globals.d.ts

Transforms

Transform methods live on wave3DAbstract and return the same concrete type in their immediate overloads. That is why creation, naming, color, placement, movement, turning, and scaling can be chained.

placeAt()

wave3DAbstract method · official API

placeAt(target: TransformReferenceLike | WavePointInput): this; placeAt(x: number, y: number, z: number): this;

Places an object at a target point or at numeric x, y, and z coordinates.

OverloadUseReturns
placeAt(target)Place at a supported transform reference or point input.this
placeAt(x, y, z)Place at explicit 3D coordinates.this
Declaration-checked example
const moon = new waveSphere(0.8).placeAt(4, 3, -2);
const tinyMoon = new waveSphere(0.2).placeAt(moon);

Gotcha: this is 3D spatial placement. Screen-space and 2D objects use different transform types and overloads.

Official declaration

waveStudio-globals.d.ts

Movement methods

wave3DAbstract methods · official API

moveBy(direction: DirectionInput, distance: number): this; moveForward(distance: number): this; moveBackward(distance: number): this; moveLeft(distance: number): this; moveRight(distance: number): this; moveUp(distance: number): this; moveDown(distance: number): this; moveTo(target: TransformReferenceLike | WavePointInput): this;

Moves an object by a direction and distance, by a named relative direction, or to a target. The immediate overloads return this; additional Snapshot and Animate overloads are present in the full declarations.

FamilyMeaning
moveBy(direction, distance)Relative movement using a DirectionInput.
moveForwardmoveDownConvenient named relative movement.
moveTo(target)Move to a supported target reference or point.
Returnsthis for each immediate overload shown here.
Declaration-checked example
const ship = new waveCube(2, 0.5, 4)
  .moveBy(Direction.Up, 1)
  .moveForward(3)
  .moveRight(2);

No generic move() method is part of this beginner surface. Use the exact verbs above.

Official declaration

waveStudio-globals.d.ts

Rotation methods

wave3DAbstract methods · official API

turnLeft(degrees: number): this; turnRight(degrees: number): this; turnTo(target: TransformReferenceLike | WavePointInput): this; turnToward(direction: DirectionInput): this;

Turns an object by degrees, toward a target, or toward a declared direction.

MethodInputReturns
turnLeft, turnRightDegrees as a number.this
turnToA transform reference or point.this
turnTowardA DirectionInput.this
Declaration-checked example
const arrow = new waveCylinder(2, 0.2, 0.7)
  .turnRight(45)
  .turnToward(Direction.Forward);

Gotcha: the core verb is not turn(). Use turnLeft(), turnRight(), turnTo(), or turnToward().

Official declaration

waveStudio-globals.d.ts

Scale methods

wave3DAbstract methods · official API

scaleBy(value: number | Vector3Like): this; scaleTo(value: number | Vector3Like): this; setScale(scale: Vector3Like): this; setScale(uniform: number): this; setScale(x: number, y: number, z: number): this; setUniformScale(scale: number): this;

scaleBy() applies a relative factor. scaleTo() and setScale() set a scale value. The setScale(uniform: number) overload explicitly names uniform behavior; vector and three-number overloads can vary by axis. The declarations accept a number for scaleBy() and scaleTo() without naming its per-axis semantics.

MethodIntentReturns
scaleBy(value)Relative scaling.this
scaleTo(value)Target scale.this
setScale(...)Set uniform, vector, or per-axis scale.this
Declaration-checked example
const cloud = new waveSphere(1)
  .scaleBy(1.5)
  .setScale(2, 0.7, 1.2);

Gotcha: there is no generic beginner method named scale(). Choose a declared scale verb.

Official declaration

waveStudio-globals.d.ts

Time and input

Wave3D exposes authored time units, delayed entity actions, and scene-director input callbacks as typed global surfaces.

after().do()

WaveEntity delayed action · official API

after(duration: WaveTimeSpan): DelayedEntityProxy<this>; after(value: number, unit: WaveTimeUnit): DelayedEntityProxy<this>; do(callback: (entity: TEntity) => void): TEntity;

Creates a delayed proxy and then schedules a callback. The callback receives the original typed entity.

PartMeaning
valueNumeric amount of time.
unitA WaveTimeUnit, such as the global Seconds unit.
callbackReceives the delayed entity as its parameter.
Returnsafter() returns a delayed proxy; do() returns the entity.
Declaration-checked example
const light = new waveSphere(0.5).setColor(PALETTE.BLUE);

light.after(2, Seconds).do((target) => {
  target.setColor(PALETTE.ORANGE);
});

Gotcha: entity.after(Seconds(2)) is not the same signature. Calling Seconds(2) creates a WaveTimePoint; the two-argument delayed-action overload expects after(2, Seconds).

Official declaration

waveStudio-globals.d.ts

Seconds

Global time-unit function · official API

const Seconds: { (value: number): WaveTimePoint; readonly kind: WaveTimeUnitKind; };

Seconds has two roles in the type surface: it is callable to make a time point, and it carries a kind so it can be passed as a time-unit reference.

FormResultTypical context
Seconds(2)WaveTimePointAPIs that ask for a point in time.
2, SecondsNumber plus unit argumentsAPIs with a (value, unit) overload.

Gotcha: read the receiving method’s signature before choosing between these forms.

Official declaration

waveStudio-globals.d.ts

Keyboard

Global enum · official API

enum Keyboard { A = "KeyA", ArrowDown = "ArrowDown", ArrowLeft = "ArrowLeft", ArrowRight = "ArrowRight", ArrowUp = "ArrowUp", Enter = "Enter", Escape = "Escape", Space = "Space", W = "KeyW" // …additional declared keys }

Names supported keyboard codes without relying on handwritten strings. The enum includes A–Z, digits, arrows, modifiers, navigation keys, punctuation, space, and F1–F12.

ExamplesDeclared value
Keyboard.Space"Space"
Keyboard.W"KeyW"
Keyboard.ArrowUp"ArrowUp"
Keyboard.Num1"Digit1"

Gotcha: use the enum member name—not a guessed browser key string—when an API asks for Keyboard.

Official declaration excerpt

waveStudio-globals.d.ts

director.whenPress()

waveSceneDirector method · official API

whenPress( key: Keyboard | undefined, callback: InputCallback<KeyboardInputData, this>, options?: Omit<CallbackOptions, "filter"> ): CallbackHandle;

Registers a keyboard-press callback on the scene director and returns a callback handle.

ParameterUse
keyA Keyboard member or undefined. The declaration accepts both; it does not document what the undefined case means at runtime.
callbackReceives an InputCallbackContext containing data and owner.
options?Callback options excluding filter.
ReturnsCallbackHandle.
Declaration-checked example
const playerCube = new waveCube(1, 1, 1);

myScene.director.whenPress(Keyboard.Space, () => {
  playerCube.moveUp(1);
});

Related: myScene.director.sensing.whenPress(...) is also typed. The direct director method is the smaller core form.

Official declaration

waveStudio-globals.d.ts

Scene and terrain

The scene provides runtime output and world systems. Terrain has separate authoring, runtime-brush, and query surfaces.

myScene.print()

WaveScene method · official API

print( text: unknown, fontSize?: number, color?: ColorInput | string, options?: WaveScenePrintOptions ): void;

Accepts a value plus optional font size, color, and print options, and returns void. The declaration does not specify how or where the value is displayed.

ParameterTypeRequired
textunknownYes
fontSizenumberNo
colorColorInput | stringNo
optionsWaveScenePrintOptionsNo
Returnsvoid
Declaration-checked example
myScene.print("Space moves the cube", 18, PALETTE.WHITE);

Gotcha: this method returns void, so it is not a fluent chain from the scene.

Official declaration

waveStudio-globals.d.ts

terrain.runtime.noise()

Runtime terrain builder · official API

get terrain(): WaveTerrainFacade<WaveScene<TEngine>>; get runtime(): WaveTerrainRuntimeFacade<TTerminal>; noise(): WaveTerrainBrushBuilder<TTerminal>; at(value: WaveTerrainRuntimePoint): this; at(x: number, z: number): this; radius(value: number): this; amount(value: number): this; frequency(value: number): this; octaves(value: number): this; falloff(value: "smooth" | "linear" | "hard"): this; apply(): TTerminal;

Starts a runtime terrain noise brush, configures its location and shape, and commits it with apply().

Builder stepMeaning
at({ x, z })Brush center in the terrain plane.
radius(value)Brush radius.
amount(value)Noise amount.
frequency(value)Noise frequency.
octaves(value)Noise octave count.
falloff(value)Exactly "smooth", "linear", or "hard".
apply()Applies the built operation and returns the terminal type.
Official shipped terrain starter
myScene.terrain.runtime
  .noise()
  .at({ x: 0, z: 0 })
  .radius(640)
  .amount(6)
  .frequency(0.015)
  .octaves(3)
  .falloff("smooth")
  .apply();

Gotcha: at() uses terrain-plane x and z, not a 3D x, y, z position.

Official declaration and shipped WaveStudio starter

waveStudio-globals.d.ts · WaveStudio

Terrain queries

WaveTerrainFacade / WaveTerrainQueryFacade · official API

// WaveTerrainFacade heightAt(x: number, z: number): number | null; normalAt(x: number, z: number): SurfaceQueryResult["normal"] | null; query(): WaveTerrainQueryFacade; // WaveTerrainQueryFacade query(x: number, z: number): SurfaceQueryResult | null; surfaceAt(x: number, z: number): SurfaceQueryResult | null; isReady(): boolean;

Reads terrain height, normal, or a fuller surface result at an x, z location. Query methods can return null.

Declaration-checked example
const x = 12;
const z = -4;
const groundY = myScene.terrain.heightAt(x, z);

if (groundY !== null) {
  const marker = new waveSphere(0.25).placeAt(x, groundY, z);
}

Gotcha: always handle null. The signatures permit it but do not state which runtime conditions produce it.

Official declaration

waveStudio-globals.d.ts

Object systems

These surfaces are useful after the fundamentals. They are included as concise maps; consult the full declarations for every option type and overload.

Visibility and lifecycle

wave3DObject / WaveEntity · official API

// wave3DObject hide(options?: Wave3DObjectHideOptions): this; show(): this; // WaveEntity setEnabled(value: boolean): this; destroy(): void; get isEnabled(): boolean; get isDestroyed(): boolean; onCreated( callback: EntityLifecycleCallback<this>, nameOrOptions?: EntityLifecycleCallbackNameOrOptions, options?: WaveAuthoredCallbackOptions ): this; onDestroyed( callback: EntityLifecycleCallback<this>, nameOrOptions?: EntityLifecycleCallbackNameOrOptions, options?: WaveAuthoredCallbackOptions ): this;

hide() and show() control a 3D object’s presentation. setEnabled() controls entity enablement. destroy() ends the entity lifecycle and returns void.

OperationReversible?Returns
hide() / show()Paired presentation operations.this
setEnabled(false)Can be followed by setEnabled(true).this
destroy()Terminal lifecycle operation.void
Declaration-checked example
const secret = new waveCube(1, 1, 1).hide();
secret.show();

secret.onDestroyed(() => {
  myScene.print("The secret was removed");
});

Gotcha: hiding, disabling, and destroying are distinct operations. Do not use destroy() when you merely intend to hide something temporarily.

Official declaration

waveStudio-globals.d.ts

whenClickedOn()

wave3DObject interaction method · official API

whenClickedOn( callback: InteractionCallback<this>, options?: InteractionCallbackOptions ): CallbackHandle; type InteractionCallback<TOwner extends WaveEntity = WaveEntity> = (ctx: InteractionContext<TOwner>) => void;

Registers a click callback. The context contains owner, the typed object that owns the callback, and data, the interaction details.

Declaration-checked example
const buttonBlock = new waveCube(1, 0.3, 1);

buttonBlock.whenClickedOn(({ owner }) => {
  owner.setColor(PALETTE.GOLD);
});

Gotcha: this callback receives a context object, not the entity directly. Destructure owner or read ctx.owner.

Official declaration

waveStudio-globals.d.ts

Models

wave3DObject visual model methods · official API

constructor(modelAsset?: Visual3DModelAuthoringInput); useModel( model: Visual3DModelAuthoringInput, options?: Visual3DModelUseOptions ): this; removeModel(): this; get modelName(): cmp_visual3DModel["modelName"];

A general wave3DObject can receive a visual model at construction or through useModel().

Declaration-checked example
const sculpture = new wave3DObject()
  .setName("Sculpture")
  .useModel("my-model")
  .placeAt(0, 0, 0);

Gotcha: a string is compatible with the authoring type, but the declaration does not guarantee how that string is resolved—or whether it produces a runtime model. Confirm asset resolution in the current Studio project.

Official declaration

waveStudio-globals.d.ts

Physics overview

wave3DObject physics methods · official API

enablePhysics(options?: EnablePhysicsOptions): this; disablePhysics(options?: DisablePhysicsOptions): this; useDynamicBody(options?: EnablePhysicsOptions): this; useKinematicBody(options?: EnablePhysicsOptions): this; useStaticBody(options?: EnablePhysicsOptions): this; setMass(value: number): this; setGravityFactor(factor: number): this; get hasPhysicsBody(): boolean;

The core object surface can enable or disable physics and choose a dynamic, kinematic, or static body intent. Properties such as mass and gravity factor are fluent setters.

Body helperTeaching description
useDynamicBody()Choose the declared dynamic-body helper.
useKinematicBody()Choose the declared kinematic-body helper.
useStaticBody()Choose the declared static-body helper.
hasPhysicsBodyRead whether a physics body is present.
Declaration-checked example
const ball = new waveSphere(0.5)
  .placeAt(0, 5, 0)
  .useDynamicBody()
  .setMass(1);

Gotcha: the declarations establish the callable surface, not the active physics backend, collider quality, or runtime tuning. Test physics projects in WaveStudio.

Official declaration

waveStudio-globals.d.ts

Global values

Enums and typed singletons help avoid guessed strings and magic numbers.

Direction

Global enum and namespace · official API

enum Direction { Backward = "backward", Down = "down", Forward = "forward", Left = "left", Right = "right", Up = "up", X = "x", Y = "y", Z = "z" }

Provides the nine declared named direction or axis values. The merged Direction namespace also declares helpers such as random(), mix(), and randomInCone().

Declaration-checked example
const rover = new waveCube(2, 0.5, 3)
  .moveBy(Direction.Forward, 6)
  .turnToward(Direction.Left);

Gotcha: DirectionInput is broader than the enum. This entry lists the exact enum values, not every accepted direction-like type.

Official declaration

waveStudio-globals.d.ts

PALETTE

Global WaveColorSingleton · official API

const PALETTE: WaveColorSingleton; type PaletteColorMap = Record<PaletteColorKey, number>;

A typed color singleton with 103 verified named keys plus constructors and color utilities. The names below are copied from the public PaletteColorKey union; this page deliberately does not invent visual swatches or hexadecimal values.

GroupDeclared keys
NeutralsBLACK, WHITE, IVORY, WARM_WHITE, GRAY, LIGHT_GRAY, DARK_GRAY, COOL_GRAY, WARM_GRAY, CHARCOAL, SAND, SOFT_TAUPE, BONE
Reds and orangesRED, CARMINE, CRIMSON, SCARLET, VERMILION, BRICK, RUST, WINE, MAROON, CORAL, ORANGE, TANGERINE, PUMPKIN, AMBER, COPPER, TERRACOTTA, PERSIMMON
Yellows and greensYELLOW, LEMON, CANARY, GOLDENROD, MUSTARD, MAIZE, GREEN, MINT, SAGE, OLIVE, MOSS, FOREST, EMERALD, JADE
BluesCYAN, TURQUOISE, BLUE, SKY, AZURE, CERULEAN, COBALT, ROYAL, NAVY, PRUSSIAN, SLATE, MIDNIGHT, INDIGO
Purples and pinksPURPLE, MAGENTA, FUCHSIA, PINK, LAVENDER, LILAC, AMETHYST, VIOLET, PLUM, ORCHID, AUBERGINE
Earth and accentsBROWN, WALNUT, STRAW, TEAL, LIME, CELADON, CHARTREUSE, RAW_UMBER, BURNT_UMBER, RAW_SIENNA, BURNT_SIENNA, SEPIA, OCHRE, CHESTNUT, ESPRESSO, TUSCAN_TAN, ESPRESSO_DARK, OLIVE_DRAB, SKY_DEEP, CERULEAN_DARK
Metals and skin tonesSILVER, GOLD, BRASS, BRONZE, ROSE_GOLD, PLATINUM, PORCELAIN, FAIR, BEIGE, ALMOND, HONEY, CARAMEL, BRONZE_SKIN, UMBER_DEEP, KHAKI
Declaration-checked examples
const ocean = new waveCube(8, 0.2, 8)
  .setColor(PALETTE.CERULEAN);

const customColor = PALETTE.rgb(90, 180, 240);
ocean.setColor(customColor);

Selected utilities: the singleton declares rgb(), rgba(), hsv(), fromHexString(), lighten(), darken(), mix(), withAlpha(), and conversion helpers.

Gotcha: named entries are uppercase and underscore-separated. PALETTE.WARM_WHITE is declared; PALETTE.warmWhite is not.

Official declaration and allowed key union

waveStudio-globals.d.ts

Source boundary and completeness

This reference is designed for learning, not exhaustive coverage. Public signatures can evolve. When this page and the current editor disagree, use WaveStudio autocomplete and the latest official declaration files as the authority.

Official sourceWhat it establishes
Global declaration filePublic classes, interfaces, globals, overloads, enums, and return types.
Entity-alias declaration fileWaveStudio convenience factories such as cube(), sphere(), and cylinder().
WaveStudioThe current public web editor and its runtime.
Wave3D engine overviewOfficial public product context.

Wave3D Handbook v0.1 · Independent learning material grounded in official public Wave3D sources. Wave3D and WaveStudio belong to their respective owner.

Search across the tutorial, guide, reference, and examples.