|
CeresEngine 0.2.0
A game development framework
|
A resource that stores scene information. More...
#include <CeresEngine/Scene/Scene.hpp>
Public Member Functions | |
| ~Scene () noexcept override | |
| void | update (const double dt) |
| Runs a single simulation step on the world. | |
| const SceneSettings & | getSettings () const |
| void | setSettings (const SceneSettings &settings) |
| const RendererSceneSettings & | getRendererSettings () const |
| void | setRendererSettings (const RendererSceneSettings &rendererSettings) |
| template<CInvocable< RendererSceneSettings & > Func> | |
| decltype(auto) | updateRendererSettings (Func &&func) noexcept |
| SceneObject | create () |
Creates a new empty SceneObject. | |
| Vector< SceneObject > | create (UInt32 n) |
Creates n empty SceneObjects. | |
| template<typename E , typename... Args> | |
| E | create (Args &&... args) |
Creates a new SceneObject with type E. | |
| template<typename E , typename Block , typename... Args> | |
| E | createWith (Block &&block, Args &&... args) |
Creates a new SceneObject with type E. | |
| Camera | createCamera () |
| Creates a new camera on the scene. | |
| Light | createLight () |
| Creates a new light on the scene. | |
| Renderable | createRenderable () |
| Creates a new renderable on the scene. | |
| Generator< SceneObject > | enumerateChildren () const |
| Enumerates all children scene objects. | |
| Entity | copyObjects (Scene &otherScene, const Entity &parent=nullptr) |
| Copies the objects from another scene. | |
| World & | getWorld () noexcept |
| The Entity-Component system world. | |
| const World & | getWorld () const noexcept |
| The Entity-Component system world. | |
Public Member Functions inherited from CeresEngine::TResource< Scene > | |
| ResourceHandle< Scene > | getResourceHandle () const noexcept |
| Generates a hash for the provided type. | |
| SPtr< Scene > | getShared () noexcept |
| Gets a shared pointer to the resource. | |
| SPtr< const Scene > | getShared () const noexcept |
| Gets a shared pointer to the resource. | |
| const ResourceTypeInfo & | getResourceType () const noexcept override |
| Returns the resource type information descriptor. | |
| TResource (ResourceData &data, InputStream &dataStream) | |
| void | serialize (OutputStream &dataStream) const override |
Serializes a resource by writing data to dataStream. | |
Public Member Functions inherited from CeresEngine::Resource | |
| Resource () | |
Default constructor for the Resource class. | |
| Resource (ResourceData &data) | |
Creates a new Resource instance by passing a ResourceData instance. | |
| virtual | ~Resource () noexcept=default |
Resource virtual destructor. | |
| ResourceManager * | getResourceManager () const noexcept |
| HResource | getResourceHandle () const noexcept |
| Generates a hash for the provided type. | |
| UUID | getResourceID () const noexcept |
| HResource | getParentResource () const noexcept |
| A parent resource to which this resource is attached to. | |
| SPtr< ResourceMetadata > | getResourceMetadata () const noexcept |
| A pointer to the user-defined resource metadata. | |
| const PackagePtr & | getPackage () const noexcept |
| The package from which the resource was loaded from. | |
| template<typename T = Resource> | |
| SPtr< T > | getShared () noexcept |
| Gets a shared pointer to the resource. | |
| template<typename T = Resource> | |
| SPtr< const T > | getShared () const noexcept |
| Gets a shared pointer to the resource. | |
| Resource (ResourceData &data, InputStream &dataStream) | |
Creates a new resource by reading data from dataStream. | |
Public Member Functions inherited from CeresEngine::IReflectable | |
| virtual | ~IReflectable () noexcept=default |
Static Public Member Functions | |
| static Scene * | find (const SceneObject &sceneObject) |
| Finds the scene that a scene object is attached to. | |
| template<typename Processor > | |
| static constexpr void | reflect (Processor &&RTTI) |
| Executes the given processor for every field of the struct. | |
Static Public Member Functions inherited from CeresEngine::Resource | |
| template<typename Processor > | |
| static constexpr void | reflect (Processor &&RTTI) |
| Executes the given processor for every field of the struct. | |
Private Types | |
| using | super = TResource< Scene > |
Private Attributes | |
| SceneManager * | mSceneManager = nullptr |
| The scene manager this scene is registered to, if registered. | |
| World | mWorld {*this} |
| The Entity-Component system world. | |
| SceneSettings | mSettings |
| A structure that contains settings for the scene. | |
| RendererSceneSettings | mRendererSettings |
| A set of settings that should be used by renderer when rendering the scene. | |
Friends | |
| class | SceneManager |
| class | TUserTypeInfo< Scene > |
Additional Inherited Members | |
Protected Member Functions inherited from CeresEngine::Resource | |
| HResourceStream | createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default) |
| Creates a new resource stream. | |
| void | destroyStream (HResourceStream &stream) |
| Destroys a stream. | |
| void | markAsDirty () |
| Marks the resource as dirty. | |
A resource that stores scene information.
The scene simulation is backed by an ECS world and can be simulated using systems.
|
private |
|
overridenoexcept |
Copies the objects from another scene.
| otherScene | The scene to copy objects from. |
| parent | The entity to parent the copied scene objects to. |
| SceneObject CeresEngine::Scene::create | ( | ) |
Creates a new empty SceneObject.
Creates a new SceneObject with type E.
All components defined in the SceneObject of type E are default-initialized. After default initializing all components, the constructor of E is called by forwarding args to it.
| E | The SceneObject type |
| Args | The scene object E constructor argument types |
| args | The scene object E constructor arguments |
E object handle. | Vector< SceneObject > CeresEngine::Scene::create | ( | UInt32 | n | ) |
Creates n empty SceneObjects.
| n | The number of SceneObject to be created. |
SceneObjects. | Camera CeresEngine::Scene::createCamera | ( | ) |
Creates a new camera on the scene.
This is equivalent to calling create<Camera>().
| Light CeresEngine::Scene::createLight | ( | ) |
Creates a new light on the scene.
This is equivalent to calling create<Light>().
| Renderable CeresEngine::Scene::createRenderable | ( | ) |
Creates a new renderable on the scene.
This is equivalent to calling create<Renderable>().
Creates a new SceneObject with type E.
All components defined in the SceneObject of type E are default-initialized. After default initializing all components, the constructor of E is called by forwarding args to it. After creation and default component initialization, block is called with the newly created scene object.
| E | The SceneObject type |
| Block | A functor type that takes E as an argument and allows to perform post-initialization operations on the newly created scene object. |
| Args | The scene object E constructor argument types |
| args | The scene object E constructor arguments |
| block | A functor object that takes E as an argument and allows to perform post-initialization operations on the newly created scene object. |
E object handle. | Generator< SceneObject > CeresEngine::Scene::enumerateChildren | ( | ) | const |
Enumerates all children scene objects.
|
static |
Finds the scene that a scene object is attached to.
| sceneObject | The scene object to locate the parent scene for. |
gameObject or nullptr if it is not attached to any scene.
|
inline |
|
inline |
The Entity-Component system world.
Owns all entities in the scene as well as manages the simulation of the scene.
|
inlinenoexcept |
The Entity-Component system world.
Owns all entities in the scene as well as manages the simulation of the scene.
Executes the given processor for every field of the struct.
| RTTI | The processor to be ran for every field. |
| void CeresEngine::Scene::setRendererSettings | ( | const RendererSceneSettings & | rendererSettings | ) |
| void CeresEngine::Scene::setSettings | ( | const SceneSettings & | settings | ) |
Runs a single simulation step on the world.
| dt | The time step since the last call to update. |
|
inlinenoexcept |
|
friend |
|
friend |
|
private |
A set of settings that should be used by renderer when rendering the scene.
|
private |
The scene manager this scene is registered to, if registered.
|
private |
A structure that contains settings for the scene.
The Entity-Component system world.
Owns all entities in the scene as well as manages the simulation of the scene.