Scene
Scene ⟵ Object3D
Container for all objects, lights, and cameras in the 3D world.
This class inherits from Object3D and
serves as the root container for everything that gets rendered. Scenes
manage the rendering hierarchy, background settings, and environment
properties. Since Scene inherits from Object3D, it has all the same transformation
and hierarchy capabilities, plus scene-specific functionality. Scenes
are essential for:
- Organizing the 3D world hierarchy
- Setting background and environment properties
- Managing fog and lighting effects
- Providing the root context for rendering
Methods
Scene()
Default constructor - creates an empty scene
Scene(const string& name)
Constructor with custom name
| name | Human-readable name for the scene |
Scene* clone(bool recursive = true) const override
Creates a copy of this scene
| recursive | Whether to clone all child objects as well |
void copy(const Object3D& object, bool recursive = true) override
Copies properties from another object
| object | Source object to copy from | |
| recursive | Whether to copy all child objects as well |
void render(Camera* camera = nullptr)
Renders the entire scene
| camera | Camera to render with (optional) |
void update()
Updates all objects in the scene
void setBackgroundColor(const Color& color)
Updates GX_SetCopyClear with current background color
| color | rgba color to apply to background |
void assignLightSlots()
Automatically assigns light slots (0-7) to all lights in the scene
Properties
| background | void* | Background color/texture (null = no background) |
| backgroundColor | Color | Background clear color (RGBA) |
| backgroundIntensity | f32 | Background intensity (0.0 to 1.0) |
| backgroundRotation | Vector3 | Background rotation in radians |
| environment | void* | Environment map texture |
| environmentIntensity | f32 | Environment intensity (0.0 to 1.0) |
| environmentRotation | Vector3 | Environment rotation in radians |
| fog | void* | Fog effect (null = no fog) |
| isScene | bool | Read-only flag to check if object is Scene |
| overrideMaterial | void* | Material to override all objects (null = no override) |