Common Functions
Header: <glm/common.hpp>
(included by <glm/glm.hpp>
)
These functions operate component-wise.
abs(genType x) -> genType
sign(genType x) -> genType
floor(genType x) -> genType
trunc(genType x) -> genType
round(genType x) -> genType
roundEven(genType x) -> genType
ceil(genType x) -> genType
fract(genType x) -> genType
- Returns \(x-\operatorname{floor}(x)\).
mod(genType x, genType y) -> genType
mod(genType x, T y) -> genType
- Returns \(x-y\cdot\operatorname{floor}(x/y)\).
modf(genType x, /*out*/ genType& i) -> genType
min(genType x, genType y) -> genType
min(genType x, T y) -> genType
max(genType x, genType y) -> genType
max(genType x, T y) -> genType
clamp(genType x, genType minVal, genType maxVal) -> genType
clamp(genType x, T minVal, T maxVal) -> genType
mix(genType x, genType y, genType a) -> genType
mix(genType x, genType y, T a) -> genType
- Returns \(x\cdot(1-a)+y\cdot a\).
mix(genType x, genType y, genBType a) -> genType
step(genType edge, genType x) -> genType
step(T edge, genType x) -> genType
- Returns \(0.0\) if \(x < \mathrm{edge}\); otherwise it returns \(1.0\).
smoothstep(genType edge0, genType edge1, genType x) -> genType
smoothstep(T edge0, T edge1, genType x) -> genType
isnan(genType x) -> genBType
isinf(genType x) -> genBType
floatBitsToInt(genType value) -> genIType
floatBitsToUint(genType value) -> genUType
intBitsToFloat(genIType value) -> genType
uintBitsToFloat(genUType value) -> genType
fma(genType a, genType b, genType c) -> genType
- Returns \(a\cdot b+c\).
frexp(genType x, /*out*/ genIType& exp) -> genType
ldexp(genType x, genIType exp) -> genType