![]() |
Lysa
0.0
Lysa 3D Engine
|
Represents a 3D scene containing lights and mesh instances.
The Scene class manages the high-level representation of a scene, including its environment, lights, and mesh instances.
Inheritance diagram for Scene:Public Member Functions | |
| Scene (const SceneConfiguration &config={}) | |
| ~Scene () override | |
| void | setEnvironment (const Environment &environment) const |
| bool | haveInstance (const MeshInstance &meshInstance) const |
| void | addInstance (MeshInstance &meshInstance, bool async=false) |
| void | updateInstance (MeshInstance &meshInstance) const |
| void | removeInstance (const MeshInstance &meshInstance) |
| void | updateMaterialPipeline (const MeshInstance &meshInstance) |
| void | addLight (const Light &light) const |
| void | removeLight (const Light &light) const |
| void | processDeferredOperations (uint32 frameIndex) |
| SceneFrameData & | get (const uint32 frameIndex) const |
| std::optional< RayCastHit > | rayCast (const Ray &ray, const MeshInstance *parent=nullptr) const |
| std::set< RayCastHit > | rayCastAll (const Ray &ray, const MeshInstance *parent=nullptr) const |
Public Member Functions inherited from UniqueResource | |
| UniqueResource () = default | |
| UniqueResource (UniqueResource &) = delete | |
| UniqueResource & | operator= (UniqueResource &) = delete |
Public Member Functions inherited from UnmanagedResource | |
| UnmanagedResource () | |
| UnmanagedResource (const Resource &other) | |
Public Member Functions inherited from Resource | |
| bool | operator== (const Resource &other) const |
| Resource () = default | |
| Resource (const unique_id id) | |
| virtual | ~Resource () = default |
Protected Attributes | |
| ImageManager & | imageManager |
| MaterialManager & | materialManager |
| MeshManager & | meshManager |
Additional Inherited Members | |
Public Attributes inherited from Resource | |
| unique_id | id {INVALID_ID} |
| Scene | ( | const SceneConfiguration & | config = {} | ) |
|
override |
Virtual destructor for Scene.
| void addInstance | ( | MeshInstance & | meshInstance, |
| bool | async = false |
||
| ) |
Adds a mesh instance to the scene.
| meshInstance | The mesh instance to add. |
| async | Whether to add the instance asynchronously. |
| void addLight | ( | const Light & | light | ) | const |
Adds a light to the scene.
| light | The light to add. |
|
inline |
Gets the frame-specific data for a given frame index.
| frameIndex | The index of the frame. |
| bool haveInstance | ( | const MeshInstance & | meshInstance | ) | const |
Checks if a mesh instance is present in the scene.
| meshInstance | The mesh instance to check. |
| void processDeferredOperations | ( | uint32 | frameIndex | ) |
Processes deferred scene operations for a specific frame.
| frameIndex | The index of the frame to process. |
| std::optional<RayCastHit> rayCast | ( | const Ray & | ray, |
| const MeshInstance * | parent = nullptr |
||
| ) | const |
Casts a ray (without using the physics engine) through all MeshInstances in the scene and returns the closest hit. The size of direction defines the max distance.
| ray | World-space ray origin and world-space ray direction (un-normalized; length = max distance) |
| parent | Optional mesh to ignore |
| std::set<RayCastHit> rayCastAll | ( | const Ray & | ray, |
| const MeshInstance * | parent = nullptr |
||
| ) | const |
Casts a ray through the entire scene and collects the closest hit per MeshInstance along its length.
| ray | World-space ray origin and world-space ray direction (un-normalized; length = max distance) |
| parent | Optional mesh to ignore |
| void removeInstance | ( | const MeshInstance & | meshInstance | ) |
Removes a mesh instance from the scene.
| meshInstance | The mesh instance to remove. |
| void removeLight | ( | const Light & | light | ) | const |
Removes a light from the scene.
| light | The light to remove. |
| void setEnvironment | ( | const Environment & | environment | ) | const |
Sets the environment for the scene.
| environment | The environment settings to apply. |
| void updateInstance | ( | MeshInstance & | meshInstance | ) | const |
Updates an existing mesh instance.
| meshInstance | The mesh instance to update. |
| void updateMaterialPipeline | ( | const MeshInstance & | meshInstance | ) |
Moves a mesh instance from a pipeline to another
| meshInstance | The mesh instance to move. |
|
protected |
Reference to the image manager.
|
protected |
Reference to the material manager.
|
protected |
Reference to the mesh manager.