UNAVI Docs unavi.xyz
Build · Scripting API

wired:agent

The local user's body: where they look, where their limbs are, and documents carried with them.

Interface local

Uses transform, error, document.

humanoid-bone

enum

The VRM 1.0 humanoid bone set.

hips
spine
chest
upper-chest
neck
head
left-eye
right-eye
jaw
left-shoulder
left-upper-arm
left-lower-arm
left-hand
right-shoulder
right-upper-arm
right-lower-arm
right-hand
left-upper-leg
left-lower-leg
left-foot
left-toes
right-upper-leg
right-lower-leg
right-foot
right-toes
left-thumb-proximal
left-thumb-intermediate
left-thumb-distal
left-index-proximal
left-index-intermediate
left-index-distal
left-middle-proximal
left-middle-intermediate
left-middle-distal
left-ring-proximal
left-ring-intermediate
left-ring-distal
left-little-proximal
left-little-intermediate
left-little-distal
right-thumb-proximal
right-thumb-intermediate
right-thumb-distal
right-index-proximal
right-index-intermediate
right-index-distal
right-middle-proximal
right-middle-intermediate
right-middle-distal
right-ring-proximal
right-ring-intermediate
right-ring-distal
right-little-proximal
right-little-intermediate
right-little-distal

attachment

variant
camera
bone(humanoid-bone)

camera-transform

funccamera-transform: func() -> result<transform, error>

The camera's world transform this frame. Fails with not-ready until the user's body has loaded.

bone-transform

funcbone-transform: func(bone: humanoid-bone) -> result<option<transform>, error>

A bone's world transform this frame, or none when the user's avatar lacks it. Fails with not-ready until the avatar has loaded.

attach

funcattach: func(document: borrow<document>, to: attachment, offset: transform) -> result<_, error>

Places a document the script may write at offset from the camera or a bone, so it moves with the user. Per peer, like wired:scene/document.place, which detaches it again.

Source

/// The local user's body: where they look, where their limbs are, and
/// documents carried with them.
package wired:agent;

interface local {
  use wired:core/math.{transform};
  use wired:core/error.{error};
  use wired:scene/document.{document};

  /// The VRM 1.0 humanoid bone set.
  enum humanoid-bone {
    hips,
    spine,
    chest,
    upper-chest,
    neck,
    head,
    left-eye,
    right-eye,
    jaw,
    left-shoulder,
    left-upper-arm,
    left-lower-arm,
    left-hand,
    right-shoulder,
    right-upper-arm,
    right-lower-arm,
    right-hand,
    left-upper-leg,
    left-lower-leg,
    left-foot,
    left-toes,
    right-upper-leg,
    right-lower-leg,
    right-foot,
    right-toes,
    left-thumb-proximal,
    left-thumb-intermediate,
    left-thumb-distal,
    left-index-proximal,
    left-index-intermediate,
    left-index-distal,
    left-middle-proximal,
    left-middle-intermediate,
    left-middle-distal,
    left-ring-proximal,
    left-ring-intermediate,
    left-ring-distal,
    left-little-proximal,
    left-little-intermediate,
    left-little-distal,
    right-thumb-proximal,
    right-thumb-intermediate,
    right-thumb-distal,
    right-index-proximal,
    right-index-intermediate,
    right-index-distal,
    right-middle-proximal,
    right-middle-intermediate,
    right-middle-distal,
    right-ring-proximal,
    right-ring-intermediate,
    right-ring-distal,
    right-little-proximal,
    right-little-intermediate,
    right-little-distal,
  }

  variant attachment {
    camera,
    bone(humanoid-bone),
  }

  /// The camera's world transform this frame. Fails with `not-ready`
  /// until the user's body has loaded.
  camera-transform: func() -> result<transform, error>;

  /// A bone's world transform this frame, or `none` when the user's avatar
  /// lacks it. Fails with `not-ready` until the avatar has loaded.
  bone-transform: func(bone: humanoid-bone) -> result<option<transform>, error>;

  /// Places a document the script may write at `offset` from the camera or a
  /// bone, so it moves with the user. Per peer, like
  /// `wired:scene/document.place`, which detaches it again.
  attach: func(document: borrow<document>, to: attachment, offset: transform) -> result<_, error>;
}