Unravel Engine C++ Reference
Loading...
Searching...
No Matches
math Namespace Reference

Namespaces

namespace  detail
 
namespace  volume_geometry_point
 
namespace  volume_plane
 

Classes

class  bbox
 Storage for box vector values and wraps up common functionality. More...
 
class  bsphere
 Provides storage for common representation of spherical bounding volume, and wraps up common functionality. More...
 
struct  color
 
class  frustum
 Storage for frustum planes / values and wraps up common functionality. More...
 
struct  plane
 Storage for infinite plane. More...
 
class  transform_t
 General purpose transformation class designed to maintain each component of the transformation separate (translation, rotation, scale and shear) whilst providing much of the same functionality provided by standard matrices. More...
 

Typedefs

using transform = transform_t<float>
 

Enumerations

enum class  volume_query { inside = 0 , outside , intersect }
 
enum class  plane_query { front = 0 , back , on , spanning }
 

Functions

bool is_negative_float (const float &A)
 
template<typename T >
square (const T &t)
 
bool compute_projected_sphere_shaft (float light_x, float light_z, float radius, const glm::mat4 &proj, const glm::vec3 &axis, float axis_sign, std::int32_t &in_out_min_x, std::int32_t &in_out_max_x)
 
std::uint32_t compute_projected_sphere_rect (std::int32_t &left, std::int32_t &right, std::int32_t &top, std::int32_t &bottom, const glm::vec3 &sphere_center, float radius, const glm::vec3 &view_origin, const glm::mat4 &view, const glm::mat4 &proj)
 
float halton (std::uint32_t Index, std::uint32_t Base)
 
std::uint32_t power_of_n_round_down (std::uint32_t val, std::uint32_t n)
 
template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER mat< 4, 4, T, Q > recompose_impl (vec< 3, T, Q > const &scale, qua< T, Q > const &orientation, vec< 3, T, Q > const &translation, vec< 3, T, Q > const &skew, vec< 4, T, Q > const &perspective)
 
template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER void glm_recompose (mat< 4, 4, T, Q > &model_matrix, vec< 3, T, Q > const &in_scale, qua< T, Q > const &in_orientation, vec< 3, T, Q > const &in_translation, vec< 3, T, Q > const &in_skew, vec< 4, T, Q > const &in_perspective)
 
template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER bool glm_decompose (mat< 4, 4, T, Q > const &ModelMatrix, vec< 3, T, Q > &Scale, qua< T, Q > &Orientation, vec< 3, T, Q > &Translation, vec< 3, T, Q > &Skew, vec< 4, T, Q > &Perspective)
 
auto operator* (float s, const plane &p) -> plane
 Scalar multiplication for a plane.
 
template<typename T , precision Q>
auto inverse (transform_t< T, Q > const &t) noexcept -> transform_t< T, Q >
 
template<typename T , precision Q>
auto transpose (transform_t< T, Q > const &t) noexcept -> transform_t< T, Q >
 
template<typename T >
TRANSFORM_INLINE auto to_string (const T &v) -> std::string
 

Typedef Documentation

◆ transform

using math::transform = transform_t<float>

Definition at line 1510 of file transform.hpp.

Enumeration Type Documentation

◆ plane_query

enum class math::plane_query
strong
Enumerator
front 
back 
on 
spanning 

Definition at line 19 of file math_types.h.

◆ volume_query

enum class math::volume_query
strong
Enumerator
inside 
outside 
intersect 

Definition at line 12 of file math_types.h.

Function Documentation

◆ compute_projected_sphere_rect()

std::uint32_t math::compute_projected_sphere_rect ( std::int32_t & left,
std::int32_t & right,
std::int32_t & top,
std::int32_t & bottom,
const glm::vec3 & sphere_center,
float radius,
const glm::vec3 & view_origin,
const glm::mat4 & view,
const glm::mat4 & proj )
inline

Definition at line 223 of file math.h.

◆ compute_projected_sphere_shaft()

bool math::compute_projected_sphere_shaft ( float light_x,
float light_z,
float radius,
const glm::mat4 & proj,
const glm::vec3 & axis,
float axis_sign,
std::int32_t & in_out_min_x,
std::int32_t & in_out_max_x )
inline

Compute the screen bounds of a point light along one axis. Based on http://www.gamasutra.com/features/20021011/lengyel_06.htm and http://sourceforge.net/mailarchive/message.php?msg_id=10501105

Definition at line 160 of file math.h.

◆ glm_decompose()

template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER bool math::glm_decompose ( mat< 4, 4, T, Q > const & ModelMatrix,
vec< 3, T, Q > & Scale,
qua< T, Q > & Orientation,
vec< 3, T, Q > & Translation,
vec< 3, T, Q > & Skew,
vec< 4, T, Q > & Perspective )

IMPORTANT!!! Do not return here. Instaed use the modified length_impl function to handle zero lenght scales

Definition at line 130 of file matrix_recompose.hpp.

◆ glm_recompose()

template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER void math::glm_recompose ( mat< 4, 4, T, Q > & model_matrix,
vec< 3, T, Q > const & in_scale,
qua< T, Q > const & in_orientation,
vec< 3, T, Q > const & in_translation,
vec< 3, T, Q > const & in_skew,
vec< 4, T, Q > const & in_perspective )

Definition at line 116 of file matrix_recompose.hpp.

◆ halton()

float math::halton ( std::uint32_t Index,
std::uint32_t Base )
inline

Definition at line 256 of file math.h.

◆ inverse()

template<typename T , precision Q>
auto math::inverse ( transform_t< T, Q > const & t) -> transform_t<T, Q>
noexcept

Definition at line 729 of file transform.hpp.

◆ is_negative_float()

bool math::is_negative_float ( const float & A)
inline

Compute the screen bounds of a point light along one axis. Based on http://www.gamasutra.com/features/20021011/lengyel_06.htm and http://sourceforge.net/mailarchive/message.php?msg_id=10501105

Definition at line 139 of file math.h.

◆ operator*()

auto math::operator* ( float s,
const plane & p ) -> plane
inline

Scalar multiplication for a plane.

Multiplies each component of the plane by a scalar value.

Parameters
sScalar value to multiply by.
pThe plane to be multiplied.
Returns
A new plane with each component multiplied by the scalar value.

Definition at line 255 of file plane.h.

◆ power_of_n_round_down()

std::uint32_t math::power_of_n_round_down ( std::uint32_t val,
std::uint32_t n )
inline

Definition at line 270 of file math.h.

◆ recompose_impl()

template<typename T , qualifier Q>
GLM_FUNC_QUALIFIER mat< 4, 4, T, Q > math::recompose_impl ( vec< 3, T, Q > const & scale,
qua< T, Q > const & orientation,
vec< 3, T, Q > const & translation,
vec< 3, T, Q > const & skew,
vec< 4, T, Q > const & perspective )

Definition at line 73 of file matrix_recompose.hpp.

◆ square()

template<typename T >
T math::square ( const T & t)
inline

Definition at line 150 of file math.h.

◆ to_string()

template<typename T >
TRANSFORM_INLINE auto math::to_string ( const T & v) -> std::string

Definition at line 1515 of file transform.hpp.

◆ transpose()

template<typename T , precision Q>
auto math::transpose ( transform_t< T, Q > const & t) -> transform_t<T, Q>
noexcept

Definition at line 736 of file transform.hpp.