Skip to content

createFlatlandCompute

createFlatlandCompute(getFlatland): (_event, state, previous?) => void

Defined in: packages/three-flatland/src/react/flatlandEvents.ts:51

Build an R3F portal events.compute for content portaled into a Flatland’s internal scene (spec §8.1).

The parent root’s compute supplies pointer NDC. When either camera owns a centered pixel viewport, the point is converted back through the parent’s logical viewport and into Flatland’s viewport before the ray is cast. A point in Flatland’s letterbox region leaves raycaster.camera undefined, R3F’s documented signal to skip this portal root for the event.

() => Flatland | null

(_event, state, previous?) => void

createPortal(children, flatland.scene, {
events: { compute: createFlatlandCompute(() => flatlandRef.current), priority: 1 },
})