Module src.scene

Scene module for loading, updating, and rendering the toroidal harmony visualization.

Manages model loading, materials, lighting, the note system, input handling, and debug overlay.

Functions

load (dream, commandMenu) Initialize and load the entire scene.
update (dt) Per-frame update.
updateLabels () Update label positions and colors based on current note system.
draw (dream) Draw the entire scene.
pressedAction (action) Handle input actions for scene controls.
apply () Draw debug overlay with stats when showDebug is true.

Tables

scene Main scene table.


Functions

load (dream, commandMenu)
Initialize and load the entire scene. Sets up lights, sky, exposure, loads geometry, creates instances, initializes the note system, and applies default materials.

Parameters:

  • dream table
        Dream framework instance
    
  • commandMenu table Command‐menu class (for UI controls)

Returns:

    nil
update (dt)
Per-frame update. Advances day/night cycle (when menu closed), polls the note system, and reassigns labels/materials if notes changed.

Parameters:

  • dt number Delta time in seconds since last frame

Returns:

    nil
updateLabels ()
Update label positions and colors based on current note system. Populates scene.labels_to_Draw with name, color, position, and active state.

Returns:

    nil
draw (dream)
Draw the entire scene. Renders sky, lights, joints, edges, curves, surfaces, and labels.

Parameters:

  • dream table Dream framework instance

Returns:

    nil
pressedAction (action)
Handle input actions for scene controls. Supports rotation, toggles, and note‐mode switching.

Parameters:

Returns:

    boolean True if the action was handled
apply ()
Draw debug overlay with stats when showDebug is true.

Returns:

    nil

Tables

scene
Main scene table.

Fields:

  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • table
    labels_to_Draw   Frame‐specific label definitions
    
  • boolean showTorusLights
  • boolean showTorusLights
  • boolean showTorusLights
  • boolean showTorusLights
  • boolean showTorusLights
  • boolean showTorusLights
  • boolean showTorusLights
  • number dayTime Current time of day in hours
generated by LDoc 1.5.0 Last updated 2025-09-04 12:20:37