A sound at a place (ADR-0059): id, name, asset (the id of an audio asset), east and north in metres of the scene's frame, up (1.5 m, SOUND_HEIGHT, when absent), volume (0 to 1) and reach, the metres at which it can no longer be heard (2 to 500). checkSoundSource and checkSounds list its problems; SOUND_LIMITS holds the bounds, at most 50 sounds. A PublicPresentation and a package's manifest carry them as sounds.
SceneEnvironment
type
sky (a colour like #9cc3e4), sun (azimuth and elevation in degrees, intensity, color), ambient (0 to 2), fog (read, not drawn since ADR-0105), ground (whether the ground sheet is drawn), exposure (0.2 to 3), floor (a colour the objects cast their shadows on), shadows (how they are kept: "off", "on-change", the default, or "realtime"), reveal (read, not drawn), time (the time of day, 0 up to 1), sound (the id of an audio asset played as its ambience where it is shown), map (a SceneMap), look ("normal", the default, or "operational": what is connected to a source stands out and the rest is faint, ADR-0109), and the preset it started from, if any.
TIME_OF_DAY, lightAt, phaseOf, onCycle, timeOf
value, functions
The time of day (ADR-0105): a phase of one cycle, dawn 0, day 0.25, dusk 0.5, night 0.75. lightAt(time, studio) is the light there, blended between the four; phaseOf the nearest named one; timeOf(environment) a look's own time or its preset's. A control of appearance, not a sun: no date, clock or place is used.
inStudio, drawnLook, STUDIO_FLOOR
functions, value
Whether a look's 3D scene is the Studio (SceneMap.studio, or a floor for a look stored before it), and what a 3D reader draws for a look: the Studio on its floor, or the land with no floor, at a time of day.
SceneMap
type
The map a scene is drawn on, where a reader draws one (ADR-0104): basemap (a name in lower case letters, digits and hyphens; none when absent), terrain (off when absent) and labels (place names; shown when absent). It names what is drawn; the app that shows the scene maps the name to a source.
ShadowMode, SHADOW_MODES
type, value
"off", "on-change", "realtime": how an environment's shadows are kept (ADR-0076). A device may draw less, never more.
EnvironmentPreset, ENVIRONMENT_PRESETS
type, value
"dawn", "day", "dusk", "night", "studio"; "morning" and "evening" are deprecated names of dawn and dusk.
environmentOf(preset)
function
The environment of a preset: a starting point to adjust by making a new value.
checkEnvironment(value)
function
Every problem of an environment; empty when a renderer may draw it.
How an object is drawn: one of the eleven kinds below.
PlanPoint
type
[east, north]: a point of a footprint or a path, in metres from the object's position.
Orientation
type
heading, pitch, roll in degrees.
isObservable(object)
function
Narrows to a shadow or a twin.
Relation
type
{ kind, to }: an edge from an object to another, by id.
Every object may also carry class (Klorad's classification), classifications (other schemes,
by name: { ifc: "IfcPump" }), layer (a layer id of the package), relations and
navigation (Navigation, one of NAVIGATION: "walkable", "blocks" or "ignore", how a
person moves about it; absent, a renderer decides by its shape and IFC class, ADR-0066). An
update replaces the relations it is given; navigation: null gives the choice back to the
shape.
Sizes are metres. The first four kinds are shapes; model and splat are drawn from files; the
next three are the shapes of a map, given around the object's position, so the object itself
stays one position on Earth. feature is a part of another object's model, and group is a
whole made of other objects.
kind
Fields
Draws
"box"
width, depth, height
A box standing on its position: width runs east, depth north.
"cylinder"
radius, height
An upright cylinder.
"sphere"
radius
A sphere resting on its position.
"marker"
none
A pin whose tip is the position.
"model"
uri, format?, part?
A model file; format: "3d-tiles" (TILESET_FORMAT) names a 3D Tiles 1.1 tileset, streamed. A glTF or GLB file, in metres, with its origin at the object's position. At heading 0 its minus z axis points north.
"splat"
uri, format?, capturedAt?
A Gaussian splat: SPZ when format is absent, or PLY. Picked by the box of its points, never walked on. Readers that cannot draw it show a symbol. See Show a Gaussian splat.
"extrusion"
footprint, height
A footprint raised to a height: a building block.
"polygon"
footprint
A flat area: a square, a zone, water.
"polyline"
path, width
A line with a width: a road, a pipe, a route.
"feature"
of, feature, footprint?, height?
One element of another object's model: of names that object, feature the element's id in its model (the globalId of a 3D Tiles feature, or a node's name in a GLB). Drawn by that model; footprint and height give its box around its position, for framing and the plan. See Show a building as BIM.
"group"
none
Nothing of its own: a compound object drawn by the objects that name it as their whole. See Group objects into a compound.
A footprint is one ring of at least three PlanPoints that encloses an area, in either
winding, without holes; it may repeat its first point at the end, as GeoJSON does. A path has
at least two points. The scene checks, copies and freezes them, and throws a RangeError on a
size that is not a positive number or a point that is not finite. See
Draw a place from a map.
A PackedScene: objects in chunks of chunkSize metres (default 250), each with bounds and a SHA-256; includeState (default true) adds the latest readings; revision records a store's revision.
unpackScene(manifest, load, options?)
async function
A scene from a manifest, loading through load only the chunks that overlap bounds, keeping only layers. Refuses a chunk whose hash does not match. Returns scene, meta, revision, loaded.
chunksFrom(chunks)
function
A chunk loader over chunks in memory.
readPackedScene(value)
async function
Any scene document Klorad wrote, a version 1 snapshot upgraded in memory.
validatePackage(value), assertPackage(value)
function
Every problem of a manifest, or a throw listing them.
An ordered walk through some of the scene's views: id, name, text?, stops (view ids, in order).
PropertyField, PropertyFieldType
type
What a property of the scene's objects means: its key, label, type ("text", "number", "period", "url" or "choice") and the choices of a choice.
Attachment
type
A file that belongs to an object without drawing it: id, object, title, asset (one of the scene's assets, by id), mediaType, and role ("media", or "alternate" for another model of the same object).
CitedSource
type
Where an object's description came from, as a reader may see it (ADR-0124): id, object, the caption its editor approved, and a url only for an outside, https source. It never names a file, and it is not an attachment: nothing of it can be downloaded.
A SceneMeta may also carry its presentation: an environment, tours, fields,
attachments and cited sources, and a NamedView its text, what a reader is told when they stand there. A
reader that does not know them ignores them.
| objectBounds(object), intersects(a, b) | function | The box an object occupies; whether two boxes overlap in plan. |
| hashJson(value), sha256Hex(bytes), canonicalJson(value) | function | The content hashes a package uses. |
The objects that match every part of a SceneQuery: bounds, layers (null for objects without one), ids, classes, correspondence, related ({ to, kind?, direction? }). In scene order.
relationsOf(scene, id, direction?)
function
The Edges that leave (out), reach (in) or touch (both, default) an object.
pickFields(objects, fields)
function
Only the named fields of each object, id always included.
createChunkedScene(manifest, load, options?)
function
A scene that holds only the chunks of a package its views overlap. Each view opens a viewer(name, { admits? }): its own scene holds only the objects admits allows (from an Access policy), whatever the shared scene loaded for other views, so chunks are shared for memory and permissions are not. setBounds(bounds) says what the view shows; release() closes it, stops its scene and lets go of chunks only it held. A chunk that arrives after every view needing it has moved on is dropped. Chunks beyond a margin of every view (default half its width) are let go. A chunked scene is a reader's cache: edits go to the scene's store.
Read only: an agent changes nothing through it. See For agents.
Export
Kind
Description
describeScene(scene, options?)
function
An AgentView: each object (by query) with class, correspondence, layer, position in metres, readings with their age and freshness, relations, and with interaction and actor the Action ids that actor may perform.
agentText(view)
function
The view as compact text for a model's context: one line per object and the schematic plan.
planText(scene, objects?, options?)
function
A schematic plan as characters, north up, one letter per object, with its legend and metres per character.
distanceBetween(scene, a, b), nearest(scene, id, options?)
function
Metric answers in metres: the distance between two objects; the nearest ones, optionally within a radius and among a query.
The sanitised projection a public World shows: no source or device id, nothing the filter does not name; views replace the scene's own. A presentation is applied over it.
PublicPresentation, ObjectPresentation
type
How a public World is presented: views (which win over the fourth argument), tours, environment, fields, attachments, cited sources (kept only for public objects, and only when they carry a caption or an https address), and per object id a name, east, north, up, heading, scale, the values of described properties and hidden. It hides and arranges public objects and adds only the properties fields describes, never what the filter keeps out.
checkPresentation(presentation), MAX_PRESENTED
function, constant
Every problem of a presentation, and how many tours (20), fields (40), attachments (500), sources (500) and objects (2000) it may hold.