Skip to content

Sphere

A radius 0.5 THREE.SphereGeometry (24 width × 24 height segments) with a default white MeshStandardMaterial.

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

export default class SpawnSphere extends Behaviour {
  init() {
    const objects = this.world.getObjectManagementSystem();
    objects?.requestCreate("sphere", {
      name: "Ball",
      transform: { position: { x: 0, y: 0.5, z: 0 } },
    });
  }
}

Payload

FieldTypeDefaultDescription
namestring"Sphere"Display name.
transformTransformDataidentityPosition / rotation (radians) / scale.
parentIdEntityId | nullnullOptional parent entity.

Components attached

Transform, Object3DRef, Name, EntityType, ParentId, Selectable, Mesh, Material, MeshGeometry.