TurboWarp-AR

TurboWarp-AR provides camera-source based AR session and target-state blocks for TurboWarp projects.

Requirements

Quick start

create AR scene with camera [default] layer [above-stage]
define AR target [marker-1]
attach selector [#card] to AR target [marker-1]
set AR target [marker-1] visible [true] confidence [1]

A-Frame integration

A-Frame is optional. Attached selectors receive visible, position, rotation, data-ar-target, and data-ar-confidence attributes.

Development

See the repository README and architecture documentation for build, test, release, and compatibility details.

TurboWarp-AR: complete block reference

All 16 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

create AR scene with camera [CAMERA_ID] layer [LAYER]

Starts an AR session by acquiring a shared camera-source camera lease.

Block type: COMMAND. Opcode: createARScene. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERA_IDSTRINGdefault
LAYERSTRINGabove-stage

LAYERを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

stop AR scene

Stops the AR session and releases the shared camera lease.

Block type: COMMAND. Opcode: stopARScene. Permanent link

This block has no arguments.

AR status

Returns the AR session status.

Block type: REPORTER. Opcode: arStatus. Permanent link

This block has no arguments.

AR scene is running?

Reports whether the AR session is running.

Block type: BOOLEAN. Opcode: isARSceneRunning. Permanent link

This block has no arguments.

define AR target [TARGET_ID]

Creates or resets a named AR target state.

Block type: COMMAND. Opcode: defineARTarget. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1

set AR target [TARGET_ID] visible [VISIBLE] confidence [CONFIDENCE]

Updates a target's visibility and confidence using the manual MVP backend.

Block type: COMMAND. Opcode: setARTargetVisible. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1
VISIBLEBOOLEANtrue
CONFIDENCENUMBER1

CONFIDENCEを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。VISIBLEはBoolean入力のまま読取専用です。CONFIDENCEに0..1の新制約は加えず、実行時のclampを維持します。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

set AR target [TARGET_ID] position x [X] y [Y] z [Z]

Updates a target's position in AR scene coordinates.

Block type: COMMAND. Opcode: setARTargetPosition. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1
XNUMBER0
YNUMBER0
ZNUMBER-1

X・Y・Zを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

set AR target [TARGET_ID] rotation x [X] y [Y] z [Z]

Updates a target's Euler rotation in degrees.

Block type: COMMAND. Opcode: setARTargetRotation. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1
XNUMBER0
YNUMBER0
ZNUMBER0

X・Y・Zを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

AR target [TARGET_ID] is visible?

Reports whether the target is currently visible.

Block type: BOOLEAN. Opcode: isARTargetVisible. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1

AR target [TARGET_ID] confidence

Returns the target confidence from 0 to 1.

Block type: REPORTER. Opcode: arTargetConfidence. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1

AR target [TARGET_ID] position [AXIS]

Returns one axis of the target position.

Block type: REPORTER. Opcode: arTargetPosition. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1
AXISSTRINGx

AXISを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

AR target [TARGET_ID] rotation [AXIS]

Returns one axis of the target rotation.

Block type: REPORTER. Opcode: arTargetRotation. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1
AXISSTRINGy

AXISを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

when AR target [TARGET_ID] found

Fires once when a target transitions from hidden to visible.

Block type: HAT. Opcode: whenARTargetFound. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1

when AR target [TARGET_ID] lost

Fires once when a target transitions from visible to hidden.

Block type: HAT. Opcode: whenARTargetLost. Permanent link

ArgumentTypeDefault valueMenu choices
TARGET_IDSTRINGmarker-1

attach selector [SELECTOR] to AR target [TARGET_ID]

Synchronizes matching DOM or A-Frame nodes to an AR target pose.

Block type: COMMAND. Opcode: attachSelectorToARTarget. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card
TARGET_IDSTRINGmarker-1

detach selector [SELECTOR] from AR target

Stops synchronizing a selector to any AR target.

Block type: COMMAND. Opcode: detachSelectorFromARTarget. Permanent link

ArgumentTypeDefault valueMenu choices
SELECTORSTRING#card

Repository guide and examples