Skip to content

Interface: BodyHover

Controlled hover state — scene controllers drive these from their own raycast events. The body itself never auto-mutates hover state.

Sol hover is rendered as a ring overlay; atmo hover is rendered as a vertex-colour tint on the targeted atmo tile (no extra mesh). The dispatcher setBoardTile routes to the right board based on the BoardTileRef.layer, so callers can forward the result of BodyInteractive.queryHover verbatim.

Methods

setTile()

ts
setTile(id, options?): void;

Highlights the given sol tile (or clears highlight when null).

Parameters

ParameterType
idnumber | null
options?HoverPlacementOptions

Returns

void


setBoardTile()

ts
setBoardTile(ref, options?): void;

Routes a hover update to the correct board. Pass the result of BodyInteractive.queryHover directly — null clears hover on both boards, a sol ref highlights the sol ring, an atmo ref tints the atmo tile.

Parameters

ParameterType
refBoardTileRef | null
options?HoverPlacementOptions

Returns

void


setBodyHover()

ts
setBodyHover(visible): void;

Toggles the body-level hover ring (used when another body is hovered).

Parameters

ParameterType
visibleboolean

Returns

void


updateCursor()

ts
updateCursor(config): void;

Live mutation of the hover-cursor visuals (ring color / size, emissive color / intensity / size, column color). Disabled primitives (false at build time) cannot be enabled this way — pass them through useBody's hoverCursor/hoverCursors option instead so the GPU resource is allocated up front.

Parameters

ParameterType
configHoverCursorConfig

Returns

void


useCursor()

ts
useCursor(name): void;

Switches the active cursor preset by name — must be one of the keys registered in useBody's hoverCursors option (or 'default' when the body was built with the single-cursor hoverCursor shortcut). Throws on unknown names. Each preset is a full HoverCursorConfig — switching applies the entire preset (any primitive not mentioned by the preset falls back to its lib default, NOT the previous preset's value).

Parameters

ParameterType
namestring

Returns

void


onChange()

ts
onChange(listener): () => void;

Subscribes to hovered sol-tile changes — returns an unsubscribe function.

Parameters

ParameterType
listenerHoverListener

Returns

() => void

Distribué sous la licence indiquée dans le dépôt.