galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Random.cpp
Go to the documentation of this file.
1
7
8#include "Random.hpp"
9
10namespace galaxy
11{
12 namespace math
13 {
14 ray::Vector2 random_vec2(const ray::Vector2& min, const ray::Vector2& max) noexcept
15 {
16 return {random<float>(min.x, max.x), random<float>(min.y, max.y)};
17 }
18
19 ray::Vector3 random_vec3(const ray::Vector3& min, const ray::Vector3& max) noexcept
20 {
21 return {random<float>(min.x, max.x), random<float>(min.y, max.y), random<float>(min.z, max.z)};
22 }
23
24 ray::Vector4 random_vec4(const ray::Vector4& min, const ray::Vector4& max) noexcept
25 {
26 return {random<float>(min.x, max.x), random<float>(min.y, max.y), random<float>(min.z, max.z), random<float>(min.w, max.w)};
27 }
28 } // namespace math
29} // namespace galaxy
ray::Vector2 random_vec2(const ray::Vector2 &min, const ray::Vector2 &max) noexcept
Generate a random vec2.
Definition Random.cpp:14
ray::Vector3 random_vec3(const ray::Vector3 &min, const ray::Vector3 &max) noexcept
Generate a random vec3.
Definition Random.cpp:19
ray::Vector4 random_vec4(const ray::Vector4 &min, const ray::Vector4 &max) noexcept
Generate a random vec4.
Definition Random.cpp:24
T random(const T min, const T max) noexcept
Generate a random number of type T.
Definition Random.hpp:42
Application.hpp galaxy.