Bitbybit Docs
    Preparing search index...

    Function initBabylonJS

    • Helper function to initialize a basic BabylonJS scene with lights, shadows, and optional ground plane. This provides a quick setup for common use cases while remaining fully customizable.

      Parameters

      • Optionalinputs: InitBabylonJSDto

        Configuration options for the scene

      Returns InitBabylonJSResult

      Object containing the scene, engine, lights, ground, and dispose function

      import { initBabylonJS, BabylonJSScene } from "@bitbybit-dev/babylonjs";

      // Basic usage with defaults
      const { scene, engine } = initBabylonJS();

      // Custom configuration
      const options = new BabylonJSScene.InitBabylonJSDto();
      options.sceneSize = 500;
      options.enableGround = true;
      options.enableShadows = true;
      const { scene, engine, directionalLight } = initBabylonJS(options);