arrived(id: string, bytes: string) → void
| arg | type | description |
|---|
| id | string | |
| bytes | string | |
newId( ) → string
A new image id: unique across peers.
has(id: string) → boolean
| arg | type | description |
|---|
| id | string | |
bytes(id: string) → string
| arg | type | description |
|---|
| id | string | |
put(id: string, bytes: string) → void
Keep an image this peer made or restored.
| arg | type | description |
|---|
| id | string | |
| bytes | string | |
texture(id: string) → any
The GPU texture of an image, made on first ask.
| arg | type | description |
|---|
| id | string | |
send(id: string) → void
Send an image to every other peer, in chunks.
| arg | type | description |
|---|
| id | string | |
want(id: string) → void
Ask the room for an image this peer lacks (at most every 3 s per image).
| arg | type | description |
|---|
| id | string | |
capture(pos: { number }, at: { number }, up: { number }?, fov: number?) → string
Render the scene once from `pos` looking at `at` (world points, `up` the
lens's up) into the photo target, read it back and return the JPEG.
Yields for the frames the render and readback take.
| arg | type | description |
|---|
| pos | { number } | |
| at | { number } | |
| up | { number }? | |
| fov | number? | |
material(printId: string, imageId: string, seed: number, age: number) → any
The print's own film material (its clock is the print's age), keyed by the
print entity. The photo is bound as soon as this peer holds it.
| arg | type | description |
|---|
| printId | string | |
| imageId | string | |
| seed | number | |
| age | number | |
materialReady(printId: string) → boolean
| arg | type | description |
|---|
| printId | string | |
setAge(printId: string, age: number) → void
Restate a print's age (seconds since it was shot) on its material clock.
| arg | type | description |
|---|
| printId | string | |
| age | number | |
dropMaterial(printId: string) → void
| arg | type | description |
|---|
| printId | string | |
writeKept(t: { [string]: Kept }) → void
| arg | type | description |
|---|
| t | { [string]: Kept } | |
keep(id: string, seed: number, shotAt: number, p: { number }, r: { number }) → void
Remember a print pinned by this player (pose in world space) and its image.
| arg | type | description |
|---|
| id | string | |
| seed | number | |
| shotAt | number | |
| p | { number } | |
| r | { number } | |
forget(id: string) → void
| arg | type | description |
|---|
| id | string | |
kept( ) → void
The prints this player pinned in earlier sessions, their images loaded
into the cache.
qaxis(x: number, y: number, z: number, a: number) → Q
| arg | type | description |
|---|
| x | number | |
| y | number | |
| z | number | |
| a | number | |
qbasis(xa: { number }, ya: { number }, za: { number }) → Q
The rotation whose local +X, +Y, +Z are the given (orthonormal) axes.
| arg | type | description |
|---|
| xa | { number } | |
| ya | { number } | |
| za | { number } | |
toWorld(e: any, l: { number }) → void
A point in an entity's frame, in the world.
| arg | type | description |
|---|
| e | any | |
| l | { number } | |
dirWorld(e: any, d: { number }) → void
A direction in an entity's frame, in the world.
| arg | type | description |
|---|
| e | any | |
| d | { number } | |
borrowView( ) → any
Take the player's camera off its controller; returns the Camera, or nil.
returnView( ) → void
Give the player's camera back to the controller it had.
viewBorrowed( ) → boolean
slotPoseOf(camE: any, out: number) → void
| arg | type | description |
|---|
| camE | any | |
| out | number | |
bin(printId: string) → void
| arg | type | description |
|---|
| printId | string | |
⌬ Types
Kept = { id: string, seed: number, shotAt: number, p: { number }, r: { number } }Q = { x: number, y: number, z: number, w: number }PrintInfo = { id: string, shooter: number, shotAt: number, pinned: boolean, held: boolean, slotOf: string, ejectAt: number }