A Universe is a container of Hitbox(es) and Field(s).
More...
#include <Universe.h>
|
template<typename... Hitboxes>
requires (std::derived_from<Hitboxes, Hitbox> && ...) |
| Universe (std::vector< Field * > fields, Hitboxes &... hitboxes) |
| Builds an isolated Universe. More...
|
|
void | calculate (float elapsedSeconds) |
| Calculates the new position of all the objects in the universe, their interaction with the other objects and the fields. More...
|
|
void | addBody (Hitbox &body) |
|
void | removeBody (Hitbox &body) |
|
A Universe is a container of Hitbox(es) and Field(s).
The objects inside a universe can interact between them, by following basic dynamics laws.
◆ Universe()
template<typename... Hitboxes>
requires (std::derived_from<Hitboxes,
Hitbox> && ...)
Vulkan::Physics::Universe::Universe |
( |
std::vector< Field * > |
fields, |
|
|
Hitboxes &... |
hitboxes |
|
) |
| |
|
inline |
Builds an isolated Universe.
- Parameters
-
fields | Vector containing all of the fields acting in this universe. |
...hitboxes | Objects which can interact among them and with the fields in the universe. |
◆ addBody()
void Vulkan::Physics::Universe::addBody |
( |
Hitbox & |
body | ) |
|
|
inline |
◆ calculate()
void Vulkan::Physics::Universe::calculate |
( |
float |
elapsedSeconds | ) |
|
|
inline |
Calculates the new position of all the objects in the universe, their interaction with the other objects and the fields.
- Parameters
-
elapsedSeconds | Seconds elapsed from last calculation. 2 sequences of calls to calculate with the same elapsedSeconds is deterministic, but 2 sequences with different elapsedSeconds is not. |
◆ removeBody()
void Vulkan::Physics::Universe::removeBody |
( |
Hitbox & |
body | ) |
|
|
inline |
The documentation for this class was generated from the following file: