units Namespace
Definition
Enumerations Index
| enum class | Unit { ... } |
|
Enumeration of length and time units supported by helios. More... | |
Functions Index
| constexpr float | fromCm (const float cm) noexcept |
|
Converts centimeters to meters. More... | |
| constexpr float | fromM (const float m) noexcept |
|
Pass-through helper for meter values. More... | |
| constexpr helios::math::vec3f | fromM (helios::math::vec3f v) noexcept |
|
Pass-through helper for meter vectors. More... | |
| constexpr helios::math::aabbf | fromM (helios::math::aabbf v) noexcept |
|
Pass-through helper for meter AABBs. More... | |
| constexpr float | fromS (const float s) noexcept |
|
Converts seconds to seconds (identity helper). More... | |
| constexpr float | fromMs (const float ms) noexcept |
|
Converts milliseconds to seconds. More... | |
| constexpr float | from (const float v, const Unit unit) noexcept |
|
Converts a value from a given unit to helios units. More... | |
| constexpr helios::math::aabbf | from (helios::math::aabbf aabb, const Unit unit) noexcept |
|
Converts an AABB from a given unit to helios units. More... | |
Variables Index
| constexpr auto | HELIOS_SPATIAL_UNIT = Unit::Meter |
|
Default length unit used throughout helios (1 meter per helios unit). More... | |
| constexpr auto | HELIOS_TEMPORAL_UNIT = Unit::Seconds |
|
Default time unit used for all timing APIs (seconds). More... | |
| constexpr float | CENTIMETERS = 0.01f |
|
Ratio of centimeters to meters. More... | |
| constexpr float | METERS = 1.0f |
|
Ratio of meters to meters (identity). More... | |
| constexpr float | MILLISECONDS = 0.001f |
|
Ratio of milliseconds to seconds. More... | |
| constexpr float | SECONDS = 1.0f |
|
Ratio of seconds to seconds (identity). More... | |
Enumerations
Unit
| strong |
Enumeration of length and time units supported by helios.
- Enumeration values
Definition at line 18 of file Unit.ixx.
Functions
from()
| nodiscard constexpr noexcept |
Converts a value from a given unit to helios units.
This method takes a value in the specified unit and converts it to helios units, e.g. spatial units to METER, temporal values to SECONDS.
- Parameters
-
v Value to convert.
unit Unit of the value to convert.
- Returns
Value expressed in temporal or spatial helios units.
Definition at line 155 of file Unit.ixx.
References Centimeter, fromCm, fromM, fromMs, fromS, Meter, MilliSeconds and Seconds.
Referenced by helios::engine::runtime::world::Level::setBounds and helios::engine::modules::spatial::transform::systems::ScaleSystem::update.
from()
| nodiscard constexpr noexcept |
Converts an AABB from a given unit to helios units.
- Parameters
-
aabb AABB to convert.
unit Unit of the AABB coordinates.
- Returns
AABB expressed in helios spatial units (meters).
Definition at line 178 of file Unit.ixx.
fromCm()
| constexpr noexcept |
Converts centimeters to meters.
- Parameters
-
cm Value expressed in centimeters.
- Returns
Converted value expressed in meters.
Definition at line 82 of file Unit.ixx.
Reference CENTIMETERS.
Referenced by from.
fromM()
| constexpr noexcept |
fromM()
| constexpr noexcept |
Pass-through helper for meter vectors.
- Parameters
-
v Vector with components expressed in meters.
- Returns
Vector with components expressed in meters.
Definition at line 104 of file Unit.ixx.
Reference METERS.
fromM()
| constexpr noexcept |
Pass-through helper for meter AABBs.
- Parameters
-
v AABB with bounds expressed in meters.
- Returns
AABB with bounds expressed in meters.
Definition at line 115 of file Unit.ixx.
Reference METERS.
fromMs()
| constexpr noexcept |
Converts milliseconds to seconds.
- Parameters
-
ms Value expressed in milliseconds.
- Returns
Converted value expressed in seconds.
Definition at line 140 of file Unit.ixx.
Reference MILLISECONDS.
Referenced by from.
fromS()
| constexpr noexcept |
Variables
CENTIMETERS
| constexpr |
Ratio of centimeters to meters.
Definition at line 58 of file Unit.ixx.
Referenced by fromCm.
HELIOS_SPATIAL_UNIT
| constexpr |
Default length unit used throughout helios (1 meter per helios unit).
Definition at line 48 of file Unit.ixx.
HELIOS_TEMPORAL_UNIT
| constexpr |
Default time unit used for all timing APIs (seconds).
Definition at line 53 of file Unit.ixx.
METERS
| constexpr |
MILLISECONDS
| constexpr |
Ratio of milliseconds to seconds.
Definition at line 68 of file Unit.ixx.
Referenced by fromMs.
SECONDS
The documentation for this namespace was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.