Skip to content

Cylinder

A THREE.CylinderGeometry with radius 0.5, height 1, and 20 radial segments.

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

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

Payload

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

Components attached

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