Function createLightWithCameraEntity

  • Creates a special entity that combines both light and camera functionality. The camera component is automatically synchronized with the light component, meaning the camera will follow the light's position and orientation. This is useful for creating shadow-casting lights or spotlight effects.

    Returns ILightEntity & ICameraEntityMethods

    A combined light and camera entity with synchronized behavior

    const lightCameraEntity = createLightWithCameraEntity();
    // The camera will automatically sync to the light's transform
    lightCameraEntity.getLight().intensity = 2.0;
    lightCameraEntity.getCamera().fovy = Math.PI / 4;