Class HtmlRaycastInteractionManager
Constructors
constructor
-
new HtmlRaycastInteractionManager(
scene: Scene,
texture: HtmlTexture,
mesh: AbstractMesh,
options?: IHtmlRaycastInteractionManagerOptions,
): HtmlRaycastInteractionManagerCreates a raycast interaction manager.
Parameters
- scene: Scene
the scene to listen to for pointer events
- texture: HtmlTexture
the HTML texture whose element should receive the forwarded events
- mesh: AbstractMesh
the mesh displaying the texture; only hits on this mesh are forwarded
- options: IHtmlRaycastInteractionManagerOptions = {}
optional configuration
Returns HtmlRaycastInteractionManager
- scene: Scene
Routes Babylon pointer events to a live HTML element rendered through an HtmlTexture.
On every pointer event the scene is picked; when the configured mesh is hit, the picked UV is mapped to a pixel inside the source element and an equivalent DOM pointer (and mouse) event is dispatched there. This works for arbitrary meshes (planes, boxes, curved surfaces) because it relies on UV coordinates rather than a flat CSS overlay. For a perspective-correct overlay on planar surfaces, see HtmlInteractionManager.