To load scenes using TypeScript, Babylon.js provides you with a class named BABYLON.SceneLoader
. This class contains static methods that allow you to load scenes (create new ones), append scenes, and load meshes.
Basically, as a developer, you'll load files using these methods. The .Load
method creates a new scene for you and loads everything (meshes, lights, particle systems, camera, and so on), returning the new scene. The.Append
method takes an existing scene as a parameter and appends a new scene to the existing one (useful to mix multiple scenes). Finally, the.ImportMesh
method imports only meshes, skeletons (refer to Chapter 9, Create and Play Animations about animations), and particle systems to an existing scene. The following steps will show you how to use these methods and find the right way to manage your scenes.