Image Target
An AR image-tracking anchor. Children of an image-target entity are revealed and aligned when the tracker recognizes the printed image at runtime.
ts
import { Behaviour } from "@relu-interactives/spatial-ecs";
export default class SpawnTarget extends Behaviour {
init() {
const objects = this.world.getObjectManagementSystem();
objects?.requestCreate("imageTarget", {
name: "PosterTarget",
path: "/assets/targets/poster.png",
options: {
compiledTargetUrl: "/assets/targets/poster.mind",
},
}, (entityId) => {
// Parent renderable content under the target so it shows when tracked.
objects?.requestCreate("model", {
name: "Reveal",
path: "/assets/models/reveal.glb",
parentId: entityId,
});
});
}
}Payload
| Field | Type | Default | Description |
|---|---|---|---|
name | string | "Image Target" | Display name. |
path | string | "" | URL of the source image used as a visual reference in the editor. |
transform | TransformData | identity | Position / rotation / scale (usually left at identity — the tracker drives the transform). |
parentId | EntityId | null | null | Optional parent entity. |
options
| Option | Type | Description |
|---|---|---|
targets | ImageTargetReference[] | Optional list of target references when bundling multiple images into one compiled file. |
compiledTargetUrl | string | URL to the compiled .mind file used by the tracker. |
compiledTargetDir | string | Optional directory containing compiled target files. |
Components attached
Transform, Object3DRef, Name, EntityType, ParentId, Selectable, ImageTarget, ImageTargetAnchor.

