Core Types

Defines

GLM_ENABLE_EXPERIMENTAL
namespace huira

Typedefs

template<int N, IsFloatingPoint T>
using Vec = glm::vec<N, T, glm::highp>
template<IsFloatingPoint T>
using Vec2 = Vec<2, T>
template<IsFloatingPoint T>
using Vec3 = Vec<3, T>
template<IsFloatingPoint T>
using Vec4 = Vec<4, T>
template<int Rows, int Cols, IsFloatingPoint T>
using Mat = glm::mat<Cols, Rows, T, glm::highp>
template<IsFloatingPoint T>
using Mat2 = Mat<2, 2, T>
template<IsFloatingPoint T>
using Mat3 = Mat<3, 3, T>
template<IsFloatingPoint T>
using Mat4 = Mat<4, 4, T>
template<IsFloatingPoint T>
using Quaternion = glm::qua<T, glm::highp>
template<IsFloatingPoint T>
using ShusterQuaternion = Vec4<T>
typedef Mat2<float> Mat2_f
typedef Mat2<double> Mat2_d
typedef Mat3<float> Mat3_f
typedef Mat3<double> Mat3_d
typedef Mat4<float> Mat4_f
typedef Mat4<double> Mat4_d
typedef Vec2<float> Vec2_f
typedef Vec2<double> Vec2_d
typedef Vec3<float> Vec3_f
typedef Vec3<double> Vec3_d
typedef Vec4<float> Vec4_f
typedef Vec4<double> Vec4_d
typedef Quaternion<float> Quaternion_f
typedef Quaternion<double> Quaternion_d
typedef ShusterQuaternion<float> ShusterQuaternion_f
typedef ShusterQuaternion<double> ShusterQuaternion_d
using Pixel = BasePixel<float>
using Pixel_d = BasePixel<double>
typedef std::vector<std::uint32_t> IndexBuffer
template<IsSpectral TSpectral>
using VertexBuffer = std::vector<Vertex<TSpectral>>
typedef std::vector<Tangent> TangentBuffer

Functions

template<int N, IsFloatingPoint T>
std::string vec_to_string(const glm::vec<N, T, glm::highp> &v)
template<int Rows, int Cols, IsFloatingPoint T>
std::string mat_to_string(const glm::mat<Cols, Rows, T, glm::highp> &m)
template<IsFloatingPoint T>
ShusterQuaternion<T> to_shuster(const Quaternion<T> &q)
template<IsFloatingPoint T>
Quaternion<T> to_hamilton(const ShusterQuaternion<T> &q)
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator*(const Vec2<TFloat> &v, const Resolution &res)
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator*(TFloat s, const Resolution &res)
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator/(const Vec2<TFloat> &v, const Resolution &res)
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator/(TFloat s, const Resolution &res)
template<IsFloatingPoint TFloat>
struct BasePixel

Public Functions

constexpr BasePixel() noexcept = default
inline constexpr BasePixel(TFloat x_val, TFloat y_val) noexcept
inline TFloat &operator[](std::size_t i) noexcept
inline const TFloat &operator[](std::size_t i) const noexcept
inline BasePixel operator+(const BasePixel &rhs) const noexcept
inline BasePixel operator-(const BasePixel &rhs) const noexcept
inline BasePixel operator*(TFloat s) const noexcept

Public Members

TFloat x = TFloat{0}
TFloat y = TFloat{0}

Friends

inline friend BasePixel operator*(TFloat s, const BasePixel &p) noexcept
struct Resolution

Public Functions

inline Resolution(int w, int h)
inline Resolution(const Resolution &other)
inline Resolution &operator=(const Resolution &other)
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator*(const Vec2<TFloat> &v) const
template<IsFloatingPoint TFloat>
inline Vec2<TFloat> operator*(TFloat s) const
template<IsFloatingPoint TFloat>
inline Vec2<float> operator/(const Vec2<TFloat> &v) const
template<IsFloatingPoint TFloat>
inline Vec2<float> operator/(TFloat s) const
inline bool operator==(const Resolution res) const

Public Members

int width = 0
int height = 0
int &x = width
int &y = height
struct Tangent

Public Members

Vec3<float> tangent = {0, 0, 0}
Vec3<float> bitangent = {0, 0, 0}
template<IsSpectral TSpectral>
struct Triangle

Public Members

std::array<Vertex<TSpectral>, 3> vertices
std::optional<std::array<Tangent, 3>> tangents
template<IsSpectral TSpectral>
struct Vertex

Public Functions

inline bool operator==(const Vertex &other) const

Public Members

Vec3<float> position = {}
TSpectral albedo = {1}
Vec3<float> normal = {0}
Vec2<float> uv = {0}