luvcraft/phone.lisp
The slab, in the grip frame: 0.37 wide, 0.46 tall, 0.022 thin, held in front of the palm by its lower third with the thumb up one edge and the fingers round the other. A little large for a phone, a little squat for one too -- the proportions of a small handheld console -- because what it carries is a terminal: sixty condensed columns.
The phone's font: Input Mono Condensed from the user's fonts when it is
installed (its licence keeps it out of the repository), else the wall's.
weight is "Regular" or "Bold".
--------------------------------------------------------------------- The phone's screen as a terminal surface.
The phone's screen rectangle in the grip frame: right is grip x, up is grip y, and outward is toward the eye, grip -z.
The phone in hand is nearer than anything the crosshair could be on.
The general answer is in grip space, since that is the space the phone surface describes itself in; carry it into the world through wherever the hand is this frame.
The phone is wherever the hand is; the camera stays put and only the narrowed field of view says the player is looking at it.
--------------------------------------------------------------------- The display: a terminal display whose camera lives in the hand.
A wall terminal display drawn on a phone screen: the same runs, drawn against a per-frame uniform whose camera is expressed in the grip frame.
The camera's five uniform lanes, expressed in the right hand's grip frame.
The camera moved relative to the hand since last frame; say where it is now, in the frame the screen was built in.
--------------------------------------------------------------------- The phone itself.
0 when the phone is merely held, 1 when its shell has the focus and the hand has brought it square to the centre of the view; eased.
A comically large phone: a graphite slab with a live terminal on its face toward the player. Held in the right hand; TAB focuses its display.
phone
The bump and the grip are boxes; the slab has real corners.
Up in front of the face, screen toward the eye and a little to the right of centre so the crosshair still shows past its edge; when its shell has the focus, brought square to the centre and held a little further off, where the narrowed field of view frames the whole screen. Carried: at arm's length and low, tipped back so it can be glanced at on the way somewhere without taking the view. Focused: brought up square to the centre, closer, where the narrowed field of view frames the whole screen.
The slab itself is not a box: see emit-hand-item below.
A camera bump on the back, high on the left as seen from behind.
The grip takes the sides, never the screen: a thumb up the right edge, fingers round the left edge with their tips just onto the bezel.
The mode a phone's display starts in when it is first taken out.
The phone is a terminal like a wall is, so :SHELL is what it knows by itself. The complete luvcraft system includes the Telegram presentation and sets this to :TELEGRAM when that part loads. DEFVAR deliberately preserves that application-owned choice when LUVCRAFT/CORE is reloaded live.
The phone's terminal display, made -- with a shell in it -- on first use.
Publish only the complete display. In particular, a
Telegram startup failure must not leave a cached display in
:TELEGRAM mode with no mode overlay -- a permanently black
phone which ensure-phone-display would otherwise never retry.
The shell keeps running in the pocket; only the focus lets go.
Take the session's phone out, or put it away.
How far the slab's corners are rounded, in cells.
The slab's centre above the palm, which holds it by its lower third.
The slab's centre in front of the palm.
Addition over compatible quantities.
Subtraction or unary negation.
How many rows of shell the phone shows; the columns follow its width.
The bezel between the screen's edge and its font grid, in cells.
(weight)The phone's font: Input Mono Condensed from the user's fonts when it is installed (its licence keeps it out of the repository), else the wall's. WEIGHT is "Regular" or "Bold".
The phone's screen rectangle in the grip frame: right is grip x, up is grip y, and outward is toward the eye, grip -z.
A comically large phone: a graphite slab with a live terminal on its face toward the player. Held in the right hand; TAB focuses its display.
(surface)Return SURFACE's unit RIGHT, UP, and OUTWARD vectors as three vec3s, in the coordinate space the surface's display is drawn in.
(x y z)(surface &optional offset)Return the point OFFSET cell-depths outside SURFACE's lower left corner, as seen from its outward side.
Multiplication and scalar scaling.
(surface &optional session)True when SURFACE's last coherently published derived state is current.
(surface session)A non-negative score when the display on SURFACE can be entered by TAB, or NIL. Lower is nearer.
(phone session)(surface session &optional offset)Where a panel mounted flat on SURFACE sits in the world this frame. Returns the panel's centre point, its half-width vector along the surface's right, its half-height vector pointing *down* the texture, and the outward unit normal -- all in world space, OFFSET cell-depths off the face. A wall's answer never changes;…
(session)The world-space frame of the right hand's grip this frame. Returns the palm point and the unit RIGHT, UP, and FORWARD of the grip. A held item's boxes are placed in this frame, and a display drawn on a held item (the phone's terminal) expresses the camera in it.
(origin right up forward x y z)(surface session)The camera pose from which SURFACE's display is best read, or NIL to leave the camera where it is with only the narrowed field of view.
A wall terminal display drawn on a phone screen: the same runs, drawn against a per-frame uniform whose camera is expressed in the grip frame.
(display frame)The frame uniform buffer DISPLAY's runs draw against in FRAME. A wall draws in world coordinates against the session's own frame uniform. A display whose surface lives in some other space -- a phone in the hand -- supplies a uniform whose camera is expressed in that space instead.
An explicitly owned AVFrame.
Logical disjunction of tests and raw truth values.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(session)The frame buffer byte size derived from the shader-visible block layout. Checked against the host's packed frame data at construction, so growing the frame uniform cannot silently diverge between shader and host.
(session width height)(camera)(left right)(position right up forward field-of-view width height)Pack the five camera lanes for an eye at POSITION with the unit basis RIGHT UP FORWARD, in whatever coordinate space those are given in. The ordinary camera packs its own pose through this; a display drawn in a space of its own (a phone screen in the hand) packs the same camera re-expressed in that space.
(overlay session pass surface-texture)Encode OVERLAY into SESSION's open scene PASS for SURFACE-TEXTURE.
Logical conjunction of tests and raw truth values.
Test whether one compatible scalar is greater than another.
(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
(session width height &key camera-lanes)Pack the frame environment: camera lanes plus the evaluated sky. Lane order must match *FRAME-UNIFORM-MEMBERS* exactly; the construction-time check in BLOCK-WORLD-CAMERA-UNIFORM-SIZE keeps the two honest. CAMERA-LANES may replace the session camera's own five lanes with a camera expressed in some other space; the…
(overlay)Release resources owned by an object attached to luvcraft.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(item body vertices palm right up forward
sky-level block-level)Append ITEM's geometry, held by BODY, to VERTICES. PALM is the world point of the grip and RIGHT UP FORWARD its unit frame. The default method emits the item's MAP-HAND-ITEM-BOXES; an item whose shape is not a heap of boxes -- a slab with genuinely round corners -- adds to that here.
(vertices origin right up forward half-x half-y half-z radius tile
sky-level block-level &key (segments 6) (emission 0.0))Append a slab centred on ORIGIN with axes RIGHT UP FORWARD whose four corners are rounded to RADIUS in the RIGHT/UP plane: two flat faces and a band of quads around the edge, all wearing TILE stretched once around.
(item body)Where BODY holds ITEM: (X Y Z PITCH YAW ROLL) of the grip in the view frame, before walking bob is added.
(a b amount)(item body seconds)Let ITEM ease its own state by SECONDS while BODY holds it.
Compare compatible quantities and produce dimensionless values.
The minimum of compatible quantities.
Test whether one compatible scalar is less than another.
The maximum of compatible quantities.
(item body function)Call FUNCTION for each textured box of ITEM as held by BODY. FUNCTION receives (X Y Z HALF-X HALF-Y HALF-Z TILE &KEY TILT STRETCH-P EMISSION), like MAP-CRITTER-BOXES with three extras: TILT is a (PITCH YAW ROLL) triple of radians turning the box about its own centre, STRETCH-P stretches the whole atlas tile over each…
The mode a phone's display starts in when it is first taken out. The phone is a terminal like a wall is, so :SHELL is what it knows by itself. The complete luvcraft system includes the Telegram presentation and sets this to :TELEGRAM when that part loads. DEFVAR deliberately preserves that application-owned choice…
(phone session)(surface font-pathname margin rows)(session surface columns rows
&key (class 'terminal-display)
(fixture (terminal-display-fixture))
(margin 0.12)
(font-scale 1.0)
(font-pathname *terminal-display-font-pathname*)
(bold-font-pathname *terminal-display-bold-font-pathname*)
(default-foreground *terminal-display-default-foreground*)
(screen-role :terminal-screen)
(faceplate-role :terminal-faceplate)
(add-p t))Build a COLUMNS by ROWS Ghostty terminal display of CLASS on SURFACE. SURFACE is anything answering the terminal-surface protocol: a wall of blocks or a phone screen. SCREEN-ROLE and FACEPLATE-ROLE name the shader materials of the panel behind the text and the glass in front of it; the defaults are the wall's tube. …
(display)Attach an interactive login-free bash in the checkout to DISPLAY. The shell learns where this game's portal server listens and which wall it is on, so a luvcraft started in it appears right here.
(display session mode)Select DISPLAY's focused wall MODE. The built-in modes are the EQL-specialized symbols :SHELL and :FILM. LUVCRAFT/MCCLIM adds an :AFTER method which supplies the film browser, while the display continues to own focus and movie lifetime.
(session overlay &key (release-p t))Detach OVERLAY at a frame boundary and optionally release it there. The no-release path is intentionally preserved for FUSE-LUVCRAFT-OVERLAY: that path may run inside a frame whose command stream still borrows OVERLAY.
(session)(session)(body session type)Take out BODY's item of TYPE -- from the pocket, or newly made -- or put it away when it is already the thing in hand. Returns what is now held.
The phone: a wall terminal you can carry.
#S27JKR is the design; this is what it turned into.
A phone is the first thing the player's hand can hold (BODY.LISP), and what it does is what the wall terminals do: it shows a live shell. The whole terminal display -- Ghostty terminal, PTY, glyph and cell runs, screen panel and faceplate glass -- is the one TERMINAL-WALL.LISP already builds; only its surface is new. A wall's surface is a rectangle of blocks in the world. The phone's is a rectangle in the grip frame, the hand's own coordinate space, where the screen never moves at all. What moves is the hand, and so, seen from the phone, the camera: each frame the display draws against a frame uniform whose camera is the real one re-expressed in grip coordinates. Nothing about the runs is rebuilt for motion; the same glyph instances that were right last frame are right this frame, because in their own space nothing happened.
The phone is a focus like a wall is: TAB with the phone out enters it and keys go to its shell, shift-TAB leaves. Putting the phone away pockets it with its shell still running; taking it out again brings the same shell back.