Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
All the core generic classes and functions. More...
Classes | |
class | gf::Array2D< T > |
A two-dimensional array. More... | |
class | gf::ArrayRef< T > |
A constant reference to an array and its size. More... | |
struct | gf::Circ< T > |
Utility class for manipulating circles. More... | |
class | gf::Clock |
Utility class that measures the elapsed time. More... | |
class | gf::Flags< E > |
Bitfield relying on an enumeration. More... | |
class | gf::InputStream |
Abstract class for custom file input streams. More... | |
class | gf::FileInputStream |
File based input stream. More... | |
class | gf::MemoryInputStream |
Memory based input stream. More... | |
class | gf::Library |
A class to represent the library. More... | |
struct | gf::Library::Version |
Information about version. More... | |
class | gf::Log |
Logging functions. More... | |
struct | gf::Matrix< T, ROWS, COLS > |
General purpose math matrix. More... | |
struct | gf::Matrix< T, 2, 2 > |
A 2x2 matrix. More... | |
struct | gf::Matrix< T, 3, 3 > |
A 3x3 matrix. More... | |
struct | gf::Matrix< T, 4, 4 > |
A 4x4 matrix. More... | |
class | gf::Noise2D |
2D A noise function More... | |
class | gf::Noise3D |
3D A noise function More... | |
class | gf::ValueNoise2D |
Value 2D noise. More... | |
class | gf::GradientNoise2D |
Gradient 2D noise. More... | |
class | gf::GradientNoise3D |
Gradient 3D noise. More... | |
class | gf::BetterGradientNoise2D |
Better gradient 2D noise. More... | |
class | gf::FractalNoise2D |
Fractal 2D noise. More... | |
class | gf::FractalNoise3D |
Fractal 3D noise. More... | |
class | gf::PerlinNoise2D |
Perlin 2D noise. More... | |
class | gf::PerlinNoise3D |
Perlin 3D noise. More... | |
class | gf::SimplexNoise2D |
Simplex 2D noise. More... | |
class | gf::OpenSimplexNoise2D |
OpenSimplex 2D noise. More... | |
class | gf::OpenSimplexNoise3D |
OpenSimplex3D noise. More... | |
class | gf::WaveletNoise3D |
Wavelet 3D noise. More... | |
class | gf::WorleyNoise2D |
Worley 2D noise. More... | |
class | gf::Multifractal2D |
Multi Fractal 2D noise. More... | |
class | gf::HeteroTerrain2D |
Hetero Terrain 2D noise. More... | |
class | gf::HybridMultifractal2D |
Hybrid Multifractal 2D noise. More... | |
class | gf::RidgedMultifractal2D |
Ridged Multifractal 2D noise. More... | |
class | gf::Queue< T > |
A simple concurrent queue. More... | |
class | gf::Random |
A random engine. More... | |
struct | gf::Range< T > |
A half-open range of values. More... | |
struct | gf::Range< T >::Iterator |
A range iterator. More... | |
struct | gf::Rect< T > |
Utility class for manipulating 2D axis aligned rectangles. More... | |
class | gf::Singleton< T > |
A singleton that wraps a pointer provided by a storage. More... | |
class | gf::SingletonStorage< T > |
A storage for a singleton. More... | |
class | gf::StringRef |
A constant reference to a string and its size. More... | |
class | gf::SystemInfo |
A class for system info. More... | |
class | gf::Time |
Represents a time value. More... | |
struct | gf::NoneType |
Semantic type to represent "none". More... | |
struct | gf::AllType |
Semantic type to represent "all". More... | |
struct | gf::Vector< T, N > |
General purpose math vector. More... | |
struct | gf::Vector< T, 2 > |
A 2D vector. More... | |
struct | gf::Vector< T, 3 > |
A 3D vector. More... | |
struct | gf::Vector< T, 4 > |
A 4D vector. More... | |
Typedefs | |
using | gf::CircF = Circ< float > |
A float circle. More... | |
using | gf::CircI = Circ< int > |
A int circle. More... | |
using | gf::CircU = Circ< unsigned > |
A unsigned circle. More... | |
using | gf::CircZ = Circ< std::size_t > |
A std::size_t circle. More... | |
using | gf::Path = boost::filesystem::path |
A path in the filesystem. More... | |
using | gf::Id = uint64_t |
An identifier. More... | |
template<typename T > | |
using | gf::Step = T(*)(T) |
A step is a function with special features. More... | |
using | gf::Matrix2f = Matrix< float, 2, 2 > |
A float square matrix of size 2. More... | |
using | gf::Matrix3f = Matrix< float, 3, 3 > |
A float square matrix of size 3. More... | |
using | gf::Matrix4f = Matrix< float, 4, 4 > |
A float square matrix of size 4. More... | |
using | gf::RangeF = Range< float > |
A float range. More... | |
using | gf::RangeI = Range< int > |
A int range. More... | |
using | gf::RangeU = Range< unsigned > |
A unsigned range. More... | |
using | gf::RangeZ = Range< std::size_t > |
A std::size_t range. More... | |
using | gf::RectF = Rect< float > |
A float rectangle. More... | |
using | gf::RectI = Rect< int > |
A int rectangle. More... | |
using | gf::RectU = Rect< unsigned > |
A unsigned rectangle. More... | |
using | gf::RectZ = Rect< std::size_t > |
A std::size_t rectangle. More... | |
using | gf::Vector2f = Vector< float, 2 > |
A float vector with 2 components. More... | |
using | gf::Vector3f = Vector< float, 3 > |
A float vector with 3 components. More... | |
using | gf::Vector4f = Vector< float, 4 > |
A float vector with 4 components. More... | |
using | gf::Vector2d = Vector< double, 2 > |
A double vector with 2 components. More... | |
using | gf::Vector3d = Vector< double, 3 > |
A double vector with 3 components. More... | |
using | gf::Vector4d = Vector< double, 4 > |
A double vector with 4 components. More... | |
using | gf::Vector2i = Vector< int, 2 > |
A int vector with 2 components. More... | |
using | gf::Vector3i = Vector< int, 3 > |
A int vector with 3 components. More... | |
using | gf::Vector4i = Vector< int, 4 > |
A int vector with 4 components. More... | |
using | gf::Vector2u = Vector< unsigned, 2 > |
A unsigned vector with 2 components. More... | |
using | gf::Vector3u = Vector< unsigned, 3 > |
A unsigned vector with 3 components. More... | |
using | gf::Vector4u = Vector< unsigned, 4 > |
A unsigned vector with 4 components. More... | |
using | gf::Vector2z = Vector< std::size_t, 2 > |
A std::size_t vector with 2 components. More... | |
using | gf::Vector3z = Vector< std::size_t, 3 > |
A std::size_t vector with 3 components. More... | |
using | gf::Vector4z = Vector< std::size_t, 4 > |
A std::size_t vector with 4 components. More... | |
using | gf::Vector2b = Vector< bool, 2 > |
A bool vector with 2 components. More... | |
using | gf::Vector3b = Vector< bool, 3 > |
A bool vector with 3 components. More... | |
using | gf::Vector4b = Vector< bool, 4 > |
A bool vector with 4 components. More... | |
using | gf::Color3f = Vector< float, 3 > |
A float color vector with 3 components. More... | |
using | gf::Color4f = Vector< float, 4 > |
A float color vector with 4 components. More... | |
using | gf::Color3u = Vector< uint8_t, 3 > |
A uint8_t color vector with 3 components. More... | |
using | gf::Color4u = Vector< uint8_t, 4 > |
A uint8_t color vector with 4 components. More... | |
template<typename T , std::size_t N> | |
using | gf::Distance = T(*)(const Vector< T, N > &, const Vector< T, N > &) |
A distance function. More... | |
template<typename T > | |
using | gf::Distance2 = Distance< T, 2 > |
A distance function for 2D vectors. More... | |
template<typename T > | |
using | gf::Distance3 = Distance< T, 3 > |
A distance function for 3D vectors. More... | |
Enumerations | |
enum | gf::Direction : int { gf::Direction::Center = -1, gf::Direction::Up = 0, gf::Direction::Right = 1, gf::Direction::Down = 2, gf::Direction::Left = 3 } |
Main four directions. More... | |
enum | gf::Log::Level : int { gf::Log::Debug, gf::Log::Info, gf::Log::Warn, gf::Log::Error, gf::Log::Fatal } |
The severity level of the log. More... | |
enum | gf::Log::Category : int { gf::Log::General, gf::Log::Graphics, gf::Log::Network, gf::Log::Physics, gf::Log::Resources } |
The category of the log. More... | |
enum | gf::Orientation : int { gf::Orientation::Center = -1, gf::Orientation::North = 0, gf::Orientation::NorthEast = 1, gf::Orientation::East = 2, gf::Orientation::SouthEast = 3, gf::Orientation::South = 4, gf::Orientation::SouthWest = 5, gf::Orientation::West = 6, gf::Orientation::NorthWest = 7 } |
Cardinal and ordinal orientation. More... | |
Functions | |
Vector2f | gf::unit (Direction direction) |
Get a unit vector from a direction. More... | |
Vector2i | gf::displacement (Direction direction) |
Get a vector from a direction. More... | |
float | gf::angle (Direction direction) |
Get an angle from a direction. More... | |
Direction | gf::opposite (Direction direction) |
Get the opposite direction. More... | |
Direction | gf::orthogonalCW (Direction direction) |
Get the orthogonal direction clockwise. More... | |
Direction | gf::orthogonalCCW (Direction direction) |
Get the orthogonal direction counter-clockwise. More... | |
Direction | gf::nextCW (Direction direction) |
Get the next direction clockwise. More... | |
Direction | gf::nextCCW (Direction direction) |
Get the next direction counter-clockwise. More... | |
constexpr Id | gf::hash (const char *str, std::size_t sz) |
Get an identifier from a string. More... | |
Id | gf::hash (const std::string &str) |
Get an idenfitier from a string. More... | |
template<typename T > | |
constexpr T | gf::linearStep (T t) |
Linear step. More... | |
template<typename T > | |
constexpr T | gf::cubicStep (T t) |
Cubic step (smoothstep) More... | |
template<typename T > | |
constexpr T | gf::quinticStep (T t) |
Quintic step (smootherstep) More... | |
template<typename T > | |
T | gf::cosineStep (T t) |
Cosine step. More... | |
template<typename T , typename U > | |
T | gf::lerp (T lhs, T rhs, U t) |
Linear interpolation function. More... | |
template<typename T > | |
constexpr T | gf::clamp (T val, T lo, T hi) |
Clamping function. More... | |
template<typename T > | |
constexpr T | gf::square (T val) |
Square function. More... | |
Vector2f | gf::unit (Orientation orientation) |
Get a unit vector from an orientation. More... | |
Vector2i | gf::displacement (Orientation orientation) |
Get a vector from an orientation. More... | |
float | gf::angle (Orientation orientation) |
Get an angle from a orientation. More... | |
Orientation | gf::opposite (Orientation orientation) |
Get the opposite orientation. More... | |
Orientation | gf::orthogonalCW (Orientation orientation) |
Get the orthogonal orientation clockwise. More... | |
Orientation | gf::orthogonalCCW (Orientation orientation) |
Get the orthogonal orientation counter-clockwise. More... | |
Orientation | gf::nextCW (Orientation orientation) |
Get the next orientation clockwise. More... | |
Orientation | gf::nextCCW (Orientation orientation) |
Get the next orientation counter-clockwise. More... | |
Vector2f | gf::transform (const Matrix3f &mat, Vector2f point) |
Apply an affine transformation to a 2D point. More... | |
RectF | gf::transform (const Matrix3f &mat, const RectF &rect) |
Apply an affine transformaton to a rectangle. More... | |
constexpr Matrix3f | gf::identityTransform () |
Identity transform. More... | |
Matrix3f | gf::translation (Vector2f offset) |
Get a translation matrix. More... | |
void | gf::translate (Matrix3f &mat, Vector2f offset) |
Combine the current transform with a translation. More... | |
Matrix3f | gf::rotation (float angle) |
Get a rotation matrix. More... | |
Matrix3f | gf::rotation (float angle, Vector2f center) |
Get a rotation matrix. More... | |
void | gf::rotate (Matrix3f &mat, float angle) |
Combine the current transform with a rotation. More... | |
void | gf::rotate (Matrix3f &mat, float angle, Vector2f center) |
Combine the current transform with a rotation. More... | |
Matrix3f | gf::scaling (Vector2f factor) |
Get a scaling matrix. More... | |
Matrix3f | gf::scaling (Vector2f factor, Vector2f center) |
Get a scaling matrix. More... | |
void | gf::scale (Matrix3f &mat, Vector2f factor) |
Combine the current transform with a scaling. More... | |
void | gf::scale (Matrix3f &mat, Vector2f factor, Vector2f center) |
Combine the current transform with a scaling. More... | |
Variables | |
constexpr Id | gf::InvalidId = 0 |
The invalid id (which is 0) More... | |
constexpr float | gf::Pi = 3.14159265358979323846f |
The \( \pi \) constant. More... | |
constexpr float | gf::Pi2 = Pi / 2 |
The \( \frac{\pi}{2} \) constant. More... | |
constexpr float | gf::Pi4 = Pi / 4 |
The \( \frac{\pi}{4} \) constant. More... | |
constexpr float | gf::Sqrt2 = 1.41421356237309504880f |
The \( \sqrt{2} \) constant. More... | |
constexpr float | gf::InvSqrt2 = 1 / Sqrt2 |
The \( \frac{1}{\sqrt{2}} \) constant. More... | |
constexpr NoneType | gf::None = { } |
Constant to represent "none". More... | |
constexpr AllType | gf::All = { } |
Constant to represent "all". More... | |
All the core generic classes and functions.
using gf::CircF = typedef Circ<float> |
A float
circle.
using gf::CircI = typedef Circ<int> |
A int
circle.
using gf::CircU = typedef Circ<unsigned> |
A unsigned
circle.
using gf::CircZ = typedef Circ<std::size_t> |
A std::size_t
circle.
using gf::Color3f = typedef Vector<float, 3> |
A float color vector with 3 components.
using gf::Color3u = typedef Vector<uint8_t, 3> |
A uint8_t color vector with 3 components.
using gf::Color4f = typedef Vector<float, 4> |
A float color vector with 4 components.
using gf::Color4u = typedef Vector<uint8_t, 4> |
A uint8_t color vector with 4 components.
using gf::Distance = typedef T (*)(const Vector<T, N>&, const Vector<T, N>&) |
A distance function.
A distance function is a function that gives the distance between two vectors.
using gf::Distance2 = typedef Distance<T, 2> |
A distance function for 2D vectors.
using gf::Distance3 = typedef Distance<T, 3> |
A distance function for 3D vectors.
using gf::Id = typedef uint64_t |
An identifier.
using gf::Matrix2f = typedef Matrix<float, 2, 2> |
A float square matrix of size 2.
using gf::Matrix3f = typedef Matrix<float, 3, 3> |
A float square matrix of size 3.
using gf::Matrix4f = typedef Matrix<float, 4, 4> |
A float square matrix of size 4.
using gf::Path = typedef boost::filesystem::path |
A path in the filesystem.
gf::Path is a simple typedef for boost::filesystem::path
. Boost.Filesystem will eventually be part of the C++17 standard. So, in the future, gf::Path will be a typedef for std::path
.
using gf::RangeF = typedef Range<float> |
A float range.
using gf::RangeI = typedef Range<int> |
A int range.
using gf::RangeU = typedef Range<unsigned> |
A unsigned range.
using gf::RangeZ = typedef Range<std::size_t> |
A std::size_t
range.
using gf::RectF = typedef Rect<float> |
A float
rectangle.
using gf::RectI = typedef Rect<int> |
A int
rectangle.
using gf::RectU = typedef Rect<unsigned> |
A unsigned
rectangle.
using gf::RectZ = typedef Rect<std::size_t> |
A std::size_t
rectangle.
using gf::Step = typedef T (*)(T) |
A step is a function with special features.
A step \( f \) is a (mathematical) function which has the following properties:
It can be used to smooth a linear interpolation.
using gf::Vector2b = typedef Vector<bool, 2> |
A bool vector with 2 components.
using gf::Vector2d = typedef Vector<double, 2> |
A double vector with 2 components.
using gf::Vector2f = typedef Vector<float, 2> |
A float vector with 2 components.
using gf::Vector2i = typedef Vector<int, 2> |
A int vector with 2 components.
using gf::Vector2u = typedef Vector<unsigned, 2> |
A unsigned vector with 2 components.
using gf::Vector2z = typedef Vector<std::size_t, 2> |
A std::size_t vector with 2 components.
using gf::Vector3b = typedef Vector<bool, 3> |
A bool vector with 3 components.
using gf::Vector3d = typedef Vector<double, 3> |
A double vector with 3 components.
using gf::Vector3f = typedef Vector<float, 3> |
A float vector with 3 components.
using gf::Vector3i = typedef Vector<int, 3> |
A int vector with 3 components.
using gf::Vector3u = typedef Vector<unsigned, 3> |
A unsigned vector with 3 components.
using gf::Vector3z = typedef Vector<std::size_t, 3> |
A std::size_t vector with 3 components.
using gf::Vector4b = typedef Vector<bool, 4> |
A bool vector with 4 components.
using gf::Vector4d = typedef Vector<double, 4> |
A double vector with 4 components.
using gf::Vector4f = typedef Vector<float, 4> |
A float vector with 4 components.
using gf::Vector4i = typedef Vector<int, 4> |
A int vector with 4 components.
using gf::Vector4u = typedef Vector<unsigned, 4> |
A unsigned vector with 4 components.
using gf::Vector4z = typedef Vector<std::size_t, 4> |
A std::size_t vector with 4 components.
enum gf::Log::Category : int |
|
strong |
Main four directions.
gf::Direction represents one of the four main directions. A special value is added to represent the center, it indicates no direction.
Enumerator | |
---|---|
Center |
The center, indicates no direction. |
Up |
The up direction. |
Right |
The right direction. |
Down |
The down direction. |
Left |
The left direction. |
enum gf::Log::Level : int |
|
strong |
Cardinal and ordinal orientation.
gf::Orientation represents one the four cardinal orientations and the four ordinal (or intercardinal) orientations. A special value is added to represent the center, it indicates no orientation.
float gf::angle | ( | Direction | direction | ) |
Get an angle from a direction.
Up is at angle 0 and angle grows clockwise.
direction | The direction |
float gf::angle | ( | Orientation | orientation | ) |
Get an angle from a orientation.
North is at angle 0 and angle grows clockwise.
orientation | The orientation |
constexpr T gf::clamp | ( | T | val, |
T | lo, | ||
T | hi | ||
) |
Clamping function.
This function takes a value and returns it if it is in a specified range. If not, the returned value is the nearest value in the range.
val | The value to clamp |
lo | The minimum accepted value |
hi | The maximum accepted value |
|
inline |
constexpr T gf::cubicStep | ( | T | t | ) |
Cubic step (smoothstep)
\[ f(t) = -2 * t^3 + 3 * t^2 \]
Compared to a step, it has the following properties:
This function is also known as smoothstep
Vector2i gf::displacement | ( | Direction | direction | ) |
Get a vector from a direction.
The vector has its coordinates at -1, 0 or 1 depending on the direction. It can be used to represent the displacement on a grid in the given direction.
direction | The direction |
Vector2i gf::displacement | ( | Orientation | orientation | ) |
Get a vector from an orientation.
The vector has its coordinates at -1, 0 or 1 depending on the orientation. It can be used to represent the displacement on a grid in the given orientation.
orientation | The orientation |
constexpr Id gf::hash | ( | const char * | str, |
std::size_t | sz | ||
) |
Get an identifier from a string.
The hash is a Fowler–Noll–Vo 1a hash. This function is mainly for internal use. You should instead use the user-defined literal _id
.
Example:
str | The string |
sz | The size of the string |
|
inline |
Get an idenfitier from a string.
The hash is a Fowler–Noll–Vo 1a hash. This function can be used for computing an id at runtime. For computing an id from a string at compile time, you should use the the user-defined literal _id
.
constexpr Matrix3f gf::identityTransform | ( | ) |
Identity transform.
|
inline |
Linear interpolation function.
This functions returns an interpolated value between two values lhs
and rhs
according to a parameter \( t \). When \( t = 0 \) then lhs
is returned, and when \( t = 1 \) then rhs
is returned.
lhs | The first value |
rhs | The second value |
t | The interpolation parameter, generally in the interval \( [0,1] \) |
constexpr T gf::linearStep | ( | T | t | ) |
Direction gf::nextCCW | ( | Direction | direction | ) |
Get the next direction counter-clockwise.
direction | The direction |
Orientation gf::nextCCW | ( | Orientation | orientation | ) |
Get the next orientation counter-clockwise.
orientation | The orientation |
Direction gf::nextCW | ( | Direction | direction | ) |
Get the next direction clockwise.
direction | The direction |
Orientation gf::nextCW | ( | Orientation | orientation | ) |
Get the next orientation clockwise.
orientation | The orientation |
Direction gf::opposite | ( | Direction | direction | ) |
Get the opposite direction.
direction | The direction |
Orientation gf::opposite | ( | Orientation | orientation | ) |
Get the opposite orientation.
orientation | The orientation |
Direction gf::orthogonalCCW | ( | Direction | direction | ) |
Get the orthogonal direction counter-clockwise.
direction | The direction |
Orientation gf::orthogonalCCW | ( | Orientation | orientation | ) |
Get the orthogonal orientation counter-clockwise.
orientation | The orientation |
Direction gf::orthogonalCW | ( | Direction | direction | ) |
Get the orthogonal direction clockwise.
direction | The direction |
Orientation gf::orthogonalCW | ( | Orientation | orientation | ) |
Get the orthogonal orientation clockwise.
orientation | The orientation |
constexpr T gf::quinticStep | ( | T | t | ) |
Quintic step (smootherstep)
\[ f(t) = 6 * t^5 - 15 * t^4 + 10 * t^3 \]
Compared to a step, it has the following properties:
This function is also known as smootherstep
void gf::rotate | ( | Matrix3f & | mat, |
float | angle | ||
) |
Combine the current transform with a rotation.
mat | The current transform |
angle | The angle of the rotation (in radians) |
void gf::rotate | ( | Matrix3f & | mat, |
float | angle, | ||
Vector2f | center | ||
) |
Combine the current transform with a rotation.
mat | The current transform |
angle | The angle of the rotation (in radians) |
center | The center of the rotation |
|
inline |
Get a rotation matrix.
angle | The angle of the rotation (in radians) |
angle
radians
|
inline |
Get a rotation matrix.
angle | The angle of the rotation (in radians) |
center | The center of the rotation |
angle
radians of origin center
void gf::scale | ( | Matrix3f & | mat, |
Vector2f | factor | ||
) |
Combine the current transform with a scaling.
mat | The current transform |
factor | The scaling factor |
void gf::scale | ( | Matrix3f & | mat, |
Vector2f | factor, | ||
Vector2f | center | ||
) |
Combine the current transform with a scaling.
mat | The current transform |
factor | The scaling factor |
center | The center of the scaling |
|
inline |
Get a scaling matrix.
factor | The scaling factor |
factor
|
inline |
Get a scaling matrix.
factor | The scaling factor |
center | The center of the scaling |
factor
of origin center
constexpr T gf::square | ( | T | val | ) |
Square function.
For a value \( x \), the square value is \( x^2 \).
val | A value |
|
inline |
Apply an affine transformation to a 2D point.
mat | The transformation matrix |
point | The point to transform |
RectF gf::transform | ( | const Matrix3f & | mat, |
const RectF & | rect | ||
) |
Apply an affine transformaton to a rectangle.
The resulting rectangle is axis-aligned
mat | The transformation matrix |
rect | The rectangle to transform |
void gf::translate | ( | Matrix3f & | mat, |
Vector2f | offset | ||
) |
Combine the current transform with a translation.
mat | The current transform |
offset | The offset of the translation |
|
inline |
Get a translation matrix.
offset | The offset of the translation |
offset
Vector2f gf::unit | ( | Direction | direction | ) |
Get a unit vector from a direction.
direction | The direction |
Vector2f gf::unit | ( | Orientation | orientation | ) |
Get a unit vector from an orientation.
orientation | The orientation |
constexpr AllType gf::All = { } |
Constant to represent "all".
constexpr Id gf::InvalidId = 0 |
The invalid id (which is 0)
constexpr float gf::InvSqrt2 = 1 / Sqrt2 |
The \( \frac{1}{\sqrt{2}} \) constant.
constexpr NoneType gf::None = { } |
Constant to represent "none".
constexpr float gf::Pi = 3.14159265358979323846f |
The \( \pi \) constant.
constexpr float gf::Pi2 = Pi / 2 |
The \( \frac{\pi}{2} \) constant.
constexpr float gf::Pi4 = Pi / 4 |
The \( \frac{\pi}{4} \) constant.
constexpr float gf::Sqrt2 = 1.41421356237309504880f |
The \( \sqrt{2} \) constant.