vOOlkan
An object oriented approach to Vulkan
Vulkan::Physics::Universe Class Reference

A Universe is a container of Hitbox(es) and Field(s). More...

#include <Universe.h>

Public Member Functions

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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
fieldsVector containing all of the fields acting in this universe.
...hitboxesObjects which can interact among them and with the fields in the universe.

Member Function Documentation

◆ 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
elapsedSecondsSeconds 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: