Diligent Engine  v.2.4.g
Classes | Namespaces | Typedefs | Functions
BasicMath.hpp File Reference
#include <cmath>
#include <algorithm>
#include <iostream>
#include "HashUtils.hpp"

Go to the source code of this file.

Classes

struct  Diligent::Matrix2x2< T >
 
struct  Diligent::Matrix3x3< T >
 
struct  Diligent::Matrix4x4< T >
 
struct  Diligent::Vector4< T >
 
struct  Diligent::Vector2< T >
 
struct  Diligent::Vector3< T >
 
struct  Diligent::Vector4< T >
 
struct  Diligent::Matrix2x2< T >
 
struct  Diligent::Matrix3x3< T >
 
struct  Diligent::Matrix4x4< T >
 
struct  Diligent::Quaternion
 
struct  Diligent::_FastFloatIntermediateType< T >
 
struct  Diligent::_FastFloatIntermediateType< float >
 
struct  Diligent::_FastFloatIntermediateType< double >
 
struct  std::hash< Diligent::Vector2< T > >
 
struct  std::hash< Diligent::Vector3< T > >
 
struct  std::hash< Diligent::Vector4< T > >
 
struct  std::hash< Diligent::Matrix2x2< T > >
 
struct  std::hash< Diligent::Matrix3x3< T > >
 
struct  std::hash< Diligent::Matrix4x4< T > >
 

Namespaces

 Diligent
 The library uses Direct3D-style math:
 
 std
 

Typedefs

using Diligent::uint = uint32_t
 
using Diligent::uint2 = Vector2< uint >
 
using Diligent::uint3 = Vector3< uint >
 
using Diligent::uint4 = Vector4< uint >
 
using Diligent::int2 = Vector2< int32_t >
 
using Diligent::int3 = Vector3< int32_t >
 
using Diligent::int4 = Vector4< int32_t >
 
using Diligent::float2 = Vector2< float >
 
using Diligent::float3 = Vector3< float >
 
using Diligent::float4 = Vector4< float >
 
using Diligent::double2 = Vector2< double >
 
using Diligent::double3 = Vector3< double >
 
using Diligent::double4 = Vector4< double >
 
using Diligent::float4x4 = Matrix4x4< float >
 
using Diligent::float3x3 = Matrix3x3< float >
 
using Diligent::float2x2 = Matrix2x2< float >
 
using Diligent::double4x4 = Matrix4x4< double >
 
using Diligent::double3x3 = Matrix3x3< double >
 
using Diligent::double2x2 = Matrix2x2< double >
 

Functions

template<class T >
Vector2< T > Diligent::operator* (T s, const Vector2< T > &a)
 
template<class T >
Vector3< T > Diligent::operator* (T s, const Vector3< T > &a)
 
template<class T >
Vector4< T > Diligent::operator* (T s, const Vector4< T > &a)
 
template<class T >
Diligent::dot (const Vector2< T > &a, const Vector2< T > &b)
 
template<class T >
Diligent::dot (const Vector3< T > &a, const Vector3< T > &b)
 
template<class T >
Diligent::dot (const Vector4< T > &a, const Vector4< T > &b)
 
template<class VectorType >
auto Diligent::length (const VectorType &a) -> decltype(dot(a, a))
 
template<class T >
Vector3< T > Diligent::min (const Vector3< T > &a, const Vector3< T > &b)
 
template<class T >
Vector4< T > Diligent::min (const Vector4< T > &a, const Vector4< T > &b)
 
template<class T >
Vector3< T > Diligent::max (const Vector3< T > &a, const Vector3< T > &b)
 
template<class T >
Vector4< T > Diligent::max (const Vector4< T > &a, const Vector4< T > &b)
 
template<class T >
Vector2< T > Diligent::abs (const Vector2< T > &a)
 
template<class T >
Vector3< T > Diligent::abs (const Vector3< T > &a)
 
template<class T >
Vector4< T > Diligent::abs (const Vector4< T > &a)
 
template<typename T >
Diligent::clamp (T val, T _min, T _max)
 
template<class T >
Vector2< T > Diligent::clamp (const Vector2< T > &a, const Vector2< T > &_min, const Vector2< T > &_max)
 
template<class T >
Vector3< T > Diligent::clamp (const Vector3< T > &a, const Vector3< T > &_min, const Vector3< T > &_max)
 
template<class T >
Vector4< T > Diligent::clamp (const Vector4< T > &a, const Vector4< T > &_min, const Vector4< T > &_max)
 
template<class T >
Vector3< T > Diligent::cross (const Vector3< T > &a, const Vector3< T > &b)
 
template<class T , class Y >
Vector3< T > Diligent::cross (const Vector3< T > &a, const Vector3< T > &b)
 
Vector3< float > Diligent::high_precision_cross (const Vector3< float > &a, const Vector3< float > &b)
 
Vector3< int32_t > Diligent::high_precision_cross (const Vector3< int32_t > &a, const Vector3< int32_t > &b)
 
template<class VectorType >
VectorType Diligent::normalize (const VectorType &a)
 
template<class T >
Matrix4x4< T > Diligent::operator* (const Matrix4x4< T > &m1, const Matrix4x4< T > &m2)
 
template<class T >
Matrix3x3< T > Diligent::operator* (const Matrix3x3< T > &m1, const Matrix3x3< T > &m2)
 
template<class T >
Matrix2x2< T > Diligent::operator* (const Matrix2x2< T > &m1, const Matrix2x2< T > &m2)
 
template<class T >
Vector4< T > Diligent::operator* (const Matrix4x4< T > &m, const Vector4< T > &v)
 
template<class T >
Vector3< T > Diligent::operator* (const Matrix3x3< T > &m, Vector3< T > &v)
 
template<class T >
Vector2< T > Diligent::operator* (const Matrix2x2< T > &m, const Vector2< T > &v)
 
Quaternion Diligent::operator* (const Quaternion &q1, const Quaternion &q2)
 
Quaternion Diligent::normalize (const Quaternion &q)
 
Quaternion Diligent::slerp (Quaternion v0, Quaternion v1, float t, bool DoNotNormalize=false)
 
template<typename T >
Diligent::lerp (const T &Left, const T &Right, float w)
 
template<typename T >
Diligent::SmoothStep (T Left, T Right, T w)
 
template<typename T >
Diligent::max3 (const T &x, const T &y, const T &z)
 
template<typename T >
Diligent::min3 (const T &x, const T &y, const T &z)
 
float4 Diligent::RGBA8Unorm_To_F4Color (Uint32 RGBA8)
 
Uint32 Diligent::F4Color_To_RGBA8Unorm (const float4 &f4Color)
 
template<typename T >
Diligent::FastFloor (T x)
 
template<typename T >
Diligent::FastCeil (T x)
 
template<typename T >
Diligent::Vector2< T > Diligent::FastFloor (const Diligent::Vector2< T > &vec)
 
template<typename T >
Diligent::Vector3< T > Diligent::FastFloor (const Diligent::Vector3< T > &vec)
 
template<typename T >
Diligent::Vector4< T > Diligent::FastFloor (const Diligent::Vector4< T > &vec)
 
template<typename T >
Diligent::Vector2< T > Diligent::FastCeil (const Diligent::Vector2< T > &vec)
 
template<typename T >
Diligent::Vector3< T > Diligent::FastCeil (const Diligent::Vector3< T > &vec)
 
template<typename T >
Diligent::Vector4< T > Diligent::FastCeil (const Diligent::Vector4< T > &vec)
 
Uint32 Diligent::BitInterleave16 (Uint16 _x, Uint16 _y)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type Diligent::ExtractLSB (T &bits)
 Returns the least-signficant bit and clears it in the input argument. More...
 
template<typename T >
std::enable_if< std::is_enum< T >::value, T >::type Diligent::ExtractLSB (T &bits)
 Returns the enum value representing the least-signficant bit and clears it in the input argument. More...
 
std::ostream & Diligent::operator<< (std::ostream &os, const float4 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const float3 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const float2 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const int4 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const int3 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const int2 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const uint4 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const uint3 &vec)
 
std::ostream & Diligent::operator<< (std::ostream &os, const uint2 &vec)
 
template<typename T >
Diligent::Vector2< T > std::max (const Diligent::Vector2< T > &Left, const Diligent::Vector2< T > &Right)
 
template<typename T >
Diligent::Vector3< T > std::max (const Diligent::Vector3< T > &Left, const Diligent::Vector3< T > &Right)
 
template<typename T >
Diligent::Vector4< T > std::max (const Diligent::Vector4< T > &Left, const Diligent::Vector4< T > &Right)
 
template<typename T >
Diligent::Vector2< T > std::min (const Diligent::Vector2< T > &Left, const Diligent::Vector2< T > &Right)
 
template<typename T >
Diligent::Vector3< T > std::min (const Diligent::Vector3< T > &Left, const Diligent::Vector3< T > &Right)
 
template<typename T >
Diligent::Vector4< T > std::min (const Diligent::Vector4< T > &Left, const Diligent::Vector4< T > &Right)
 
template<typename T >
Diligent::Vector2< T > std::floor (const Diligent::Vector2< T > &vec)
 
template<typename T >
Diligent::Vector3< T > std::floor (const Diligent::Vector3< T > &vec)
 
template<typename T >
Diligent::Vector4< T > std::floor (const Diligent::Vector4< T > &vec)
 
template<typename T >
Diligent::Vector2< T > std::ceil (const Diligent::Vector2< T > &vec)
 
template<typename T >
Diligent::Vector3< T > std::ceil (const Diligent::Vector3< T > &vec)
 
template<typename T >
Diligent::Vector4< T > std::ceil (const Diligent::Vector4< T > &vec)