Photon Engine 2.0.0-beta
A physically based renderer.
|
#include "Math/math.h"
Go to the source code of this file.
Namespaces | |
namespace | ph |
The root for all renderer implementations. | |
namespace | ph::math |
Math functions and utilities. | |
Functions | |
template<typename T , std::size_t N> | |
T | ph::math::summation (const std::array< T, N > &values, T initialValue=0) |
Sum all values within a container together. | |
template<typename T > | |
T | ph::math::summation (const std::vector< T > &values, T initialValue=0) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::summation (TSpanView< T, EXTENT > values, T initialValue=0) |
template<typename T , std::size_t N> | |
T | ph::math::product (const std::array< T, N > &values, T initialValue=1) |
Multiplies all values within a container together. | |
template<typename T > | |
T | ph::math::product (const std::vector< T > &values, T initialValue=1) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::product (TSpanView< T, EXTENT > values, T initialValue=1) |
template<typename T , std::size_t N> | |
T | ph::math::length (const std::array< T, N > &vec) |
Treating input values as a vector and calculates its length. | |
template<typename T > | |
T | ph::math::length (const std::vector< T > &vec) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::length (TSpanView< T, EXTENT > vec) |
template<typename T , std::size_t N> | |
T | ph::math::length_squared (const std::array< T, N > &vec) |
Treating input values as a vector and calculates its squared length. | |
template<typename T > | |
T | ph::math::length_squared (const std::vector< T > &vec) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::length_squared (TSpanView< T, EXTENT > vec) |
template<typename T , std::size_t N> | |
T | ph::math::p_norm (const std::array< T, N > &vec) |
Treating input values as a vector and calculates its p-norm. | |
template<typename T > | |
T | ph::math::p_norm (const std::vector< T > &vec) |
template<std::size_t P, typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::p_norm (TSpanView< T, EXTENT > vec) |
template<typename T , std::size_t N> | |
void | ph::math::normalize (std::array< T, N > &vec) |
Treating input values as a vector and normalize it. Notice that normalizing a integer typed vector will result in 0-vector most of the time. | |
template<typename T > | |
void | ph::math::normalize (std::vector< T > &vec) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
void | ph::math::normalize (TSpan< T, EXTENT > vec) |
template<typename T , std::size_t N> | |
T | ph::math::dot_product (const std::array< T, N > &vecA, const std::array< T, N > &vecB) |
Treating input values as vectors and calculates their dot product. | |
template<typename T > | |
T | ph::math::dot_product (const std::vector< T > &vecA, const std::vector< T > &vecB) |
template<typename T , std::size_t EXTENT = std::dynamic_extent> | |
T | ph::math::dot_product (TSpanView< T, EXTENT > vecA, TSpanView< T, EXTENT > vecB) |