Initializes the editor, states, loads sounds, and prepares the HUD.
Protected
engineThe Babylon.js engine instance.
Protected
inputHandles user input for the scene.
Protected
sceneThe Babylon.js scene instance.
Adds a new object at the position pointed by the mouse.
Optional
size: Vector3Optional
rotation: Vector3Protected
addInitializes Havok physics for the scene with high gravity and a fixed timestep. Should be called asynchronously.
Loads a level from a file or JSON string.
The level to load.
Deletes the selected object from the scene.
Enables the Babylon.js debug layer for scene inspection.
Returns the current Babylon.js scene.
Callback when the level is fully loaded.
Plays a sound for editor actions.
Name of the sound to play.
Renders the current scene.
Restarts the scene by disposing and recreating it.
Serializes the current scene and triggers a JSON download.
Enables multi-mode setup for the editor (prepares the cube for multiplayer).
Sets up the mouse click listener for object selection.
Main update loop for the editor.
Static
createStatic factory to create and initialize a new EditorScene.
EditorScene provides the in-game level editor for Nocturna.
Allows users to create, modify, and test custom levels in a 3D environment. Handles adding, selecting, moving, rotating, resizing, cloning, and deleting objects. Uses Babylon.js for rendering, picking, camera control, and asset management. Integrates a HUD for editor controls and mode display. Manages editor states (Addition, Move, Rotation, Resize, Selection) via a state machine. Plays sound feedback for editor actions (select, drop, delete, save, etc.). Supports serialization/export of the current level to a JSON file.
Implements: