Skip to content

Point Light

An omnidirectional light that radiates equally in all directions, with falloff over distance.

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

export default class SpawnTorch extends Behaviour {
  init() {
    const objects = this.world.getObjectManagementSystem();
    objects?.requestCreate("pointLight", {
      name: "Torch",
      transform: { position: { x: 0, y: 2, z: 0 } },
    });
  }
}

Payload

FieldTypeDefaultDescription
namestring"Point Light"Display name.
transform.position{ x, y, z }(2, 3, 2)Light position.
transform.rotation / scaleidentityStandard transform fields.
parentIdEntityId | nullnullOptional parent entity.

Default color #ffffff, intensity 1, distance 10.

Components attached

Transform, Object3DRef, Name, EntityType, ParentId, Selectable, Light.