Euphoria
Namespaces | Classes | Typedefs | Functions | Variables
eu Namespace Reference

Namespaces

namespace  assertlib
 
namespace  color
 
namespace  convert
 
namespace  kk
 
namespace  log
 

Classes

struct  AA
 Axis + Angle. More...
 
struct  An
 An angle in both degrees and radians. More...
 
struct  Guid
 Represents a universally unique identifier. More...
 
struct  Hsh
 Hash of a non-owning string. More...
 
struct  HshO
 Hash of an owning string. More...
 
struct  m4
 4x4 matrix More...
 
struct  n2
 a 2d unit (vector) More...
 
struct  n3
 a 3d unit (vector) More...
 
struct  Q
 A quaternion representing a rotation in 3d. More...
 
struct  R
 A (inclusive) range between two values. More...
 
struct  v2
 a 2d vector More...
 
struct  v3
 a 3d vector More...
 
struct  v4
 A 4d vector. More...
 
struct  Ypr
 yaw + pitch + roll More...
 

Typedefs

using i8 = std::int8_t
 
using i16 = std::int16_t
 
using i32 = std::int32_t
 
using i64 = std::int64_t
 
using u8 = std::uint8_t
 
using u16 = std::uint16_t
 
using u32 = std::uint32_t
 
using u64 = std::uint64_t
 

Functions

float sin (const An &ang)
 
float cos (const An &ang)
 
float tan (const An &ang)
 
An asin (float v)
 
An acos (float v)
 
An atan (float v)
 
An atan2 (float y, float x)
 
An operator+ (const An &lhs, const An &rhs)
 
An operator- (const An &lhs, const An &rhs)
 
An operator* (const An &lhs, float rhs)
 
An operator/ (const An &lhs, float rhs)
 
An operator* (float rhs, const An &lhs)
 
std::string string_from (const An &a)
 
bool operator< (const An &lhs, const An &rhs)
 
bool operator<= (const An &lhs, const An &rhs)
 
bool operator> (const An &lhs, const An &rhs)
 
bool operator>= (const An &lhs, const An &rhs)
 
An lerp_angle (const An &from, float v, const An &to)
 
AA rha (const n3 &axis, const An &angle)
 
std::string string_from (const AA &aa)
 
std::string string_from (const Ypr &ypr)
 
bool operator== (const Guid &lhs, const Guid &rhs)
 
bool operator!= (const Guid &lhs, const Guid &rhs)
 
std::optional< Guidguid_from (const std::string &str)
 Parse a guid from a string.
 
std::string string_from (const Guid &g)
 Convert a guid to a string representation, prefer fmt.
 
constexpr u64 hash64 (const std::string_view str, u64 hash=0xcbf29ce484222325)
 fnv-1a hash.
 
 OP (==) OP(!
 
std::string string_from (const HshO &h)
 
std::string string_from (const m4 &m)
 Convert a matrix to a string representation, prefer fmt.
 
m4 operator+ (const m4 &lhs, const m4 &rhs)
 
m4 operator- (const m4 &lhs, const m4 &rhs)
 
m4 operator* (const m4 &lhs, const m4 &rhs)
 
v4 operator* (const m4 &lhs, const v4 &rhs)
 
constexpr float cabs (float r)
 
constexpr bool is_zero (float r, float epsilon=kk::epsilon)
 
constexpr bool is_equal (float lhs, float rhs, float epsilon=kk::epsilon)
 
int floor_to_int (float v)
 
int ceil_to_int (float v)
 
constexpr int get_sign (float r)
 Calculates the sign as a positive or a negative int.
 
constexpr float get_sign (bool b)
 Returns 1 if true or -1.
 
constexpr float lerp_float (float f, float scale, float t)
 
constexpr float square (float r)
 Return r * r
 
constexpr float min (float lhs, float rhs)
 
constexpr float max (float lhs, float rhs)
 
constexpr float clamp_zero (float value, float def=0.0f, float epsilon=kk::epsilon)
 If the value is close to zero, def is returned.
 
float dot (const Q &lhs, const Q &rhs)
 
std::string string_from (const Q &v)
 Converts a quaternion to string, prefer fmt.
 
Q operator* (const Q &lhs, const Q &rhs)
 
Q operator* (float scale, const Q &q)
 
Q operator* (const Q &q, float scale)
 
template<typename T >
R< Tmake_range (T min, T max)
 Create a range from min to max (inclusive)
 
template<typename T >
R< Tmake_range (T max)
 Create a range from zero (0) to max (inclusive)
 
float from_01f (float lower_bound, float upper_bound, float value)
 
template<typename T >
T from_01 (const R< T > &range, float value)
 Converts a value in 0-1 range to a custom range.
 
template<>
float from_01 (const R< float > &range, float value)
 
template<typename T >
float to01 (const R< T > &range, T value)
 Converts a value in a range to the 0-1 range.
 
template<typename T >
T get360_angular (const R< T > &range, float value)
 
template<typename T , typename F >
T remap_to (const R< F > &from, const R< T > &to, F value)
 Remaps a value from one range to another.
 
template<typename T >
bool is_within (const R< T > &range, T value)
 Returns true if a value is withing a range.
 
template<typename T >
T keep_within (const R< T > &range, T value)
 Returns a value that is kept within the range.
 
template<typename T >
T wrap (const R< T > &range, T value)
 Returns a value that wraps around the range.
 
v2 operator+ (const v2 &lhs, const v2 &rhs)
 
v2 operator- (const v2 &lhs, const v2 &rhs)
 
v2 operator* (const v2 &lhs, float rhs)
 
v2 operator* (float lhs, const v2 &rhs)
 
v2 operator* (const n2 &lhs, float rhs)
 
v2 operator* (float lhs, const n2 &rhs)
 
v2 operator/ (const v2 &lhs, float rhs)
 
float dot (const v2 &lhs, const v2 &rhs)
 
v2 lerp_vec2f (const v2 &from, float v, const v2 &to)
 
std::string string_from (const v2 &v)
 converts a 2d vector to a string, prefer fmt
 
std::string string_from (const n2 &v)
 converts a 2d unit vector to a string, prefer fmt
 
v3 operator+ (const v3 &lhs, const v3 &rhs)
 
v3 operator- (const v3 &lhs, const v3 &rhs)
 
v3 operator* (float lhs, const v3 &rhs)
 
v3 operator* (const v3 &lhs, float rhs)
 
v3 operator/ (const v3 &lhs, float rhs)
 
v3 operator/ (float lhs, const v3 &rhs)
 
v3 lerp_v3 (const v3 &f, float v, const v3 &t)
 
std::string string_from (const v3 &v)
 convert a 3d vector to string, prefer fmt
 
std::string string_from (const n3 &v)
 converts a 3d unit vector to string, prefer fmt
 
constexpr v3 min (const v3 &lhs, const v3 &rhs)
 component wise min value
 
constexpr v3 max (const v3 &lhs, const v3 &rhs)
 component wise max value
 
std::string string_from (const v4 &v)
 converts a 4d vector to a string, prefer fmt
 

Variables

constexpr An one_turn = An::from_radians(pi * 2.0f)
 
constexpr An half_turn = An::from_radians(pi)
 
constexpr An quarter_turn = An::from_radians(pi / 2.0f)
 
constexpr An no_rotation = An::from_radians(0.0f)
 
constexpr Guid nil_guid
 A nil guid, all bits are set to 0.
 
constexpr m4 m4_identity = m4::from_scalar(1)
 The identity matrix.
 
constexpr float pi = 3.1415926535897932384626433832795f
 
constexpr Q q_identity = Q(1, v3(0, 0, 0))
 The identity quaternion.
 
constexpr R< floatr01 = { 0.0f, 1.0f}
 A range going from 0 to 1.
 
constexpr R< floatr11 = { -1.0f, 1.0}
 
constexpr v2 zero2f = v2{ 0, 0 }
 
constexpr v3 zero3f = v3{0.0f, 0.0f, 0.0f}
 

Typedef Documentation

◆ i16

using eu::i16 = typedef std::int16_t

Definition at line 8 of file ints.h.

◆ i32

using eu::i32 = typedef std::int32_t

Definition at line 9 of file ints.h.

◆ i64

using eu::i64 = typedef std::int64_t

Definition at line 10 of file ints.h.

◆ i8

using eu::i8 = typedef std::int8_t

Definition at line 7 of file ints.h.

◆ u16

using eu::u16 = typedef std::uint16_t

Definition at line 13 of file ints.h.

◆ u32

using eu::u32 = typedef std::uint32_t

Definition at line 14 of file ints.h.

◆ u64

using eu::u64 = typedef std::uint64_t

Definition at line 15 of file ints.h.

◆ u8

using eu::u8 = typedef std::uint8_t

Definition at line 12 of file ints.h.

Function Documentation

◆ cabs()

constexpr float eu::cabs ( float  r)
constexpr

Definition at line 16 of file numeric.h.

◆ guid_from()

std::optional< Guid > eu::guid_from ( const std::string &  str)

Parse a guid from a string.

◆ hash64()

constexpr u64 eu::hash64 ( const std::string_view  str,
u64  hash = 0xcbf29ce484222325 
)
constexpr

◆ OP()

eu::OP ( )

◆ operator!=()

bool eu::operator!= ( const Guid lhs,
const Guid rhs 
)

◆ operator==()

bool eu::operator== ( const Guid lhs,
const Guid rhs 
)

◆ string_from() [1/2]

std::string eu::string_from ( const Guid g)

Convert a guid to a string representation, prefer fmt.

◆ string_from() [2/2]

std::string eu::string_from ( const HshO h)

Variable Documentation

◆ nil_guid

constexpr Guid eu::nil_guid
constexpr
Initial value:
= Guid
{
std::array<u8, 16>
{
0, 0, 0, 0,
0, 0,
0, 0,
0, 0,
0, 0, 0, 0, 0, 0
}
}

A nil guid, all bits are set to 0.

Definition at line 69 of file guid.h.

◆ pi

constexpr float eu::pi = 3.1415926535897932384626433832795f
constexpr

Definition at line 13 of file numeric.h.