BabylonAdapter
Integration adapter for Babylon.js.
Usage
javascript
import { BabylonAdapter } from './adapters/babylon.js'
const adapter = new BabylonAdapter({ scene, camera, engine })
adapter.attach(tracker)| Parameter | Type | Required | Description |
|---|---|---|---|
scene | BABYLON.Scene | Yes | Babylon.js scene |
camera | BABYLON.Camera | Yes | Camera |
engine | BABYLON.Engine | Yes | Engine |
Methods
attach(tracker)
Connects the adapter to the tracker.
addARContent(targetId, mesh, options)
Adds 3D content associated with a target.
javascript
const box = BABYLON.MeshBuilder.CreateBox('box', { size: 0.1 }, scene)
adapter.addARContent('myMarker', box, { scale: 1, flipX: true })| Option | Type | Default | Description |
|---|---|---|---|
scale | number | 1 | Scale multiplier |
flipX | boolean | false | Flip horizontally |