Interface: PointerEngine
@roomful/core / PointerEngine
Interface: PointerEngine
Section titled “Interface: PointerEngine”Defined in: packages/core/src/types.ts:1626
Exposes the laser-pointer primitive for a room. A pointer engine broadcasts this peer’s transient “beam” position while active and surfaces remote peers’ beams so they can be drawn. It is close to the cursor engine, but a beam is only broadcast while PointerEngine.activate is in effect — deactivating (or unmounting/disconnecting) makes the beam disappear for every peer.
Like cursors and viewport, it rides the room’s event channel and uses
normalized (0–1) coordinates, so no relay change is required.
Methods
Section titled “Methods”activate()
Section titled “activate()”activate():
void
Defined in: packages/core/src/types.ts:1650
Starts broadcasting this peer’s pointer beam. While active, pointer movement over the mounted element is broadcast to peers.
Returns
Section titled “Returns”void
Nothing.
deactivate()
Section titled “deactivate()”deactivate():
void
Defined in: packages/core/src/types.ts:1658
Stops broadcasting and announces an inactive beam so peers drop it (the laser disappears).
Returns
Section titled “Returns”void
Nothing.
getAll()
Section titled “getAll()”getAll():
PointerBeam[]
Defined in: packages/core/src/types.ts:1673
Returns all remote pointer beams.
Returns
Section titled “Returns”The current remote beams.
mount()
Section titled “mount()”mount(
element):void
Defined in: packages/core/src/types.ts:1634
Tracks mousemove on a container and broadcasts the normalized pointer
position while active. Mounting also targets the built-in renderer.
Parameters
Section titled “Parameters”element
Section titled “element”HTMLElement
The container element to track.
Returns
Section titled “Returns”void
Nothing.
render()
Section titled “render()”render(
options?):Unsubscribe
Defined in: packages/core/src/types.ts:1684
Renders a built-in, zero-config DOM overlay that draws every remote active beam over the container, updating as beams change. This is a convenience layer; apps that draw their own pointers can ignore it and use PointerEngine.subscribe instead.
Parameters
Section titled “Parameters”options?
Section titled “options?”The overlay container and style.
Returns
Section titled “Returns”A cleanup function that removes the overlay.
subscribe()
Section titled “subscribe()”subscribe(
cb):Unsubscribe
Defined in: packages/core/src/types.ts:1666
Subscribes to remote pointer beams.
Parameters
Section titled “Parameters”(beams) => void
The callback invoked with the current remote beams.
Returns
Section titled “Returns”A function that removes the listener.
unmount()
Section titled “unmount()”unmount():
void
Defined in: packages/core/src/types.ts:1642
Stops tracking the element, broadcasts an inactive beam so peers drop it, and tears down the built-in overlay.
Returns
Section titled “Returns”void
Nothing.