ecspresso
    Preparing search index...

    Type Alias Renderer3DPluginOptions<G>

    Renderer3DPluginOptions:
        | Renderer3DPluginPreInitOptions<G>
        | Renderer3DPluginManagedOptions<G>

    Configuration options for the 3D renderer plugin.

    Supports two modes:

    1. Pre-initialized: Pass already-initialized renderer, scene, camera
    2. Managed: Omit them and the plugin creates everything during ecs.initialize()

    This plugin includes 3D transform propagation automatically.

    Type Parameters

    • G extends string = "renderer3d"
    const renderer = new WebGLRenderer({ antialias: true });
    const scene = new Scene();
    const camera = new PerspectiveCamera(75, w / h, 0.1, 1000);

    const ecs = ECSpresso.create()
    .withPlugin(createRenderer3DPlugin({ renderer, scene, camera }))
    .build();
    const ecs = ECSpresso.create()
    .withPlugin(createRenderer3DPlugin({
    container: '#game',
    background: 0x1099bb,
    antialias: true,
    cameraOptions: { fov: 75, position: { x: 0, y: 5, z: 10 } },
    }))
    .build();
    await ecs.initialize();