Skip to content

Vector3Input

An XYZ number triple. The inspector renders three side-by-side number inputs labelled X, Y, and Z.

Runtime value: { x: number; y: number; z: number }

Vector3Input inspector control

Declaration

ts
import { Behaviour, type Vector3Input } from "@relu-interactives/spatial-ecs";

export default class Demo extends Behaviour {
  data = {
    spawnPoint: { x: 0, y: 1, z: 0 } as Vector3Input,
    force:      { x: 0, y: 0, z: 0 } as Vector3Input,
  };
}

Runtime usage

Read x, y, and z directly:

ts
import * as THREE from "three";

init() {
  const point = new THREE.Vector3(
    this.data.spawnPoint.x,
    this.data.spawnPoint.y,
    this.data.spawnPoint.z,
  );
}

Notes

  • Ideal for world-space positions, directions, or scale factors.
  • Values are plain numbers — no automatic unit conversion is applied.