#include <scene.hpp>
Definition at line 6 of file scene.hpp.
◆ Scene() [1/2]
Calls OnPhysicsStart and sets the scene name to ""
Definition at line 11 of file scene.hpp.
◆ Scene() [2/2]
| Scene::Scene |
( |
const std::string & | name | ) |
|
Calls OnPhysicsStart
- Parameters
-
Definition at line 19 of file scene.cpp.
◆ AddComponent()
Add a component to an entity
- Parameters
-
| uid | the entity uid |
| args | the component constructor arguments |
Definition at line 79 of file scene.hpp.
◆ AddEntity() [1/2]
Add an entity to the scene
- Returns
- the entity uid
Definition at line 42 of file scene.cpp.
◆ AddEntity() [2/2]
Add an entity to the scene. Used when deserializing a scene.
- Parameters
-
Definition at line 47 of file scene.cpp.
◆ DebugDraw()
| void Scene::DebugDraw |
( |
| ) |
|
◆ GetCamera()
◆ GetComponent() [1/10]
template<typename T >
| T * Scene::GetComponent |
( |
uint32_t | uid | ) |
|
Get a component from an entity
- Parameters
-
- Returns
- a pointer to the component or nullptr if the component does not exist
◆ GetComponent() [2/10]
◆ GetComponent() [3/10]
◆ GetComponent() [4/10]
◆ GetComponent() [5/10]
◆ GetComponent() [6/10]
◆ GetComponent() [7/10]
◆ GetComponent() [8/10]
◆ GetComponent() [9/10]
◆ GetComponent() [10/10]
◆ GetComponents() [1/9]
| std::vector< T > & Scene::GetComponents |
( |
| ) |
|
Get the components vector
- Returns
- a reference to the components vector
◆ GetComponents() [2/9]
◆ GetComponents() [3/9]
◆ GetComponents() [4/9]
◆ GetComponents() [5/9]
◆ GetComponents() [6/9]
◆ GetComponents() [7/9]
◆ GetComponents() [8/9]
◆ GetComponents() [9/9]
◆ GetEntities()
| std::vector< Entity > & Scene::GetEntities |
( |
| ) |
|
Get the entities vector
- Returns
- a reference to the entities vector
Definition at line 337 of file scene.cpp.
◆ GetEntity()
Get an entity from the scene
- Parameters
-
- Returns
- a pointer to the entity or nullptr if the entity does not exist
Definition at line 51 of file scene.cpp.
◆ GetName()
| std::string & Scene::GetName |
( |
| ) |
|
◆ GetPhysicsWorld()
| b2World * Scene::GetPhysicsWorld |
( |
| ) |
|
|
inline |
◆ MoveEntity()
Move the entity. The coordinates are expected in engine units (screen width = 10 units)
Definition at line 291 of file scene.cpp.
◆ OnPhysicsStart()
| void Scene::OnPhysicsStart |
( |
| ) |
|
Starts the physics simulation
Definition at line 307 of file scene.cpp.
◆ OnPhysicsStop()
| void Scene::OnPhysicsStop |
( |
| ) |
|
Stops the physics simulation
Definition at line 332 of file scene.cpp.
◆ OnPhysicsUpdate()
Update the physics simulation
- Parameters
-
Definition at line 311 of file scene.cpp.
◆ RemoveComponent() [1/10]
Remove a component from an entity
- Parameters
-
◆ RemoveComponent() [2/10]
◆ RemoveComponent() [3/10]
◆ RemoveComponent() [4/10]
◆ RemoveComponent() [5/10]
◆ RemoveComponent() [6/10]
◆ RemoveComponent() [7/10]
◆ RemoveComponent() [8/10]
◆ RemoveComponent() [9/10]
◆ RemoveComponent() [10/10]
◆ RemoveEntity()
Remove an entity from the scene
- Parameters
-
Definition at line 60 of file scene.cpp.
◆ Render()
◆ SetEntityPosition()
◆ SetGravity() [1/2]
Set the gravity for the scene (m/s^2). Should be called after OnPhysicsStart(). Default value is (0,-0.3). Adjust the gravity according to the scaling factor.
Definition at line 32 of file scene.cpp.
◆ SetGravity() [2/2]
Set the gravity for the scene (m/s^2). Should be called after OnPhysicsStart(). Default value is (0,-0.3). Adjust the gravity according to the scaling factor.
Definition at line 37 of file scene.cpp.
◆ SetScalingFactor()
| void Scene::SetScalingFactor |
( |
float | scaling_factor | ) |
|
Set the scaling factor for the scene. Default value is 0.5 (1 meter = 0.5 units)
Definition at line 28 of file scene.cpp.
◆ Update()
Update the scene
- Parameters
-
Definition at line 275 of file scene.cpp.
◆ Application
◆ SceneSerializer
The documentation for this class was generated from the following files: