Namespace: dmMath
Language: C++
Type: Defold C++
File: math.h
Source: engine/dlib/src/dmsdk/dlib/math.h
Include: dmsdk/dlib/math.h
Math functions.
Type: FUNCTION Abs function
Template Parameters
TParameters
x (T)Returns
v (T) - Absolute value of xType: FUNCTION Clamp function
Template Parameters
TParameters
v (T) - Value to clampmin (T) - Lower boundmax (T) - Upper boundReturns
v (T) - Value closest to v inside the range [min, max]Type: FUNCTION Max function
Template Parameters
TParameters
a (T) - Value ab (T) - Value bReturns
v (T) - Max of a and bType: FUNCTION Min function
Template Parameters
TParameters
a (T) - Value ab (T) - Value bReturns
v (T) - Min of a and bType: FUNCTION Select one of two values depending on the sign of another.
Template Parameters
TParameters
x (T) - Value to test for positivenessa (T) - Result if test succeededb (T) - Result if test failedReturns
v (T) - a when x >= 0, b otherwise