Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_math_vector.hh
| Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | inline T cross_poly(Span<T> poly) | ||||
| return n; | return n; | ||||
| } | } | ||||
| template<typename T, BLI_ENABLE_IF_FLT_VEC(T)> inline T interpolate(const T &a, const T &b, bT t) | template<typename T, BLI_ENABLE_IF_FLT_VEC(T)> inline T interpolate(const T &a, const T &b, bT t) | ||||
| { | { | ||||
| return a * (1 - t) + b * t; | return a * (1 - t) + b * t; | ||||
| } | } | ||||
| template<typename T, BLI_ENABLE_IF_FLT_VEC(T)> inline T midpoint(const T &a, const T &b) | |||||
| { | |||||
| return (a + b) * 0.5; | |||||
| } | |||||
| template<typename T, BLI_ENABLE_IF_FLT_VEC(T)> | template<typename T, BLI_ENABLE_IF_FLT_VEC(T)> | ||||
| inline T faceforward(const T &vector, const T &incident, const T &reference) | inline T faceforward(const T &vector, const T &incident, const T &reference) | ||||
| { | { | ||||
| return (dot(reference, incident) < 0) ? vector : -vector; | return (dot(reference, incident) < 0) ? vector : -vector; | ||||
| } | } | ||||
| template<typename T> inline int dominant_axis(const T &a) | template<typename T> inline int dominant_axis(const T &a) | ||||
| { | { | ||||
| Show All 24 Lines | |||||