|
Blender V5.3
|
Namespaces | |
| namespace | detail |
| namespace | projection |
| namespace | tests |
Classes | |
| struct | AngleCartesianBase |
| struct | AngleFraction |
| struct | AngleRadianBase |
| struct | AssertUnitEpsilon |
| struct | AssertUnitEpsilon< QuaternionBase< U > > |
| class | Axis |
| struct | AxisAngleBase |
| class | AxisSigned |
| struct | CartesianBasis |
| struct | DualQuaternionBase |
| struct | Euler3Base |
| struct | EulerBase |
| struct | EulerXYZBase |
| struct | isect_result |
| struct | locus_entry_t |
| struct | QuaternionBase |
| struct | TypeTraits |
| struct | TypeTraits< float > |
Typedefs | |
| using | AngleRadian = AngleRadianBase<float> |
| using | AngleCartesian = AngleCartesianBase<float> |
| using | AxisAngle = AxisAngleBase<float, AngleRadianBase<float>> |
| using | AxisAngleCartesian = AxisAngleBase<float, AngleCartesianBase<float>> |
| using | EulerXYZ = EulerXYZBase<float> |
| using | Euler3 = Euler3Base<float> |
Intermediate Types | |
Some functions need to have higher precision than standard floats for some operations. | |
| using | Quaternion = QuaternionBase<float> |
| using | DualQuaternion = DualQuaternionBase<float> |
Enumerations | |
| enum | EulerOrder { XYZ = 1 , XZY , YXZ , YZX , ZXY , ZYX } |
| enum class | FilterKernel { Box , Tent , Quad , Cubic , Catrom , Gauss , Mitch } |
| enum class | InterpWrapMode { Extend , Repeat , Border } |
| enum class | eCubicFilter { BSpline , Mitchell } |
Functions | |
| template<typename T> | |
| T | cos (const AngleRadianBase< T > &a) |
| template<typename T> | |
| T | sin (const AngleRadianBase< T > &a) |
| template<typename T> | |
| T | tan (const AngleRadianBase< T > &a) |
| template<typename T> | |
| T | cos (const AngleCartesianBase< T > &a) |
| template<typename T> | |
| T | sin (const AngleCartesianBase< T > &a) |
| template<typename T> | |
| T | tan (const AngleCartesianBase< T > &a) |
| template<typename T> | |
| T | cos (const AngleFraction< T > &a) |
| template<typename T> | |
| T | sin (const AngleFraction< T > &a) |
| template<typename T> | |
| T | tan (const AngleFraction< T > &a) |
| template<typename T> | |
| bool | is_zero (const T &a) |
| template<typename T> | |
| bool | is_any_zero (const T &a) |
| template<typename T> | |
| T | abs (const T &a) |
| template<typename T> | |
| T | sign (const T &a) |
| template<typename T> | |
| T | min (const T &a, const T &b) |
| template<typename T> | |
| T | max (const T &a, const T &b) |
| template<typename T> | |
| void | max_inplace (T &a, const T &b) |
| template<typename T> | |
| void | min_inplace (T &a, const T &b) |
| template<typename T> | |
| T | clamp (const T &a, const T &min, const T &max) |
| template<typename T> | |
| T | step (const T &edge, const T &value) |
| template<typename T> | |
| T | mod (const T &a, const T &b) |
| template<typename T> | |
| T | safe_mod (const T &a, const T &b) |
| template<typename T> | |
| T | floored_mod (const T &a, const T &b) |
| template<typename T> | |
| T | safe_floored_mod (const T &a, const T &b) |
| template<typename T> | |
| void | min_max (const T &value, T &min, T &max) |
| template<typename T> | |
| T | safe_divide (const T &a, const T &b) |
| template<typename T> | |
| T | floor (const T &a) |
| template<typename T> | |
| T | round (const T &a) |
| template<typename T> | |
| T | mod_periodic (const T &a, const T &b) |
| template<typename T> | |
| T | ceil (const T &a) |
| template<typename T> | |
| T | distance (const T &a, const T &b) |
| template<typename T> | |
| T | fract (const T &a) |
| template<typename T> | |
| T | sqrt (const T &a) |
| template<typename T> | |
| T | rcp (const T &a) |
| template<typename T> | |
| T | safe_rcp (const T &a) |
| template<typename T> | |
| T | cos (const T &a) |
| template<typename T> | |
| T | sin (const T &a) |
| template<typename T> | |
| T | tan (const T &a) |
| template<typename T> | |
| T | acos (const T &a) |
| template<typename T> | |
| T | pow (const T &x, const T &power) |
| template<typename T> | |
| T | safe_pow (const T &x, const T &power) |
| template<typename T> | |
| T | fallback_pow (const T &x, const T &power, const T &fallback) |
| template<typename T> | |
| T | square (const T &a) |
| template<typename T> | |
| T | cube (const T &a) |
| template<typename T> | |
| T | exp (const T &x) |
| template<typename T> | |
| T | log (const T &x) |
| template<typename T> | |
| T | safe_acos (const T &a) |
| float | safe_acos_approx (float x) |
| template<typename T> | |
| T | asin (const T &a) |
| template<typename T> | |
| T | atan (const T &a) |
| template<typename T> | |
| T | atan2 (const T &y, const T &x) |
| template<typename T> | |
| T | hypot (const T &y, const T &x) |
| template<typename T, typename FactorT> | |
| T | interpolate (const T &a, const T &b, const FactorT &t) |
| template<typename T> | |
| T | midpoint (const T &a, const T &b) |
| template<eAlpha Alpha> | |
| ColorSceneLinear4f< Alpha > | interpolate (const ColorSceneLinear4f< Alpha > &a, const ColorSceneLinear4f< Alpha > &b, const float t) |
| template<eAlpha Alpha> | |
| ColorSceneLinearByteEncoded4b< Alpha > | interpolate (const ColorSceneLinearByteEncoded4b< Alpha > &a, const ColorSceneLinearByteEncoded4b< Alpha > &b, const float t) |
| float3 | whitepoint_from_temp_tint (float temperature, float tint) |
| bool | whitepoint_to_temp_tint (const float3 &white, float &temperature, float &tint) |
| float3x3 | chromatic_adaption_matrix (const float3 &from_XYZ, const float3 &to_XYZ) |
| std::ostream & | operator<< (std::ostream &stream, EulerOrder order) |
| float | filter_kernel_value (FilterKernel kernel, float x) |
| uint16_t | float_to_half (float v) |
| uint16_t | float_to_half_make_finite (float v) |
| float | half_to_float (uint16_t v) |
| void | float_to_half_array (const float *src, uint16_t *dst, size_t length) |
| void | float_to_half_clamp_array (const float *src, uint16_t *dst, size_t length, float min_value, float max_value) |
| void | float_to_half_make_finite_array (const float *src, uint16_t *dst, size_t length) |
| void | half_to_float_array (const uint16_t *src, float *dst, size_t length) |
| BLI_INLINE int32_t | wrap_coord (float u, int32_t size, InterpWrapMode wrap) |
| BLI_INLINE void | interpolate_nearest_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v) |
| void | interpolate_nearest_border_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v) |
| uchar4 | interpolate_nearest_border_byte (const uchar *buffer, int width, int height, float u, float v) |
| void | interpolate_nearest_border_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| float4 | interpolate_nearest_border_fl (const float *buffer, int width, int height, float u, float v) |
| void | interpolate_nearest_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v) |
| uchar4 | interpolate_nearest_byte (const uchar *buffer, int width, int height, float u, float v) |
| void | interpolate_nearest_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| float4 | interpolate_nearest_fl (const float *buffer, int width, int height, float u, float v) |
| int32_t | wrap_coord (float u, int32_t size) |
| void | interpolate_nearest_wrap_byte (const uchar *buffer, uchar *output, int width, int height, float u, float v) |
| uchar4 | interpolate_nearest_wrap_byte (const uchar *buffer, int width, int height, float u, float v) |
| void | interpolate_nearest_wrap_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| float4 | interpolate_nearest_wrap_fl (const float *buffer, int width, int height, float u, float v) |
| BLI_INLINE void | interpolate_bilinear_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_x, InterpWrapMode wrap_y) |
| uchar4 | interpolate_bilinear_border_byte (const uchar *buffer, int width, int height, float u, float v) |
| float4 | interpolate_bilinear_border_fl (const float *buffer, int width, int height, float u, float v) |
| void | interpolate_bilinear_border_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| uchar4 | interpolate_bilinear_byte (const uchar *buffer, int width, int height, float u, float v) |
| float4 | interpolate_bilinear_fl (const float *buffer, int width, int height, float u, float v) |
| void | interpolate_bilinear_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| uchar4 | interpolate_bilinear_wrap_byte (const uchar *buffer, int width, int height, float u, float v) |
| float4 | interpolate_bilinear_wrap_fl (const float *buffer, int width, int height, float u, float v) |
| uchar4 | interpolate_cubic_bspline_byte (const uchar *buffer, int width, int height, float u, float v) |
| float4 | interpolate_cubic_bspline_fl (const float *buffer, int width, int height, float u, float v) |
| void | interpolate_cubic_bspline_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| void | interpolate_cubic_bspline_wrapmode_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v) |
| uchar4 | interpolate_cubic_mitchell_byte (const uchar *buffer, int width, int height, float u, float v) |
| float4 | interpolate_cubic_mitchell_fl (const float *buffer, int width, int height, float u, float v) |
| void | interpolate_cubic_mitchell_fl (const float *buffer, float *output, int width, int height, int components, float u, float v) |
| void | transform_normals (const float3x3 &transform, MutableSpan< float3 > normals) |
| void | transform_normals (Span< float3 > src, const float3x3 &transform, MutableSpan< float3 > dst) |
| void | transform_points (const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true) |
| void | transform_points (Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst, bool use_threading=true) |
| float3 | rotate_direction_around_axis (const float3 &direction, const float3 &axis, float angle) |
| float3 | rotate_around_axis (const float3 &vector, const float3 ¢er, const float3 &axis, float angle) |
| template<typename T, int Size> | |
| bool | almost_equal_relative (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const T &epsilon_factor) |
| template<typename T, int Size> | |
| VecBase< T, Size > | abs (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | sign (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | min (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | min (Span< VecBase< T, Size > > values) |
| template<typename T, int Size> | |
| VecBase< T, Size > | min (std::initializer_list< VecBase< T, Size > > values) |
| template<typename T, int Size> | |
| VecBase< T, Size > | max (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | max (Span< VecBase< T, Size > > values) |
| template<typename T, int Size> | |
| VecBase< T, Size > | max (std::initializer_list< VecBase< T, Size > > values) |
| template<typename T, int Size> | |
| VecBase< T, Size > | clamp (const VecBase< T, Size > &a, const VecBase< T, Size > &min, const VecBase< T, Size > &max) |
| template<typename T, int Size> | |
| VecBase< T, Size > | clamp (const VecBase< T, Size > &a, const T &min, const T &max) |
| template<typename T, int Size> | |
| VecBase< T, Size > | step (const VecBase< T, Size > &edge, const VecBase< T, Size > &value) |
| template<typename T, int Size> | |
| VecBase< T, Size > | step (const T &edge, const VecBase< T, Size > &value) |
| template<typename T, int Size> | |
| VecBase< T, Size > | mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | mod (const VecBase< T, Size > &a, const T &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_mod (const VecBase< T, Size > &a, const T &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | floored_mod (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | floored_mod (const VecBase< T, Size > &a, const T &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | pow (const VecBase< T, Size > &x, const T &y) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_pow (const VecBase< T, Size > &x, const T &y) |
| template<typename T, int Size> | |
| VecBase< T, Size > | fallback_pow (const VecBase< T, Size > &x, const T &y, const VecBase< T, Size > &fallback) |
| template<typename T, int Size> | |
| VecBase< T, Size > | pow (const VecBase< T, Size > &x, const VecBase< T, Size > &y) |
| template<typename T, int Size> | |
| VecBase< T, Size > | square (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | exp (const VecBase< T, Size > &x) |
| template<typename T, int Size> | |
| VecBase< T, Size > | log (const VecBase< T, Size > &x) |
| template<typename T, int Size> | |
| VecBase< T, Size > | ceil_to_multiple (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | divide_ceil (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| void | min_max (const VecBase< T, Size > &vector, VecBase< T, Size > &min, VecBase< T, Size > &max) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_divide (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_divide (const VecBase< T, Size > &a, const T &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | floor (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | round (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | ceil (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | sqrt (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_sqrt (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | rcp (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | safe_rcp (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| VecBase< T, Size > | fract (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | dot (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| T | length_manhattan (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | length_squared (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | length (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| bool | is_unit_scale (const VecBase< T, Size > &v) |
| template<typename T, int Size> | |
| T | distance_manhattan (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| T | distance_squared (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| T | distance (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | reflect (const VecBase< T, Size > &incident, const VecBase< T, Size > &normal) |
| template<typename T, int Size> | |
| VecBase< T, Size > | refract (const VecBase< T, Size > &incident, const VecBase< T, Size > &normal, const T &eta) |
| template<typename T, int Size> | |
| VecBase< T, Size > | project (const VecBase< T, Size > &p, const VecBase< T, Size > &v_proj) |
| template<typename T, int Size> | |
| VecBase< T, Size > | normalize_and_get_length (const VecBase< T, Size > &v, T &out_length) |
| template<typename T, int Size> | |
| VecBase< T, Size > | normalize (const VecBase< T, Size > &v) |
| template<typename T> | |
| T | cross (const VecBase< T, 2 > &a, const VecBase< T, 2 > &b) |
| template<typename T> | |
| VecBase< T, 3 > | cross (const VecBase< T, 3 > &a, const VecBase< T, 3 > &b) |
| VecBase< float, 3 > | cross_high_precision (const VecBase< float, 3 > &a, const VecBase< float, 3 > &b) |
| template<typename T> | |
| VecBase< T, 3 > | cross_poly (Span< VecBase< T, 3 > > poly) |
| template<typename T> | |
| VecBase< T, 3 > | cross_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3) |
| template<typename T> | |
| VecBase< T, 3 > | normal_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3) |
| template<typename T, typename FactorT, int Size> | |
| VecBase< T, Size > | interpolate (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const FactorT &t) |
| template<typename T, int Size> | |
| VecBase< T, Size > | midpoint (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| template<typename T, int Size> | |
| VecBase< T, Size > | faceforward (const VecBase< T, Size > &vector, const VecBase< T, Size > &incident, const VecBase< T, Size > &reference) |
| template<typename T> | |
| int | dominant_axis (const VecBase< T, 3 > &a) |
| template<typename T, int Size> | |
| T | reduce_max (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | reduce_min (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | reduce_add (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | reduce_mul (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| T | average (const VecBase< T, Size > &a) |
| template<typename T> | |
| VecBase< T, 3 > | orthogonal (const VecBase< T, 3 > &v) |
| template<typename T> | |
| VecBase< T, 2 > | orthogonal (const VecBase< T, 2 > &v) |
| template<typename T, int Size> | |
| bool | is_equal (const VecBase< T, Size > &a, const VecBase< T, Size > &b, const T epsilon=T(0)) |
| template<typename T, int Size> | |
| bool | is_zero (const VecBase< T, Size > &a, const T epsilon=T(0)) |
| template<typename T, int Size> | |
| bool | is_any_zero (const VecBase< T, Size > &a) |
| template<typename T, int Size> | |
| bool | is_unit (const VecBase< T, Size > &a, const T epsilon=T(10) *std::numeric_limits< T >::epsilon()) |
| template<typename T, int Size> | |
| isect_result< VecBase< T, Size > > | isect_seg_seg (const VecBase< T, Size > &v1, const VecBase< T, Size > &v2, const VecBase< T, Size > &v3, const VecBase< T, Size > &v4) |
| template<typename T> | |
| constexpr uint64_t | vector_hash (const T &vec) |
| std::ostream & | operator<< (std::ostream &stream, const Axis axis) |
| std::ostream & | operator<< (std::ostream &stream, const AxisSigned axis) |
| std::ostream & | operator<< (std::ostream &stream, const CartesianBasis &rot) |
| static float | filt_quadratic (float x) |
| static float | filt_cubic (float x) |
| static float | filt_catrom (float x) |
| static float | filt_mitchell (float x) |
| template<enum eCubicFilter filter> | |
| static float4 | cubic_filter_coefficients (float f) |
| template<typename T, eCubicFilter filter> | |
| BLI_INLINE void | bicubic_interpolation (const T *src_buffer, T *output, int width, int height, int components, float u, float v, InterpWrapMode wrap_u, InterpWrapMode wrap_v) |
| template<bool border> | |
| BLI_INLINE uchar4 | bilinear_byte_impl (const uchar *buffer, int width, int height, float u, float v) |
| template<typename T> | |
| bool | is_similarity_transform (const MatBase< T, 3, 3 > &matrix, const T &epsilon=1e-6) |
| static bool | skip_transform (const float4x4 &transform) |
| static void | transform_points_no_threading (const Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst) |
| static void | transform_points_no_threading (const float4x4 &transform, MutableSpan< float3 > points) |
| template<> | |
| isect_result< float2 > | isect_seg_seg (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &v4) |
| template<> | |
| isect_result< double2 > | isect_seg_seg (const double2 &v1, const double2 &v2, const double2 &v3, const double2 &v4) |
Conversion to Quaternions | |
| template<typename T, typename AngleT> | |
| QuaternionBase< T > | to_quaternion (const AxisAngleBase< T, AngleT > &axis_angle) |
| template<typename T> | |
| QuaternionBase< T > | to_quaternion (const EulerXYZBase< T > &eul) |
| template<typename T> | |
| QuaternionBase< T > | to_quaternion (const Euler3Base< T > &eulO) |
Conversion to Euler | |
| template<typename T, typename AngleT> | |
| Euler3Base< T > | to_euler (const AxisAngleBase< T, AngleT > &axis_angle, EulerOrder order) |
| template<typename T, typename AngleT> | |
| EulerXYZBase< T > | to_euler (const AxisAngleBase< T, AngleT > &axis_angle) |
| template<typename T, typename AngleT = AngleRadian> | |
| AxisAngleBase< T, AngleT > | to_axis_angle (const QuaternionBase< T > &quat) |
| template<typename T> | |
| EulerXYZBase< T > | to_euler (const QuaternionBase< T > &quat) |
| template<typename T> | |
| Euler3Base< T > | to_euler (const QuaternionBase< T > &quat, EulerOrder order) |
Axes | |
| constexpr bool | operator<= (const Axis::Value a, const Axis::Value b) |
| constexpr bool | operator<= (const AxisSigned::Value a, const AxisSigned::Value b) |
Axes Utilities | |
| template<> | |
| AxisSigned | abs (const AxisSigned &axis) |
| int | sign (const AxisSigned &axis) |
| AxisSigned | cross (const AxisSigned a, const AxisSigned b) |
| template<typename T> | |
| T | to_vector (const Axis axis) |
| template<typename T> | |
| T | to_vector (const AxisSigned axis) |
CartesianBasis | |
| CartesianBasis | from_orthonormal_axes (const AxisSigned forward, const AxisSigned up) |
| CartesianBasis | rotation_between (const CartesianBasis &a, const CartesianBasis &b) |
| CartesianBasis | rotation_between (const AxisSigned a_forward, const AxisSigned b_forward) |
| template<typename T> | |
| VecBase< T, 3 > | transform_point (const CartesianBasis &basis, const VecBase< T, 3 > &v) |
| CartesianBasis | invert (const CartesianBasis &basis) |
Conversion to axis angles | |
| template<typename T, typename AngleT = AngleRadian> | |
| AxisAngleBase< T, AngleT > | to_axis_angle (const EulerXYZBase< T > &euler) |
| template<typename T, typename AngleT = AngleRadian> | |
| AxisAngleBase< T, AngleT > | to_axis_angle (const Euler3Base< T > &euler) |
Normals & Area | |
| template<typename T> | |
| VecBase< T, 3 > | normal_quad (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const VecBase< T, 3 > &v4) |
| template<typename T> | |
| T | area_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3) |
| template<typename T> | |
| T | cotangent_tri_weight (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3) |
Planes | |
| template<typename T> | |
| VecBase< T, 4 > | plane_from_point_normal (const VecBase< T, 3 > &co, const VecBase< T, 3 > &no) |
| template<typename T> | |
| T | plane_point_side (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &co) |
| TEST (math_geom_hh, PlaneFromPointNormal) | |
| TEST (math_geom_hh, PlanePointSide) | |
Distance & Closest Points | |
| template<typename T, int Size> | |
| VecBase< T, Size > | closest_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2) |
| template<typename T, int Size> | |
| T | dist_squared_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2) |
| template<typename T> | |
| VecBase< T, 3 > | closest_to_plane_normalized (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt) |
| template<typename T> | |
| VecBase< T, 3 > | closest_to_plane (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt) |
| template<typename T> | |
| T | dist_squared_to_plane (const VecBase< T, 3 > &p, const VecBase< T, 4 > &plane) |
| TEST (math_geom_hh, DistSquaredToLineSegment2D) | |
| TEST (math_geom_hh, DistSquaredToLineSegment3D) | |
| TEST (math_geom_hh, ClosestToLineSegment3D) | |
| TEST (math_geom_hh, ClosestToPlaneNormalized) | |
| TEST (math_geom_hh, ClosestToPlane) | |
| TEST (math_geom_hh, DistSquaredToPlane) | |
Projection Factors | |
| template<typename T, int Size> | |
| T | line_point_factor (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2) |
| TEST (math_geom_hh, LinePointFactor3D) | |
| TEST (math_geom_hh, LinePointFactor2D) | |
Matrix Utilities | |
| float3x3 | axis_dominant_to_m3 (const float3 &normal) |
| TEST (math_geom_hh, AxisDominantToM3) | |
Intersection | |
| int | isect_line_line (const float3 &v1, const float3 &v2, const float3 &v3, const float3 &v4, float3 &r_i1, float3 &r_i2) |
| std::optional< float3 > | isect_line_plane (const float3 &l1, const float3 &l2, const float3 &plane_co, const float3 &plane_no) |
| template<typename T> | |
| int | isect_point_tri (const VecBase< T, 2 > &pt, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3) |
| template<typename T> | |
| int | isect_point_quad (const VecBase< T, 2 > &p, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3, const VecBase< T, 2 > &v4) |
| bool | isect_point_poly (const float2 &pt, Span< float2 > verts) |
| TEST (math_geom_hh, IsectLineLine3D) | |
| TEST (math_geom_hh, IsectLinePlane) | |
| TEST (math_geom_hh, IsectPointTri2D) | |
| TEST (math_geom_hh, IsectPointQuad2D) | |
| TEST (math_geom_hh, IsectPointPoly) | |
Barycentric Coordinates | |
| float3 | barycentric_weights (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &co) |
| TEST (math_geom_hh, BarycentricWeights) | |
Polygon Utilities | |
| constexpr int | poly_to_tri_count (const int poly_count, const int corner_count) |
| float | area_poly (Span< float2 > verts) |
| void | interp_weights_poly (MutableSpan< float > r_weights, Span< float2 > verts, const float2 &co) |
| TEST (math_geom_hh, PolyToTriCount) | |
| TEST (math_geom_hh, AreaPoly) | |
| TEST (math_geom_hh, InterpWeightsPoly) | |
Interpolation | |
| template<typename T> | |
| VecBase< T, 3 > | interp_bilinear_quad (const VecBase< T, 3 > &v0, const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const T u, const T v) |
| TEST (math_geom_hh, InterpBilinearQuad) | |
Mapping | |
| float2 | map_to_sphere (const float3 &co) |
| TEST (math_geom_hh, MapToSphere) | |
Matrix Operations | |
| template<typename T, int Size> | |
| MatBase< T, Size, Size > | invert (const MatBase< T, Size, Size > &mat, bool &r_success) |
| template<typename T, int NumCol, int NumRow> | |
| MatBase< T, NumCol, NumRow > | transpose (const MatBase< T, NumRow, NumCol > &mat) |
| template<typename T, int NumCol, int NumRow> | |
| MatBase< T, NumCol, NumRow > | normalize (const MatBase< T, NumCol, NumRow > &a) |
| template<typename T, int NumCol, int NumRow, typename VectorT> | |
| MatBase< T, NumCol, NumRow > | normalize_and_get_size (const MatBase< T, NumCol, NumRow > &a, VectorT &r_size) |
| template<typename T, int Size> | |
| T | determinant (const MatBase< T, Size, Size > &mat) |
| template<typename T, int Size> | |
| MatBase< T, Size, Size > | adjoint (const MatBase< T, Size, Size > &mat) |
| template<typename T, int NumCol, int NumRow, typename VectorT> | |
| MatBase< T, NumCol, NumRow > | translate (const MatBase< T, NumCol, NumRow > &mat, const VectorT &translation) |
| template<typename T, int NumCol, int NumRow, typename RotationT> | |
| MatBase< T, NumCol, NumRow > | rotate (const MatBase< T, NumCol, NumRow > &mat, const RotationT &rotation) |
| template<typename T, int NumCol, int NumRow, typename VectorT> | |
| MatBase< T, NumCol, NumRow > | scale (const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale) |
| template<typename T, int NumCol, int NumRow> | |
| MatBase< T, NumCol, NumRow > | interpolate_linear (const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, T t) |
| template<typename T> | |
| MatBase< T, 3, 3 > | interpolate (const MatBase< T, 3, 3 > &a, const MatBase< T, 3, 3 > &b, T t) |
| template<typename T> | |
| MatBase< T, 4, 4 > | interpolate (const MatBase< T, 4, 4 > &a, const MatBase< T, 4, 4 > &b, T t) |
| template<typename T> | |
| MatBase< T, 3, 3 > | interpolate_fast (const MatBase< T, 3, 3 > &a, const MatBase< T, 3, 3 > &b, T t) |
| template<typename T> | |
| MatBase< T, 4, 4 > | interpolate_fast (const MatBase< T, 4, 4 > &a, const MatBase< T, 4, 4 > &b, T t) |
| template<typename T, int Size> | |
| MatBase< T, Size, Size > | pseudo_invert (const MatBase< T, Size, Size > &mat, T epsilon=1e-8) |
Init helpers. | |
| template<typename MatT> | |
| MatT | from_location (const typename MatT::loc_type &location) |
| template<typename MatT, int ScaleDim> | |
| MatT | from_scale (const VecBase< typename MatT::base_type, ScaleDim > &scale) |
| template<typename MatT, typename RotationT> | |
| MatT | from_rotation (const RotationT &rotation) |
| template<typename MatT, typename RotationT, typename VectorT> | |
| MatT | from_rot_scale (const RotationT &rotation, const VectorT &scale) |
| template<typename MatT, typename RotationT> | |
| MatT | from_loc_rot (const typename MatT::loc_type &location, const RotationT &rotation) |
| template<typename MatT, int ScaleDim> | |
| MatT | from_loc_scale (const typename MatT::loc_type &location, const VecBase< typename MatT::base_type, ScaleDim > &scale) |
| template<typename MatT, typename RotationT, int ScaleDim> | |
| MatT | from_loc_rot_scale (const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale) |
| template<typename T> | |
| MatBase< T, 2, 2 > | from_direction (const VecBase< T, 2 > &direction) |
| template<typename MatT, typename VectorT> | |
| MatT | from_orthonormal_axes (const VectorT forward, const VectorT up) |
| template<typename MatT, typename VectorT> | |
| MatT | from_orthonormal_axes (const VectorT location, const VectorT forward, const VectorT up) |
| template<typename MatT, typename VectorT> | |
| MatT | from_up_axis (const VectorT up) |
| template<typename MatT> | |
| MatT | orthogonalize (const MatT &mat, const Axis axis) |
| template<typename MatT, typename VectorT> | |
| MatT | from_origin_transform (const MatT &transform, const VectorT origin) |
Conversion function. | |
| template<typename T> | |
| AngleRadianBase< T > | to_angle (const MatBase< T, 2, 2 > &mat) |
| template<typename T> | |
| EulerXYZBase< T > | to_euler (const MatBase< T, 3, 3 > &mat) |
| template<typename T> | |
| EulerXYZBase< T > | to_euler (const MatBase< T, 4, 4 > &mat) |
| template<typename T> | |
| Euler3Base< T > | to_euler (const MatBase< T, 3, 3 > &mat, EulerOrder order) |
| template<typename T> | |
| Euler3Base< T > | to_euler (const MatBase< T, 4, 4 > &mat, EulerOrder order) |
| template<typename T> | |
| EulerXYZBase< T > | to_nearest_euler (const MatBase< T, 3, 3 > &mat, const EulerXYZBase< T > &reference) |
| template<typename T> | |
| EulerXYZBase< T > | to_nearest_euler (const MatBase< T, 4, 4 > &mat, const EulerXYZBase< T > &reference) |
| template<typename T> | |
| Euler3Base< T > | to_nearest_euler (const MatBase< T, 3, 3 > &mat, const Euler3Base< T > &reference) |
| template<typename T> | |
| Euler3Base< T > | to_nearest_euler (const MatBase< T, 4, 4 > &mat, const Euler3Base< T > &reference) |
| template<typename T> | |
| QuaternionBase< T > | to_quaternion (const MatBase< T, 3, 3 > &mat) |
| template<typename T> | |
| QuaternionBase< T > | to_quaternion (const MatBase< T, 4, 4 > &mat) |
| Quaternion | to_quaternion_legacy (const float3x3 &mat) |
| template<bool AllowNegativeScale = false, typename T, int NumCol, int NumRow> | |
| VecBase< T, 3 > | to_scale (const MatBase< T, NumCol, NumRow > &mat) |
| template<bool AllowNegativeScale = false, typename T> | |
| VecBase< T, 2 > | to_scale (const MatBase< T, 2, 2 > &mat) |
| template<bool AllowNegativeScale = false, typename T> | |
| void | to_rot_scale (const MatBase< T, 2, 2 > &mat, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale) |
| template<bool AllowNegativeScale = false, typename T> | |
| void | to_loc_rot_scale (const MatBase< T, 3, 3 > &mat, VecBase< T, 2 > &r_location, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale) |
| template<bool AllowNegativeScale = false, typename T, typename RotationT> | |
| void | to_rot_scale (const MatBase< T, 3, 3 > &mat, RotationT &r_rotation, VecBase< T, 3 > &r_scale) |
| template<bool AllowNegativeScale = false, typename T, typename RotationT> | |
| void | to_loc_rot_scale (const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale) |
Transform functions. | |
| template<typename T> | |
| VecBase< T, 2 > | transform_point (const MatBase< T, 2, 2 > &mat, const VecBase< T, 2 > &point) |
| template<typename T> | |
| VecBase< T, 2 > | transform_point (const MatBase< T, 3, 3 > &mat, const VecBase< T, 2 > &point) |
| template<typename T> | |
| VecBase< T, 3 > | transform_point (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &point) |
| template<typename T> | |
| VecBase< T, 3 > | transform_point (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &point) |
| template<typename T> | |
| VecBase< T, 3 > | transform_direction (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction) |
| template<typename T> | |
| VecBase< T, 3 > | transform_direction (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &direction) |
| template<typename MatT, typename VectorT> | |
| VectorT | project_point (const MatT &mat, const VectorT &point) |
| template<typename MatT, typename VectorT> | |
| VectorT | project_point_safe (const MatT &mat, const VectorT &point) |
| template<typename T> | |
| VecBase< T, 3 > | transform_point (const QuaternionBase< T > &q, const VecBase< T, 3 > &v) |
Compare / Test | |
| template<typename T> | |
| bool | is_negative (const MatBase< T, 3, 3 > &mat) |
| template<typename T> | |
| bool | is_negative (const MatBase< T, 4, 4 > &mat) |
| template<typename T, int NumCol, int NumRow> | |
| bool | is_equal (const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0)) |
| template<typename T, int NumCol, int NumRow> | |
| bool | is_identity (const MatBase< T, NumCol, NumRow > &mat) |
| template<typename MatT> | |
| bool | is_orthogonal (const MatT &mat) |
| template<typename MatT> | |
| bool | is_orthonormal (const MatT &mat) |
| template<typename MatT> | |
| bool | is_uniformly_scaled (const MatT &mat) |
| template<typename T, int NumCol, int NumRow> | |
| bool | is_zero (const MatBase< T, NumCol, NumRow > &mat) |
Implementation. | |
| template<typename T, int NumCol, int NumRow> | |
| bool | is_unit_scale (const MatBase< T, NumCol, NumRow > &m) |
| template<typename T, int Size> | |
| MatBase< T, Size, Size > | invert (const MatBase< T, Size, Size > &mat) |
| template<typename T, int NumCol, int NumRow, typename AngleT> | |
| MatBase< T, NumCol, NumRow > | rotate (const MatBase< T, NumCol, NumRow > &mat, const AxisAngleBase< T, AngleT > &rotation) |
| template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment> | |
| MatBase< T, NumCol, NumRow > | normalize (const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > &a) |
| template<typename T, int NumCol, int NumRow, int SrcNumCol, int SrcNumRow, int SrcStartCol, int SrcStartRow, int SrcAlignment, typename VectorT> | |
| MatBase< T, NumCol, NumRow > | normalize_and_get_size (const MatView< T, NumCol, NumRow, SrcNumCol, SrcNumRow, SrcStartCol, SrcStartRow, SrcAlignment > &a, VectorT &r_size) |
| template<typename T> | |
| QuaternionBase< T > | normalized_to_quaternion_safe (const MatBase< T, 3, 3 > &mat) |
| template<bool AllowNegativeScale, typename T, typename RotationT> | |
| void | to_loc_rot_scale_safe (const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale) |
| template<typename T> | |
| VecBase< T, 3 > | transform_direction_transposed (const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction) |
| template<typename T> | |
| VecBase< T, 3 > | transform_direction_transposed (const MatBase< T, 4, 4 > &mat, const VecBase< T, 3 > &direction) |
| template<typename T, int N, int NumRow> | |
| VecBase< T, N > | project_point (const MatBase< T, N+1, NumRow > &mat, const VecBase< T, N > &point) |
| template<typename T, int N, int NumRow> | |
| VecBase< T, N > | project_point_safe (const MatBase< T, N+1, NumRow > &mat, const VecBase< T, N > &point) |
| template float3 | transform_point (const float3x3 &mat, const float3 &point) |
| template float3 | transform_point (const float4x4 &mat, const float3 &point) |
| template float3 | transform_direction (const float3x3 &mat, const float3 &direction) |
| template float3 | transform_direction (const float4x4 &mat, const float3 &direction) |
| template float3 | project_point (const float4x4 &mat, const float3 &point) |
| template float2 | project_point (const float3x3 &mat, const float2 &point) |
| template float3 | project_point_safe (const float4x4 &mat, const float3 &point) |
| template float2 | project_point_safe (const float3x3 &mat, const float2 &point) |
Quaternion functions. | |
| template<typename T> | |
| T | dot (const QuaternionBase< T > &a, const QuaternionBase< T > &b) |
| template<typename T> | |
| QuaternionBase< T > | pow (const QuaternionBase< T > &q, const T &y) |
| template<typename T> | |
| QuaternionBase< T > | conjugate (const QuaternionBase< T > &a) |
| template<typename T> | |
| QuaternionBase< T > | canonicalize (const QuaternionBase< T > &q) |
| template<typename T> | |
| QuaternionBase< T > | invert (const QuaternionBase< T > &q) |
| template<typename T> | |
| QuaternionBase< T > | invert_normalized (const QuaternionBase< T > &q) |
| template<typename T> | |
| QuaternionBase< T > | normalize (const QuaternionBase< T > &q) |
| template<typename T> | |
| QuaternionBase< T > | normalize_and_get_length (const QuaternionBase< T > &q, T &out_length) |
| template<typename T> | |
| QuaternionBase< T > | interpolate (const QuaternionBase< T > &a, const QuaternionBase< T > &b, T t) |
Test functions. | |
| template<typename T> | |
| bool | is_zero (const QuaternionBase< T > &q) |
| template<typename T> | |
| bool | is_equal (const QuaternionBase< T > &a, const QuaternionBase< T > &b, const T epsilon=T(0)) |
| template<typename T> | |
| bool | is_unit_scale (const QuaternionBase< T > &q) |
Quaternion | |
| template<typename T> | |
| VecBase< T, 2 > | interpolate_dot_slerp (const T t, const T cosom) |
Dual-Quaternion | |
| template<typename T> | |
| DualQuaternionBase< T > | normalize (const DualQuaternionBase< T > &dual_quat) |
| template<typename T> | |
| VecBase< T, 3 > | transform_point (const DualQuaternionBase< T > &dq, const VecBase< T, 3 > &point, MatBase< T, 3, 3 > *r_crazy_space_mat=nullptr) |
| template<typename T> | |
| DualQuaternionBase< T > | to_dual_quaternion (const MatBase< T, 4, 4 > &mat, const MatBase< T, 4, 4 > &basemat) |
| template<typename T> | |
| bool | is_normalized (const DualQuaternionBase< T > &dq) |
Rotation helpers | |
| template<typename T, typename RotT> | |
| QuaternionBase< T > | rotate (const QuaternionBase< T > &a, const RotT &b) |
| template<typename T, typename RotT, typename AngleT> | |
| AxisAngleBase< T, AngleT > | rotate (const AxisAngleBase< T, AngleT > &a, const RotT &b) |
| template<typename T, typename RotT> | |
| EulerXYZBase< T > | rotate (const EulerXYZBase< T > &a, const RotT &b) |
| template<typename T, typename RotT> | |
| Euler3Base< T > | rotate (const Euler3Base< T > &a, const RotT &b) |
| template<typename T> | |
| QuaternionBase< T > | rotation_between (const QuaternionBase< T > &a, const QuaternionBase< T > &b) |
| template<typename T> | |
| QuaternionBase< T > | from_triangle (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const VecBase< T, 3 > &normal) |
| template<typename T> | |
| QuaternionBase< T > | from_triangle (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3) |
| template<typename T> | |
| QuaternionBase< T > | from_vector (const VecBase< T, 3 > &vector, const AxisSigned track_flag, const Axis up_flag) |
| template<typename T> | |
| QuaternionBase< T > | from_tracking (AxisSigned forward_axis, Axis up_axis) |
| template<typename T> | |
| MatBase< T, 3, 3 > | to_gimbal_axis (const Euler3Base< T > &rotation) |
Angles | |
| template<typename T> | |
| AngleRadianBase< T > | angle_of (const QuaternionBase< T > &q) |
| template<typename T> | |
| AngleRadianBase< T > | angle_of_signed (const QuaternionBase< T > &q) |
| template<typename T> | |
| AngleRadianBase< T > | angle_between (const QuaternionBase< T > &a, const QuaternionBase< T > &b) |
| template<typename T> | |
| AngleRadianBase< T > | angle_between (const VecBase< T, 3 > &a, const VecBase< T, 3 > &b) |
| template<typename T> | |
| AngleFraction< T > | angle_between (const AxisSigned a, const AxisSigned b) |
| template<typename T> | |
| AngleRadianBase< T > | angle_between_signed (const QuaternionBase< T > &a, const QuaternionBase< T > &b) |
| float2 | rotate_around_point_2d (const float2 p, const float2 pivot, const AngleRadian angle) |
Conversion from Cartesian Basis | |
| template<typename T> | |
| QuaternionBase< T > | to_quaternion (const CartesianBasis &rotation) |
Explicit Template Instantiations | |
| template EulerXYZ | to_euler (const AxisAngle &) |
| template EulerXYZ | to_euler (const AxisAngleCartesian &) |
| template EulerXYZ | to_euler (const Quaternion &) |
| template Euler3 | to_euler (const AxisAngle &, EulerOrder) |
| template Euler3 | to_euler (const AxisAngleCartesian &, EulerOrder) |
| template Euler3 | to_euler (const Quaternion &, EulerOrder) |
| template Quaternion | to_quaternion (const AxisAngle &) |
| template Quaternion | to_quaternion (const AxisAngleCartesian &) |
| template Quaternion | to_quaternion (const Euler3 &) |
| template Quaternion | to_quaternion (const EulerXYZ &) |
| template AxisAngleCartesian | to_axis_angle (const Euler3 &) |
| template AxisAngleCartesian | to_axis_angle (const EulerXYZ &) |
| template AxisAngleCartesian | to_axis_angle (const Quaternion &) |
Determinant | |
| template float | determinant (const float2x2 &mat) |
| template float | determinant (const float3x3 &mat) |
| template float | determinant (const float4x4 &mat) |
| template double | determinant (const double2x2 &mat) |
| template double | determinant (const double3x3 &mat) |
| template double | determinant (const double4x4 &mat) |
| template bool | is_negative (const float3x3 &mat) |
| template bool | is_negative (const float4x4 &mat) |
| template bool | is_negative (const double3x3 &mat) |
| template bool | is_negative (const double4x4 &mat) |
Adjoint | |
| template float2x2 | adjoint (const float2x2 &mat) |
| template float3x3 | adjoint (const float3x3 &mat) |
| template float4x4 | adjoint (const float4x4 &mat) |
| template double2x2 | adjoint (const double2x2 &mat) |
| template double3x3 | adjoint (const double3x3 &mat) |
| template double4x4 | adjoint (const double4x4 &mat) |
Inverse | |
| template float2x2 | invert (const float2x2 &mat, bool &r_success) |
| template float3x3 | invert (const float3x3 &mat, bool &r_success) |
| template float4x4 | invert (const float4x4 &mat, bool &r_success) |
| template double2x2 | invert (const double2x2 &mat, bool &r_success) |
| template double3x3 | invert (const double3x3 &mat, bool &r_success) |
| template double4x4 | invert (const double4x4 &mat, bool &r_success) |
| template float2x2 | pseudo_invert (const float2x2 &mat, float epsilon) |
| template float3x3 | pseudo_invert (const float3x3 &mat, float epsilon) |
| template float4x4 | pseudo_invert (const float4x4 &mat, float epsilon) |
| template double2x2 | pseudo_invert (const double2x2 &mat, double epsilon) |
| template double3x3 | pseudo_invert (const double3x3 &mat, double epsilon) |
| template double4x4 | pseudo_invert (const double4x4 &mat, double epsilon) |
Polar Decomposition | |
| template<typename T> | |
| static void | polar_decompose (const MatBase< T, 3, 3 > &mat3, MatBase< T, 3, 3 > &r_U, MatBase< T, 3, 3 > &r_P) |
Interpolate | |
| template float3x3 | interpolate (const float3x3 &a, const float3x3 &b, float t) |
| template double3x3 | interpolate (const double3x3 &a, const double3x3 &b, double t) |
| template float4x4 | interpolate (const float4x4 &a, const float4x4 &b, float t) |
| template double4x4 | interpolate (const double4x4 &a, const double4x4 &b, double t) |
| template float3x3 | interpolate_fast (const float3x3 &a, const float3x3 &b, float t) |
| template double3x3 | interpolate_fast (const double3x3 &a, const double3x3 &b, double t) |
| template float4x4 | interpolate_fast (const float4x4 &a, const float4x4 &b, float t) |
| template double4x4 | interpolate_fast (const double4x4 &a, const double4x4 &b, double t) |
Normal / Area | |
| TEST (math_geom_hh, NormalQuad) | |
| TEST (math_geom_hh, AreaTri) | |
| TEST (math_geom_hh, CotangentTriWeight) | |
Variables | |
| template<typename T> | |
| constexpr bool | is_math_float_type = std::is_floating_point_v<T> |
| template<typename T> | |
| constexpr bool | is_math_integral_type = std::is_integral_v<T> |
| static const std::array< locus_entry_t, 31 > | planck_locus |
Definition at line 724 of file BLI_math_angle_types.hh.
Definition at line 723 of file BLI_math_angle_types.hh.
Definition at line 89 of file BLI_math_axis_angle_types.hh.
Definition at line 90 of file BLI_math_axis_angle_types.hh.
Definition at line 332 of file BLI_math_quaternion_types.hh.
| using blender::math::Euler3 = Euler3Base<float> |
Definition at line 435 of file BLI_math_euler_types.hh.
| using blender::math::EulerXYZ = EulerXYZBase<float> |
Definition at line 434 of file BLI_math_euler_types.hh.
| using blender::math::Quaternion = QuaternionBase<float> |
Definition at line 331 of file BLI_math_quaternion_types.hh.
|
strong |
| Enumerator | |
|---|---|
| BSpline | |
| Mitchell | |
Definition at line 25 of file math_interp.cc.
| Enumerator | |
|---|---|
| XYZ | |
| XZY | |
| YXZ | |
| YZX | |
| ZXY | |
| ZYX | |
Definition at line 39 of file BLI_math_euler_types.hh.
|
strong |
| Enumerator | |
|---|---|
| Box | |
| Tent | |
| Quad | |
| Cubic | |
| Catrom | |
| Gauss | |
| Mitch | |
Definition at line 13 of file BLI_math_filter.hh.
|
strong |
Texture coordinate wrapping mode.
| Enumerator | |
|---|---|
| Extend | Image edges are extended outside the image, i.e. sample coordinates are clamped to the edge. |
| Repeat | Image repeats, i.e. sample coordinates are wrapped around. |
| Border | Samples outside the image return transparent black. |
Definition at line 37 of file BLI_math_interp.hh.
|
inline |
Definition at line 201 of file BLI_math_basis_types.hh.
References abs(), and blender::math::AxisSigned::axis().
Definition at line 33 of file BLI_math_base.hh.
Referenced by abs(), abs(), abs(), blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), almost_equal_relative(), angle_between(), blender::math::AngleCartesianBase< float >::AngleCartesianBase(), blender::apply_stroke_transform(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::ed::sculpt_paint::pose::calc_squash_stretch_deform(), blender::bke::pbvh::pixels::can_be_extended(), blender::math::CartesianBasis::CartesianBasis(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), blender::ed::curves::clamp_to_zero(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_diameter_of_circle_of_confusion(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::convexhull_2d_angle_iter_init(), cross(), blender::ed::greasepencil::decode_index(), blender::ed::greasepencil::segment::decode_index(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), blender::nodes::node_composite_difference_key_cc::difference_matte(), dominant_axis(), blender::ED_view3d_effective_flip_axis(), blender::imbuf::transform::edge_aa(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::find_envelope(), blender::compositor::find_scale_factor(), blender::ed::spreadsheet::format_matrix_to_grid(), from_orthonormal_axes(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::generate_vert_coordinates(), blender::get_factor_from_draw_speed(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::get_structuring_element_size(), blender::compositor::horizontal_pass_cpu(), blender::compositor::horizontal_pass_gpu(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), interpolate_dot_slerp(), blender::xpbd::intersect_plane(), is_equal(), is_equal(), is_equal(), blender::nodes::node_composite_vector_blur_cc::is_inside_motion_line(), is_orthogonal(), is_orthonormal(), is_similarity_transform(), is_uniformly_scaled(), is_unit(), is_unit_scale(), is_unit_scale(), is_zero(), blender::jpeg_density_from_ppm(), length_manhattan(), blender::geometry::geom::make_unit_square_map(), mod_periodic(), blender::compositor::morphological_distance(), blender::compositor::morphological_distance_gpu(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::geometry::geom::nearly_parallel(), blender::geometry::construct::nearly_parallel_normalized(), blender::ed::sculpt_paint::node_in_box(), blender::math::detail::normalized_to_quat_fast(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::geometry::construct::pipe_test(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), project_point(), project_point_safe(), blender::seq::query_thumbnail(), blender::math::AngleFraction< T >::radian(), blender::fn::multi_function::register_common_functions_impl(), rotation_between(), rotation_between(), blender::ed::vse::sequencer_snap_exec(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::Bounds< T >::size(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::ed::transform::snap_object_context_runtime_init(), blender::geometry::construct::snap_to_superellipsoid(), blender::compositor::spectral_bokeh(), blender::eevee::IrradianceBake::surfels_create(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), blender::gpu::tests::test_mipmap_partial_matches_full(), to_axis_angle(), to_vector(), blender::transform_mpath_point_to_camera(), blender::geometry::construct::tri_corner_test(), blender::compositor::vertical_pass_cpu(), blender::compositor::vertical_pass_gpu(), blender::view3d_panel_curve_data(), and blender::math::AngleFraction< T >::wrapped().
|
inlinenodiscard |
Definition at line 38 of file BLI_math_vector.hh.
References abs(), and blender::result.
Definition at line 189 of file BLI_math_base.hh.
Referenced by acos(), blender::noise::compute_3d_orientation(), interpolate_dot_slerp(), and safe_acos().
|
nodiscard |
Returns the adjoint of the matrix (also known as adjugate matrix).
Definition at line 165 of file math_matrix.cc.
References adjoint(), determinant(), T, and blender::unroll().
Referenced by adjoint(), adjoint(), adjoint(), adjoint(), adjoint(), adjoint(), and adjoint().
|
inlinenodiscard |
Returns true if the given vectors are equal within the given epsilon. The epsilon is scaled for each component by magnitude of the matching component of a.
Definition at line 25 of file BLI_math_vector.hh.
References abs(), almost_equal_relative(), b, distance(), and T.
Referenced by almost_equal_relative(), blender::bke::CurvesGeometry::evaluated_tangents(), and blender::io::grease_pencil::extend_curves_geometry().
|
nodiscard |
Definition at line 165 of file BLI_math_rotation.hh.
References abs(), angle_between(), b, blender::math::AngleFraction< T >::identity(), and blender::math::AngleFraction< T >::pi().
|
nodiscard |
Extract angle between 2 orientations. For Quaternion, the returned angle is in [0..2pi] range. For other types, the returned angle is in [0..pi] range. See angle_of for more detail.
Definition at line 152 of file BLI_math_rotation.hh.
References angle_between(), angle_of(), b, and rotation_between().
Referenced by angle_between(), angle_between(), angle_between(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::geometry::extend_curve_curved(), blender::geometry::geom::make_unit_square_map(), blender::geometry::geom::nearly_parallel(), blender::geometry::geom::offset_meet(), blender::geometry::construct::pipe_test(), blender::geometry::geom::point_between_edges(), blender::geometry::construct::square_out_adj_vmesh(), blender::math::tests::TEST(), blender::geometry::construct::tri_corner_test(), and blender::bke::pbvh::uv_islands::UVBorderCorner::uv().
|
nodiscard |
Definition at line 158 of file BLI_math_rotation.hh.
References angle_between(), b, blender::BLI_assert(), dot(), is_unit_scale(), and safe_acos().
|
nodiscard |
Extract angle between 2 orientations. Returned angle is in [-pi..pi] range. See angle_of_signed for more detail.
Definition at line 182 of file BLI_math_rotation.hh.
References angle_between_signed(), angle_of_signed(), b, and rotation_between().
Referenced by angle_between_signed(), and blender::math::tests::TEST().
|
nodiscard |
Extract rotation angle from a unit quaternion. Returned angle is in [0..2pi] range.
Unlike the angle between vectors, this does NOT return the shortest angle. See angle_of_signed below for this.
Definition at line 125 of file BLI_math_rotation.hh.
References angle_of(), blender::BLI_assert(), is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.
Referenced by angle_between(), angle_of(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), and blender::math::tests::TEST().
|
nodiscard |
Extract rotation angle from a unit quaternion. Always return the shortest angle. Returned angle is in [-pi..pi] range.
angle_of with quaternion can exceed PI radians. Having signed versions of these functions allows to use 'abs(angle_of_signed(...))' to get the shortest angle between quaternions with higher precision than subtracting 2pi afterwards.
Definition at line 139 of file BLI_math_rotation.hh.
References angle_of_signed(), blender::BLI_assert(), is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.
Referenced by angle_between_signed(), angle_of_signed(), and blender::math::tests::TEST().
Compute the area of a 2D polygon given its vertices.
Definition at line 390 of file BLI_math_geom.hh.
References area_poly(), blender::area_poly_v2(), blender::Span< T >::data(), and blender::Span< T >::size().
Referenced by area_poly(), and TEST().
|
inlinenodiscard |
Compute the area of a triangle (v1, v2, v3) in 3D space.
Definition at line 44 of file BLI_math_geom.hh.
References area_tri(), cross(), length(), T, and blender::v2.
Referenced by area_tri(), and TEST().
Definition at line 263 of file BLI_math_base.hh.
Referenced by atan(), and blender::tests::TEST().
Definition at line 268 of file BLI_math_base.hh.
References atan2(), T, blender::x, and y.
Referenced by blender::math::AngleRadianBase< float >::AngleRadianBase(), atan2(), blender::compositor::bokeh(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), from_triangle(), blender::noise::gabor(), blender::noise::gabor(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), blender::math::detail::normalized_to_eul2(), blender::math::detail::normalized_to_eul2(), blender::math::AngleCartesianBase< float >::operator float(), blender::bke::greasepencil::Drawing::set_texture_matrices(), to_quaternion_legacy(), and blender::write_fill_transforms().
|
inlinenodiscard |
Definition at line 729 of file BLI_math_vector.hh.
References average(), reduce_add(), and T.
Referenced by average(), blender::ed::greasepencil::create_curves_outline(), blender::ed::greasepencil::image_render::create_shader_ubo(), blender::ed::greasepencil::image_render::draw_circles(), blender::ed::greasepencil::image_render::draw_dots(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::io::grease_pencil::shape_attributes_to_curves(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
Build a 3x3 matrix whose rows map 3D coordinates so that the dominant two axes of normal become the X and Y columns, allowing vectors to be projected into the plane of normal.
| normal | A unit-length vector. |
Definition at line 224 of file BLI_math_geom.hh.
References axis_dominant_to_m3(), and blender::axis_dominant_v3_to_m3().
Referenced by axis_dominant_to_m3(), blender::geometry::construct::compute_face_interp_weights(), blender::geometry::construct::face_point_inside_test(), blender::geometry::construct::projected_boundary_area(), and TEST().
|
inlinenodiscard |
Compute the barycentric weights of point co with respect to triangle (v1, v2, v3) in 2D.
Definition at line 355 of file BLI_math_geom.hh.
References barycentric_weights(), blender::barycentric_weights_v2(), blender::v2, and w().
Referenced by barycentric_weights(), and TEST().
| BLI_INLINE void blender::math::bicubic_interpolation | ( | const T * | src_buffer, |
| T * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| InterpWrapMode | wrap_u, | ||
| InterpWrapMode | wrap_v ) |
Definition at line 108 of file math_interp.cc.
References bicubic_interpolation(), blender::BLI_assert(), BLI_INLINE, blender::copy_v2_v2(), blender::copy_v3_v3(), blender::copy_v4_v4(), cubic_filter_coefficients(), blender::data, Extend, floor(), max(), min(), Mitchell, blender::gpu::shader::metadata::out, output, T, blender::v, w(), and wrap_coord().
Referenced by bicubic_interpolation(), interpolate_cubic_bspline_byte(), interpolate_cubic_bspline_fl(), interpolate_cubic_bspline_fl(), interpolate_cubic_bspline_wrapmode_fl(), interpolate_cubic_mitchell_byte(), interpolate_cubic_mitchell_fl(), and interpolate_cubic_mitchell_fl().
| BLI_INLINE uchar4 blender::math::bilinear_byte_impl | ( | const uchar * | buffer, |
| int | width, | ||
| int | height, | ||
| float | u, | ||
| float | v ) |
Definition at line 225 of file math_interp.cc.
References b, bilinear_byte_impl(), blender::BLI_assert(), BLI_INLINE, clamp(), floorf, and blender::v.
Referenced by bilinear_byte_impl(), interpolate_bilinear_border_byte(), and interpolate_bilinear_byte().
|
inlinenodiscard |
Negate the quaternion if real component (w) is negative.
Definition at line 229 of file BLI_math_quaternion.hh.
References canonicalize(), T, and blender::math::QuaternionBase< T >::w.
Referenced by canonicalize(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), blender::math::QuaternionBase< T >::twist(), and blender::math::QuaternionBase< T >::twist_angle().
Definition at line 138 of file BLI_math_base.hh.
Referenced by blender::bke::compositor::add_passes_used_by_cryptomatte_node(), blender::seq::apply_word_wrapping(), blender::seq::calc_boundbox(), ceil(), ceil(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::deform_drawing(), blender::compositor::deriche_gaussian_blur(), blender::ed::vse::draw_strip_thumbnails(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), blender::geometry::extend_curve_curved(), blender::geometry::extend_curve_straight(), blender::geometry::extend_curves(), blender::seq::final_image_cache_invalidate_frame_range(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::get_layers_from_render(), blender::TimeMapping::local_frame_after_scene_frame(), blender::eevee::Film::overscan_pixels_get(), blender::compositor::Domain::realize_transformation(), blender::fn::multi_function::register_common_functions_impl(), blender::geometry::sample_curve_padded(), blender::TimeMapping::scene_frame_after_local_frame(), blender::compositor::symmetric_separable_blur(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::compositor::SymmetricSeparableBlurWeights::SymmetricSeparableBlurWeights(), blender::table_sample(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::compositor::van_vliet_gaussian_blur(), and blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value().
|
inlinenodiscard |
Definition at line 370 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and ceil().
|
inlinenodiscard |
Returns a if it is a multiple of b or the next multiple or b after a . In other words, it is equivalent to divide_ceil(a, b) * b. It is undefined if a is negative or b is not strictly positive.
Definition at line 302 of file BLI_math_vector.hh.
References b, blender::BLI_assert(), ceil_to_multiple(), and blender::result.
Referenced by ceil_to_multiple(), blender::eevee::DepthOfField::render(), blender::eevee::RayTraceModule::render(), blender::eevee::DepthOfField::sync(), blender::eevee::HiZBuffer::sync(), and blender::tests::TEST().
| float3x3 blender::math::chromatic_adaption_matrix | ( | const float3 & | from_XYZ, |
| const float3 & | to_XYZ ) |
Definition at line 996 of file math_color.cc.
References chromatic_adaption_matrix(), from_scale(), and invert().
Referenced by blender::ocio::calculate_white_point_matrix(), chromatic_adaption_matrix(), blender::nodes::node_composite_color_balance_cc::get_white_point_matrix(), and blender::nodes::node_composite_color_balance_cc::white_point_variable().
Definition at line 69 of file BLI_math_base.hh.
References clamp(), max(), min(), and T.
Referenced by blender::nodes::node_composite_alpha_over_cc::alpha_over(), blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::seq::HueCorrectApplyOp::apply(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), bilinear_byte_impl(), blender::nodes::node_composite_box_mask_cc::box_mask(), blender::imbuf::transform::calc_coverage(), blender::calc_min_radius_v3v3(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::call(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::call(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), clamp(), clamp(), clamp(), blender::seq::clamp_rect(), blender::xpbd::closest_on_segment_to_ray(), blender::ed::sculpt_paint::color::color_filter_task(), blender::nodes::node_composite_crop_cc::CropOperation::compute_cropping_bounds(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_scale_cpu(), blender::compositor::compute_marker_points(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::create_envelope_stroke_for_point(), blender::nodes::node_composite_rgb_curves_cc::curves_rgba(), blender::io::gsplat::OriginalActivationFunctions::decode_opacity(), blender::deform_drawing(), blender::nodes::node_composite_vector_blur_cc::depth_compare(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::do_version_glare_node_options_to_inputs(), blender::draw_current_frame(), blender::draw::drw_particle_get_hair_source(), blender::nodes::node_composite_ellipse_mask_cc::ellipse_mask(), blender::nodes::node_composite_time_curves_cc::TimeCurveOperation::execute(), blender::geometry::extend_curve_curved(), blender::seq::fill_rect_alpha_under(), blender::ed::greasepencil::fit_strokes_to_view(), blender::ed::vse::ScopeHistogram::float_to_bin(), float_to_half_clamp_array(), blender::seq::freeze_key_pair_create(), blender::noise::gabor(), blender::noise::gabor(), blender::ed::greasepencil::get_active_frame_for_falloff(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_black_level(), blender::get_build_factor(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_catadioptric_size(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_center(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_chromatic_adaptation(), blender::nodes::node_composite_glare_cc::GlareOperation::get_color_modulation(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_color_shift(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_corner_rounding(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_despill_balance(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_eccentricity(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_edge_tolerance(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_glare_cc::GlareOperation::get_fade(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_flaps(), blender::nodes::node_composite_glare_cc::GlareOperation::get_jitter_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_key_balance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_light_adaptation(), blender::nodes::node_composite_mask_cc::MaskOperation::get_motion_blur_samples(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::get_motion_blur_samples(), blender::nodes::node_composite_mask_cc::MaskOperation::get_motion_blur_shutter(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::get_motion_blur_shutter(), blender::nodes::node_sh_mix_cc::get_multi_function(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::get_neighbor_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::get_number_of_iterations(), blender::nodes::node_composite_glare_cc::GlareOperation::get_number_of_streaks(), blender::nodes::node_composite_bokeh_image_cc::BokehImageOperation::get_roundness(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_samples(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::get_samples_count(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_sharpness(), blender::nodes::node_composite_glare_cc::GlareOperation::get_size(), blender::nodes::node_composite_keying_screen_cc::KeyingScreenOperation::get_smoothness(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_threshold(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_translation_amount(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_white_level(), blender::nodes::gizmos::gizmo_node_split_prop_matrix_set(), blender::draw::grease_pencil_weight_batch_ensure(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::imb_working_space_convert(), blender::seq::initialize_shadow_alpha(), blender::isect_vert_calc_z(), blender::ed::curves::pen_tool::line_segment_closest_point(), blender::compositor::Result::load_pixel_extended(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::ed::sculpt_paint::node_in_sphere(), blender::ed::greasepencil::normalize_vertex_weights_try(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::openexr_jpg_like_quality_to_dwa_compression_level(), blender::draw::detail::pack_gaussian(), blender::draw::detail::pack_radiance(), blender::nodes::node_composite_posterize_cc::posterize(), blender::nodes::node_composite_alpha_over_cc::preprocess_foreground(), blender::imbuf::transform::process_scanlines(), blender::project_face_pixel(), blender::project_paint_PickColor(), blender::ed::greasepencil::randomize_opacity(), blender::fn::multi_function::register_common_functions_impl(), blender::seq::retiming_add_transition(), blender::geometry::ReverseUVSampler::sample(), blender::ed::sculpt_paint::sample_texture_paint_color(), blender::compositor::sanitize_domain_data_size(), ScalingRange::scale_to_unit(), blender::ed::vse::sequencer_draw_scopes(), blender::ed::vse::sequencer_generic_invoke_xy_guess_channel(), blender::io::fbx::set_bsdf_color_param(), blender::io::fbx::set_bsdf_float_param(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_composite_vector_blur_cc::spread_compare(), blender::tests::TEST(), blender::tests::TEST(), blender::seq::transition_fader_calc(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::version_503_camera_view_fit(), blender::ed::greasepencil::weight_sample_invoke(), whitepoint_from_temp_tint(), blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_cpu(), blender::io::ply::write_vertices(), and blender::write_weights_for_drawing().
|
inlinenodiscard |
Definition at line 131 of file BLI_math_vector.hh.
References clamp(), max(), min(), blender::result, and T.
|
inlinenodiscard |
Definition at line 119 of file BLI_math_vector.hh.
References clamp(), max(), min(), and blender::result.
|
inlinenodiscard |
Closest point on the line segment (l1, l2) to point p. Works for any number of dimensions Size.
Definition at line 110 of file BLI_math_geom.hh.
References closest_to_line_segment(), dot(), length_squared(), and T.
Referenced by closest_to_line_segment(), dist_squared_to_line_segment(), blender::geometry::construct::projected_boundary_area(), blender::geometry::construct::resolve_new_corner_interp_data(), blender::geometry::construct::snap_to_pipe_profile(), blender::geometry::construct::square_out_adj_vmesh(), and TEST().
|
inlinenodiscard |
Closest point on a plane to pt.
Definition at line 161 of file BLI_math_geom.hh.
References closest_to_plane(), length_squared(), plane_point_side(), and T.
Referenced by closest_to_plane(), blender::geometry::construct::snap_to_pipe_profile(), and TEST().
|
inlinenodiscard |
Closest point on a plane to pt, for a plane with unit-length normal.
Definition at line 147 of file BLI_math_geom.hh.
References closest_to_plane_normalized(), and dot().
Referenced by closest_to_plane_normalized(), blender::geometry::geom::offset_meet(), and TEST().
|
inlinenodiscard |
Return the conjugate of the given quaternion. If the quaternion q represent the rotation from A to B, then the conjugate of q represents the rotation from B to A.
Definition at line 223 of file BLI_math_quaternion.hh.
References conjugate(), blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
Referenced by conjugate(), blender::xpbd::evaluate_align_rotations_constraint(), from_triangle(), invert(), invert_normalized(), blender::math::tests::TEST(), to_quaternion_legacy(), and transform_point().
| T blender::math::cos | ( | const AngleCartesianBase< T > & | a | ) |
Definition at line 697 of file BLI_math_angle_types.hh.
References blender::math::AngleCartesianBase< T >::cos(), cos(), and T.
| T blender::math::cos | ( | const AngleFraction< T > & | a | ) |
Definition at line 710 of file BLI_math_angle_types.hh.
| T blender::math::cos | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 684 of file BLI_math_angle_types.hh.
References cos(), blender::math::AngleRadianBase< T >::radian(), and T.
Referenced by blender::math::AngleRadianBase< float >::AngleRadianBase(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::compositor::compute_denominator_1(), blender::compositor::compute_denominator_2(), blender::compositor::compute_denominator_3(), blender::compositor::compute_numerator_1(), blender::compositor::compute_numerator_2(), blender::compositor::compute_numerator_3(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), cos(), cos(), cos(), cos(), blender::bke::tests::GreasePencilInterpolate::create_test_shape(), blender::bke::curve_to_mesh_sweep(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_cpu(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::execute_cpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::workbench::filter_blackman_harris(), blender::geometry::profile::find_even_superellipse_chords(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_circle_from_point(), blender::ed::greasepencil::generate_corner(), blender::compositor::get_regular_polygon_vertex_position(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), blender::workbench::SceneResources::load_jitter_tx(), blender::geometry::geom::offset_meet(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), pow(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::draw::overlay::ring_vertices(), rotate(), blender::ed::sculpt_paint::greasepencil::rotate_by_angle(), blender::rotate_by_angle(), blender::math::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), and blender::write_fill_transforms().
Definition at line 174 of file BLI_math_base.hh.
|
inlinenodiscard |
Compute the cotangent of the angle at vertex v1 in the triangle (v1, v2, v3). Returns 0 for degenerate triangles.
Definition at line 56 of file BLI_math_geom.hh.
References b, cotangent_tri_weight(), cross(), dot(), length(), T, and blender::v2.
Referenced by cotangent_tri_weight(), and TEST().
|
inlinenodiscard |
Returns the cross direction from two basis direction using the right hand rule. This is much faster than true cross product if the vectors are basis vectors. Any ill-formed case will return a orthogonal axis to a but will also trigger an assert. It is better to filter these cases upstream.
Definition at line 217 of file BLI_math_basis_types.hh.
References abs(), b, BLI_assert_msg, cross(), blender::math::AxisSigned::next_after(), blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.
Referenced by blender::meshintersect::add_face_constraints(), area_tri(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::ed::sculpt_paint::boundary::bend_data_init_bmesh(), blender::ed::sculpt_paint::boundary::bend_data_init_grids(), blender::ed::sculpt_paint::boundary::bend_data_init_mesh(), blender::BKE_multires_construct_tangent_matrix(), blender::bmo_circularize_exec(), blender::bke::build_point_matrix(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::bke::curves::poly::calculate_next_normal(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::bke::mesh::corner_fan_space_define(), cotangent_tri_weight(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), cross(), cross(), cross(), cross_tri(), blender::deform_drawing(), blender::bke::curves::poly::direction_bisect(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_nudge_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::geometry::construct::edges_angle_kind(), blender::bke::subdiv::eval_limit_point_and_normal(), blender::geometry::extend_curve_curved(), from_orthonormal_axes(), from_orthonormal_axes(), from_vector(), blender::generate_curves(), blender::gizmo_ruler_draw(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), blender::xpbd::intersect_plane(), isect_point_quad(), isect_point_tri(), blender::geometry::construct::make_cube_corner_adj_vmesh(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::geometry::geom::make_unit_square_map(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::ed::sculpt_paint::node_in_box(), normal_quad(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), orthogonalize(), blender::geometry::geom::point_between_edges(), rotate_direction_around_axis(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::geometry::profile::set_profile_params(), blender::seq::strip_result_covers_strip_quad(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::geometry::construct::tri_corner_test(), and blender::bke::pbvh::TriRasterizer::TriRasterizer().
|
inlinenodiscard |
Definition at line 549 of file BLI_math_vector.hh.
|
inlinenodiscard |
Definition at line 563 of file BLI_math_vector.hh.
|
inlinenodiscard |
Same as cross(a, b) but use double float precision for the computation.
Definition at line 571 of file BLI_math_vector.hh.
References b, cross_high_precision(), and float.
Referenced by blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), cross_high_precision(), blender::damptrack_do_transform(), and blender::fn::multi_function::register_common_functions_impl().
|
inlinenodiscard |
| poly | Array of points around a polygon. They don't have to be co-planar. |
Definition at line 584 of file BLI_math_vector.hh.
References cross_poly().
Referenced by cross_poly(), and blender::get_dupliface_transform_from_coords().
|
inlinenodiscard |
Return normal vector to a triangle. The result is not normalized and can be degenerate.
Definition at line 612 of file BLI_math_vector.hh.
References cross(), cross_tri(), and blender::v2.
Referenced by cross_tri(), and normal_tri().
Definition at line 214 of file BLI_math_base.hh.
Referenced by blender::compositor::compute_fog_glow_kernel_value(), and cube().
|
static |
Definition at line 32 of file math_interp.cc.
References BSpline, cubic_filter_coefficients(), and Mitchell.
Referenced by bicubic_interpolation(), and cubic_filter_coefficients().
| template double blender::math::determinant | ( | const double2x2 & | mat | ) |
References determinant().
| template double blender::math::determinant | ( | const double3x3 & | mat | ) |
References determinant().
| template double blender::math::determinant | ( | const double4x4 & | mat | ) |
References determinant().
References determinant().
References determinant().
References determinant().
|
nodiscard |
Returns the determinant of the matrix. It can be interpreted as the signed volume (or area) of the unit cube after transformation.
Definition at line 131 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), determinant(), and T.
Referenced by adjoint(), blender::ed::object::apply_objects_internal(), blender::BKE_volume_grid_transform_valid(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), determinant(), determinant(), determinant(), determinant(), determinant(), determinant(), determinant(), blender::bke::tests::EXPECT_M3_ORTHOGONAL(), blender::grease_pencil_layer_is_skipped(), blender::IMB_colormanagement_working_space_convert(), is_negative(), blender::nodes::node_fn_matrix_determinant_cc::node_build_multi_function(), blender::nodes::node_geo_rasterize_points::node_geo_exec(), blender::math::detail::normalized_to_quat_with_checks(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::eevee::VolumeProbeModule::set_view(), blender::geometry::transform_volume(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
|
inlinenodiscard |
Squared distance from point p to the line segment (l1, l2). Works for any number of dimensions Size.
Definition at line 134 of file BLI_math_geom.hh.
References closest_to_line_segment(), dist_squared_to_line_segment(), length_squared(), and T.
Referenced by dist_squared_to_line_segment(), blender::geometry::construct::find_closer_edge(), blender::geometry::construct::projected_boundary_area(), TEST(), and TEST().
|
inlinenodiscard |
Squared distance from point p to plane.
Definition at line 176 of file BLI_math_geom.hh.
References dist_squared_to_plane(), length_squared(), plane_point_side(), and T.
Referenced by blender::geometry::construct::build_boundary_terminal_edge(), dist_squared_to_plane(), and TEST().
Definition at line 143 of file BLI_math_base.hh.
References b, distance(), and T.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), blender::length_parameterize::accumulate_lengths(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_smoothing(), blender::nodes::node_composite_glare_cc::GlareOperation::adaptive_smooth_clamp(), blender::geometry::add_curves_on_mesh(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::add_point_under_brush_to_brush_buffer(), almost_equal_relative(), blender::bmo_fit_edge_loops_to_annotation_exec(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::geometry::build_point_to_sample_map(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::trim::calc_expand_factor(), blender::seq::calc_wipe_blend(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::calculate_alignment_distance(), blender::calculate_circle_inside_fit(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::calculate_verts(), blender::nodes::node_geo_proximity_cc::ProximityFunction::call(), blender::ed::sculpt_paint::greasepencil::closest_distance_to_surface_2d(), blender::ed::sculpt_paint::cloth::cloth_brush_add_length_constraint(), blender::ed::sculpt_paint::cloth::cloth_brush_simulation_falloff_get(), blender::ed::sculpt_paint::mask::color_delta_get(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_double_edge_mask_cc::DoubleEdgeMaskOperation::compute_gradient_cpu(), blender::nodes::node_composite_lens_distortion_cc::compute_number_of_integration_steps(), blender::ed::sculpt_paint::ScaleCurvesEffect::compute_poly_curve_length(), blender::geometry::curve_constraints::compute_segment_lengths(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::ed::transform::curves::curve_connected_point_distances(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::ed::transform::curves::cyclic_curve_connected_point_distances(), blender::deform_drawing(), distance(), distance(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::distance_to_closest_point(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::dynamic_paint_paint_mesh_cell_point_cb_ex(), blender::ed::sculpt_paint::boundary::edit_data_init_bmesh(), blender::ed::sculpt_paint::boundary::edit_data_init_grids(), blender::ed::sculpt_paint::boundary::edit_data_init_mesh(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::geometry::construct::fill_profile_fracs(), blender::geometry::construct::fill_vmesh_fracs(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::ed::vse::find_closest_cursor_offset(), blender::bke::pbvh::pixels::Rows::find_copy_source(), blender::ed::greasepencil::find_curve_intersections(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::find_envelope(), blender::bke::pbvh::pixels::Rows::find_second_source(), blender::ed::space_node::find_socket_at_mouse_y(), blender::ed::space_node::find_visible_center_of_link(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::get_distance_factor(), blender::bke::greasepencil::Layer::get_frame_duration_at(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::gizmo_ruler_draw(), blender::ed::sculpt_paint::grease_pencil_fill_event_modal_map(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_modal(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), blender::ed::sculpt_paint::pose::ik_chain_origin_heads_init(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::geometry::limit_radius(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh(), blender::ed::sculpt_paint::mesh_cursor_active_draw(), blender::mesh_remap_bvh_query_nearest(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::modify_geometry_set(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::space_node::node_find_indicated_socket(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::geometry::perpendicular_distance(), blender::ed::greasepencil::polyline_fit_curve(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::sculpt_paint::raycast_init(), blender::fn::multi_function::register_common_functions_impl(), blender::reorder_strokes(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::draw::View::screen_pixel_radius(), blender::ed::sculpt_paint::screen_space_overlays_draw(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::segment_intersections_and_points_sides(), blender::ed::greasepencil::select_similar_exec(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::greasepencil::subdivide_last_segment(), blender::draw::test_draw_curves_interpolate_position(), blender::length_parameterize::tests::test_uniform_lengths(), blender::ed::sculpt_paint::transform_brush_radius(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::ed::sculpt_paint::pose::vert_inside_brush_radius(), blender::noise::voronoi_distance(), blender::noise::voronoi_distance(), blender::noise::voronoi_distance(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), and blender::wm_xr_navigation_teleport_arc_scene_intersect().
|
inlinenodiscard |
Definition at line 486 of file BLI_math_vector.hh.
References b, distance(), length(), and T.
|
inlinenodiscard |
Definition at line 474 of file BLI_math_vector.hh.
References b, distance_manhattan(), length_manhattan(), and T.
Referenced by distance_manhattan(), and blender::ed::sculpt_paint::color::sculpt_color_filter_modal().
|
inlinenodiscard |
Definition at line 480 of file BLI_math_vector.hh.
References b, distance_squared(), length_squared(), and T.
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::sculpt_paint::cloth::add_constraints_for_verts(), blender::ed::spreadsheet::apply_row_filter(), blender::BKE_shrinkwrap_find_nearest_surface(), blender::ed::transform::bm_loop_uv_calc_opposite_co(), blender::bmo_fit_edge_loops_to_annotation_exec(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::tests::brute_force_sorted(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_bmesh(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_grids(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::geometry::quad::calc_quad_directions(), blender::calculate_circle_inside_fit(), blender::calculate_verts(), blender::tests::check_duplicates(), blender::geometry::construct::closer_v3_v3v3v3(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), blender::detail::distance_squared(), distance_squared(), blender::distfactor_to_bone(), blender::bke::pbvh::edge_queue_tri_in_circle(), blender::bke::pbvh::edge_queue_tri_in_sphere(), blender::ed::sculpt_paint::fake_neighbor_search_bmesh(), blender::ed::sculpt_paint::fake_neighbor_search_grids(), blender::ed::sculpt_paint::fake_neighbor_search_mesh(), blender::find_closest_point(), blender::ed::sculpt_paint::SlideOperationExecutor::find_closest_ray_hit(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::sculpt_paint::geometry_preview_lines_update(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_bmesh(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_grids(), blender::ed::sculpt_paint::boundary::get_closest_boundary_vert_mesh(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_corners(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_edges(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_points(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_tris(), blender::nodes::node_geo_sample_nearest_cc::get_closest_pointcloud_points(), blender::get_space_input_chains(), blender::ed::greasepencil::grease_pencil_primitive_event_modal_map(), blender::ed::greasepencil::grease_pencil_primitive_mouse_event(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::seq::jump_flooding_pass(), blender::layerEqual_propfloat2(), blender::nearest_tri_cb(), blender::ed::sculpt_paint::nearest_vert_calc_bmesh(), blender::ed::sculpt_paint::nearest_vert_calc_grids(), blender::ed::sculpt_paint::nearest_vert_calc_mesh(), blender::ed::sculpt_paint::node_in_sphere(), blender::bke::pbvh::node_raycast_bmesh(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::paint_smooth_stroke(), blender::ed::curves::pen_tool::pen_find_closest_edge_point(), blender::ed::curves::pen_tool::pen_find_closest_handle(), blender::ed::curves::pen_tool::pen_find_closest_point(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::primitive_check_ui_hover(), blender::project_on_mesh(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::bke::mesh_surface_sample::sample_nearest_corner(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::ed::curves::select_circle_mask(), blender::shrinkwrap_calc_nearest_vertex_cb_ex(), blender::tests::TEST(), blender::tests::TEST(), blender::uv_remove_doubles_to_selected_shared_vertex(), blender::vfont_to_curve(), blender::view3d_ruler_pick(), and blender::math::QuaternionBase< T >::wrapped_around().
|
inlinenodiscard |
Integer division that returns the ceiling, instead of flooring like normal C division. It is undefined if a is negative or b is not strictly positive.
Definition at line 319 of file BLI_math_vector.hh.
References b, blender::BLI_assert(), divide_ceil(), and blender::result.
Referenced by blender::nodes::node_composite_displace_cc::DisplaceOperation::compute_anisotropic(), blender::compositor::compute_complete_blocks(), blender::compositor::compute_complete_x_prologues(), blender::compositor::compute_complete_y_prologues(), blender::compositor::compute_dispatch_threads_at_least(), blender::compositor::compute_incomplete_prologues(), blender::nodes::node_composite_vector_blur_cc::compute_max_tile_velocity_cpu(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::compute_max_tile_velocity_gpu(), divide_ceil(), blender::eevee::LightModule::end_sync(), blender::eevee::ShadowModule::end_sync(), blender::eevee::VolumeModule::end_sync(), blender::nodes::node_composite_map_uv_cc::MapUVOperation::execute_cpu_anisotropic(), blender::nodes::node_composite_glare_cc::GlareOperation::get_glare_image_domain(), blender::eevee::VolumeModule::init(), blender::compositor::parallel_reduction_dispatch(), blender::eevee::Precompute::Precompute(), blender::eevee::DepthOfField::render(), blender::eevee::MotionBlurModule::render(), blender::eevee::RayTraceModule::render(), blender::eevee::ShadowModule::render(), blender::eevee::SubsurfaceModule::render(), blender::eevee::LookdevModule::rotate_world_probe_data(), blender::ed::vse::sequencer_draw_scopes(), blender::eevee::VolumeProbeModule::set_view(), blender::eevee::LookdevModule::store_world_probe_data(), blender::eevee::IrradianceBake::surfels_create(), blender::eevee::AmbientOcclusion::sync(), blender::eevee::DepthOfField::sync(), blender::eevee::Film::sync(), blender::eevee::HiZBuffer::sync(), blender::tests::TEST(), and blender::eevee::Film::write_viewport_compositor_passes().
Definition at line 668 of file BLI_math_vector.hh.
References abs(), b, and dominant_axis().
Referenced by blender::draw::overlay::Fluids::begin_sync(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), dominant_axis(), orthogonal(), blender::bke::partition_faces_recursively(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), and blender::bke::pbvh::pbvh_bmesh_node_split().
|
inlinenodiscard |
Dot product between two quaternions. Equivalent to vector dot product. Equivalent to component wise multiplication followed by summation of the result.
Definition at line 199 of file BLI_math_quaternion.hh.
References b, dot(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
Referenced by blender::bke::mesh::accumulate_fan_normal(), angle_between(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::bmo_circularize_exec(), blender::bmo_flatten_exec(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_grids(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::ed::sculpt_paint::calc_front_face(), blender::calc_min_radius_v3v3(), blender::ed::sculpt_paint::cloth::calc_perpendicular_pinch_forces(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::seq::calc_wipe_blend(), blender::ed::transform::calcEdgeSlide_mval_range(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::ed::greasepencil::calculate_texture_space(), blender::xpbd::closest_on_segment_to_ray(), blender::compositor::closest_point_on_line(), closest_to_line_segment(), closest_to_plane_normalized(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_rgb_to_bw_cc::color_to_luminance(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_global_adaptation_level(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), cotangent_tri_weight(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::io::fbx::create_transform_curve_data(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_vector_blur_cc::dir_compare(), blender::distfactor_to_bone(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), dot(), dot(), blender::draw::edge_factor_calc(), blender::geometry::construct::edges_angle_kind(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_lens_distortion_cc::LensDistortionOperation::execute_horizontal_distortion_cpu(), faceforward(), blender::geometry::fillet_handle_type(), blender::find_envelope(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_cut_boundary(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_corner(), blender::nodes::node_fn_compare_cc::get_multi_function(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::bke::pbvh::TriRasterizer::inside(), interpolate(), blender::ed::sculpt_paint::CutOperationExecutor::intersect_line_segment_sphere_2d(), blender::xpbd::intersect_plane(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), invert(), blender::ed::sculpt_paint::gesture::is_affected(), blender::nodes::node_composite_vector_blur_cc::is_inside_motion_line(), is_orthogonal(), blender::geometry::geom::is_outside_edge(), is_similarity_transform(), blender::isect_vert_calc_z(), length_squared(), line_point_factor(), blender::ed::curves::pen_tool::line_segment_closest_point(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::bke::mesh::mesh_edges_sharp_tag(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::geometry::construct::nearly_parallel_normalized(), blender::geometry::construct::next_edgehalf_bev(), blender::ed::sculpt_paint::node_in_box(), blender::ed::sculpt_paint::auto_mask::normal_calc(), normalize(), normalize_and_get_length(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::transform::object_project_all_view3d_ex(), blender::ed::transform::occlusion_plane_create(), blender::geometry::geom::offset_meet(), blender::math::DualQuaternionBase< T >::operator+=(), orthogonalize(), blender::geometry::perpendicular_distance(), blender::geometry::construct::pipe_test(), plane_from_point_normal(), blender::geometry::geom::point_between_edges(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), project(), blender::project_chain_to_2d(), blender::ed::sculpt_paint::project_translations(), blender::nodes::node_composite_lens_distortion_cc::radial_lens_distortion(), blender::io::spz::read_rotations(), reflect(), blender::eevee::PlanarProbe::reflection_clip_plane_get(), refract(), blender::fn::multi_function::register_common_functions_impl(), blender::io::grease_pencil::GreasePencilExporter::retrieve_objects(), rotate_direction_around_axis(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::scopes_update_cb(), blender::nodes::node_composite_levels_cc::LevelsOperation::set_output(), blender::ed::mesh::set_sharpness_by_angle_exec(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::compositor::SMAASearchDiag1(), blender::compositor::SMAASearchDiag2(), blender::ed::transform::snap_object_project_view3d_ex(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionFaceConstraintSet::solve_single(), blender::math::tests::TEST(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::ed::greasepencil::boolean::transform_plane(), blender::eevee::ForwardPipeline::transparent_add(), blender::geometry::construct::tri_corner_test(), blender::ed::transform::VertSlideData::update_active_edges(), blender::v3_dist_from_plane(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), whitepoint_to_temp_tint(), blender::wm_xr_navigation_teleport_arc_scene_intersect(), and blender::wm_xr_navigation_teleport_is_wall_hit().
|
inlinenodiscard |
Dot product between two vectors. Equivalent to component wise multiplication followed by summation of the result. Equivalent to the cosine of the angle between the two vectors if the vectors are normalized.
Definition at line 431 of file BLI_math_vector.hh.
References b, dot(), blender::result, and T.
Definition at line 219 of file BLI_math_base.hh.
References exp(), T, and blender::x.
Referenced by blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::compositor::compute_denominator_1(), blender::compositor::compute_denominator_2(), blender::compositor::compute_denominator_3(), blender::compositor::compute_denominator_4(), blender::compositor::compute_fog_glow_kernel_value(), blender::compositor::compute_numerator_1(), blender::compositor::compute_numerator_2(), blender::compositor::compute_numerator_3(), blender::io::gsplat::OriginalActivationFunctions::decode_opacity(), blender::io::gsplat::OriginalActivationFunctions::decode_scale(), exp(), exp(), half_to_float(), and blender::tests::TEST().
|
inlinenodiscard |
Definition at line 285 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, exp(), and blender::x.
|
inlinenodiscard |
Return vector if incident and reference are pointing in the same direction.
Definition at line 658 of file BLI_math_vector.hh.
References dot(), and faceforward().
Referenced by faceforward(), and blender::fn::multi_function::register_common_functions_impl().
|
inline |
Definition at line 204 of file BLI_math_base.hh.
References fallback_pow(), power(), T, and blender::x.
Referenced by blender::nodes::node_composite_color_correction_cc::color_correction(), fallback_pow(), and fallback_pow().
|
inlinenodiscard |
Return the value of x raised to the y power. The result is the given fallback if x < 0 or if x = 0 and y <= 0.
Definition at line 256 of file BLI_math_vector.hh.
References fallback_pow(), blender::result, T, blender::x, and y.
Definition at line 48 of file math_filter.cc.
References filt_catrom(), and blender::x.
Referenced by filt_catrom(), and filter_kernel_value().
Definition at line 31 of file math_filter.cc.
References filt_cubic(), and blender::x.
Referenced by filt_cubic(), and filter_kernel_value().
Definition at line 64 of file math_filter.cc.
References b, filt_mitchell(), and blender::x.
Referenced by filt_mitchell(), and filter_kernel_value().
Definition at line 17 of file math_filter.cc.
References filt_quadratic(), and blender::x.
Referenced by filt_quadratic(), and filter_kernel_value().
| float blender::math::filter_kernel_value | ( | FilterKernel | kernel, |
| float | x ) |
| x | ranges from -1 to 1. |
Definition at line 93 of file math_filter.cc.
References BLI_assert_unreachable, Box, Catrom, Cubic, expf, fabsf, filt_catrom(), filt_cubic(), filt_mitchell(), filt_quadratic(), filter_kernel_value(), Gauss, M_PI, Mitch, Quad, scale(), sqrtf, Tent, and blender::x.
Referenced by filter_kernel_value(), blender::seq::make_gaussian_blur_kernel(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), and blender::compositor::SymmetricSeparableBlurWeights::SymmetricSeparableBlurWeights().
Float (FP32) <-> Half (FP16) conversion functions.
Behavior matches hardware (x64 F16C, ARM NEON FCVT), including handling of denormals, infinities, NaNs, rounding is to nearest even, etc. When NaNs are produced, the exact bit pattern might not match hardware, but it will still be a NaN.
When compiling for ARM NEON (e.g. Apple Silicon), hardware VCVT instructions are used.
For anything involving more than a handful of numbers, prefer float_to_half_array and half_to_float_array for performance. Converts float (FP32) number to half-precision (FP16).
Definition at line 32 of file math_half.cc.
References sign(), and blender::v.
Referenced by blender::gpu::convert(), blender::convert_input_to_half_rgba(), float_to_half_array(), float_to_half_clamp_array(), and float_to_half_make_finite().
Definition at line 256 of file math_half.cc.
References float_to_half(), and length().
Referenced by blender::tests::TEST().
| void blender::math::float_to_half_clamp_array | ( | const float * | src, |
| uint16_t * | dst, | ||
| size_t | length, | ||
| float | min_value, | ||
| float | max_value ) |
Definition at line 292 of file math_half.cc.
References clamp(), float_to_half(), length(), max4(), min4(), and blender::v.
Referenced by blender::convert_input_to_half_rgba(), blender::imb_exr_write_channels(), and blender::tests::TEST().
Converts float (FP32) number to half-precision (FP16), also ensuring the result is finite.
Changes +/- infinities to +/- maximum value (65504), and NaNs to zeroes.
Definition at line 96 of file math_half.cc.
References float_to_half(), and blender::v.
Referenced by float_to_half_make_finite_array().
| void blender::math::float_to_half_make_finite_array | ( | const float * | src, |
| uint16_t * | dst, | ||
| size_t | length ) |
Definition at line 355 of file math_half.cc.
References float_to_half_make_finite(), and length().
Referenced by blender::gpu::convert_buffer(), blender::tests::TEST(), blender::gpu::GLTexture::update_sub(), and blender::gpu::MTLTexture::update_sub().
Definition at line 112 of file BLI_math_base.hh.
Referenced by bicubic_interpolation(), blender::nodes::node_shader_map_range_cc::build_vector_stepped(), blender::calculate_repetitions(), blender::noise::compute_2d_gabor_noise(), blender::noise::compute_3d_gabor_noise(), blender::ed::sculpt_paint::greasepencil::ColorGrid::coords_to_pos(), blender::deform_drawing(), blender::deform_drawing(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::geometry::extend_curve_straight(), blender::seq::final_image_cache_invalidate_frame_range(), floor(), floor(), blender::noise::floor_fraction(), blender::floored_modulo(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::TimeMapping::local_frame_before_scene_frame(), mod_periodic(), blender::nodes::node_composite_posterize_cc::posterize(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::compositor::Domain::realize_transformation(), blender::fn::multi_function::register_common_functions_impl(), blender::geometry::sample_curve_attribute(), blender::TimeMapping::scene_frame_before_local_frame(), blender::table_sample(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::eevee::Film::update_sample_table(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_f1(), blender::noise::voronoi_f1(), blender::noise::voronoi_f1(), blender::noise::voronoi_f2(), blender::noise::voronoi_f2(), blender::noise::voronoi_f2(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_smooth_f1(), blender::noise::voronoi_smooth_f1(), blender::noise::voronoi_smooth_f1(), and wrap_coord().
|
inlinenodiscard |
Definition at line 358 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and floor().
Definition at line 89 of file BLI_math_base.hh.
References b, floored_mod(), and T.
Referenced by floored_mod(), floored_mod(), and floored_mod().
|
inlinenodiscard |
Definition at line 213 of file BLI_math_vector.hh.
References b, blender::BLI_assert(), floored_mod(), blender::result, and T.
|
inlinenodiscard |
Definition at line 201 of file BLI_math_vector.hh.
References b, blender::BLI_assert(), floored_mod(), and blender::result.
Definition at line 148 of file BLI_math_base.hh.
Referenced by blender::deform_drawing(), blender::deform_drawing(), fract(), fract(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::nodes::node_composite_hue_saturation_value_cc::hue_saturation_value(), blender::nodes::node_composite_vector_blur_cc::interleaved_gradient_noise(), blender::fn::multi_function::register_common_functions_impl(), blender::eevee::VolumeModule::set_view(), and blender::table_sample().
|
inlinenodiscard |
Definition at line 419 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and fract().
|
nodiscard |
Create a rotation matrix with the angle that the given direction makes with the x axis. Assumes the direction vector is normalized.
Definition at line 1483 of file BLI_math_matrix.hh.
References blender::BLI_assert(), from_direction(), is_unit_scale(), and blender::MatBase< T, NumCol, NumRow, Alignment >::MatBase().
Referenced by blender::nodes::node_composite_chroma_key_cc::chroma_matte(), from_direction(), and rotate().
|
nodiscard |
Create a transform matrix with translation and rotation applied in this order.
Definition at line 1465 of file BLI_math_matrix.hh.
References from_loc_rot(), and from_rotation().
Referenced by from_loc_rot(), blender::draw::overlay::Axes::object_sync(), rotate(), and blender::math::tests::TEST().
|
nodiscard |
Create a transform matrix with translation, rotation and scale applied in this order.
Definition at line 1453 of file BLI_math_matrix.hh.
References from_loc_rot_scale(), from_rot_scale(), and scale().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::curves::append_primitive_curve(), blender::apply_stroke_transform(), blender::draw::overlay::Cursor::begin_sync(), blender::seq::calc_strip_transform_matrix(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::nodes::node_composite_stabilize_2d_cc::Stabilize2DOperation::execute(), blender::nodes::node_composite_transform_cc::TransformOperation::execute(), blender::bke::attribute_math::float4x4Mixer::finalize(), from_loc_rot_scale(), blender::get_rand_matrix(), blender::seq::image_transform_matrix_get(), interpolate_fast(), blender::bke::greasepencil::Layer::local_transform(), blender::bke::attribute_math::mix3(), blender::bke::attribute_math::mix4(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::nodes::node_fn_separate_transform_cc::node_eval_inverse(), blender::nodes::node_geo_transform_geometry_cc::node_geo_exec(), blender::draw::overlay::LightProbes::object_sync(), rotate(), blender::math::tests::TEST(), blender::tests::TEST(), blender::imbuf::tests::TEST_F(), and blender::geometry::transform_mesh().
|
nodiscard |
Create a transform matrix with translation and scale applied in this order.
Definition at line 1475 of file BLI_math_matrix.hh.
References from_loc_scale(), from_scale(), and scale().
Referenced by blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::ed::greasepencil::fit_strokes_to_view(), from_loc_scale(), blender::median_dims_scale_matrix_calc(), blender::draw::overlay::Fluids::object_sync(), blender::draw::overlay::GreasePencil::object_sync(), and rotate().
|
nodiscard |
Create a translation only matrix. Matrix dimensions should be at least 4 col x 3 row.
Definition at line 1422 of file BLI_math_matrix.hh.
References from_location().
Referenced by blender::compositor::CachedImage::CachedImage(), blender::seq::calc_strip_transform_matrix(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::compositor::RealizeOnDomainOperation::execute(), blender::nodes::node_composite_displace_cc::DisplaceOperation::execute(), blender::nodes::node_composite_translate_cc::TranslateOperation::execute(), from_location(), from_origin_transform(), blender::get_array_matrix(), blender::seq::input_preprocess(), blender::compositor::Domain::realize_transformation(), rotate(), blender::nodes::node_geo_scale_instances_cc::scale_instances(), blender::eevee::VolumeProbeModule::set_view(), blender::gpu::tests::test_ray_tracing_instance_mask(), blender::gpu::tests::test_ray_tracing_instance_update(), blender::nodes::node_geo_translate_instances_cc::translate_instances(), and blender::geometry::translate_volume().
|
nodiscard |
Construct a transformation that is pivoted around the given origin point. So for instance, from_origin_transform<MatT>(from_rotation(std::numbers::pi * 0.5), float2(0.0f, 2.0f)) will construct a transformation representing a 90 degree rotation around the point (0, 2).
Definition at line 1629 of file BLI_math_matrix.hh.
References from_location(), and from_origin_transform().
Referenced by blender::seq::calc_strip_transform_matrix(), from_origin_transform(), blender::seq::image_transform_matrix_get(), and rotate().
|
inlinenodiscard |
Create an CartesianBasis using two orthogonal axes. The third axis is chosen by right hand rule to follow blender coordinate system. forward is Y axis in blender coordinate system. up is Z axis in blender coordinate system.
Definition at line 405 of file BLI_math_basis_types.hh.
References abs(), blender::BLI_assert(), cross(), and from_orthonormal_axes().
Referenced by from_orthonormal_axes(), from_orthonormal_axes(), from_orthonormal_axes(), from_tracking(), blender::eevee::IrradianceBake::raylists_build(), rotate(), rotation_between(), blender::math::tests::TEST(), blender::math::tests::TEST(), and blender::math::tests::TEST().
|
nodiscard |
Create a rotation matrix from 2 basis vectors. The matrix determinant is given to be positive and it can be converted to other rotation types.
Definition at line 1491 of file BLI_math_matrix.hh.
References blender::BLI_assert(), cross(), from_orthonormal_axes(), and is_unit_scale().
|
nodiscard |
Create a transform matrix with translation and rotation from 2 basis vectors and a translation.
Definition at line 1507 of file BLI_math_matrix.hh.
References from_orthonormal_axes().
|
nodiscard |
Create a transform matrix with rotation and scale applied in this order.
Definition at line 1447 of file BLI_math_matrix.hh.
References from_rot_scale(), from_rotation(), from_scale(), and scale().
Referenced by from_loc_rot_scale(), from_rot_scale(), interpolate_fast(), and rotate().
|
nodiscard |
Create a rotation only matrix.
Definition at line 1441 of file BLI_math_matrix.hh.
References blender::math::detail::from_rotation(), and from_rotation().
Referenced by blender::draw::overlay::Cursor::begin_sync(), blender::BKE_camera_viewplane_offset_transform(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::io::usd::convert_to_z_up(), blender::ed::sculpt_paint::cursor_space_drawing_setup(), blender::io::alembic::ABCTransformWriter::do_write(), blender::drw_render_border_mask(), blender::ED_view3d_camera_view_pan(), blender::nodes::node_composite_rotate_cc::RotateOperation::execute(), blender::geometry::extend_curve_curved(), from_loc_rot(), from_rot_scale(), from_rotation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_delta_translation(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), interpolate(), blender::ed::view3d::geometry_nodes_gizmos::matrix_from_position_and_up_direction(), blender::bke::quaternion_to_float4x4(), blender::io::grease_pencil::SVGImporter::read(), rotate(), rotate(), rotate(), rotate(), rotate_around_point_2d(), blender::eevee::LookdevModule::rotate_world(), blender::math::tests::TEST(), blender::TEST(), to_dual_quaternion(), to_euler(), to_euler(), to_gimbal_axis(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::view_zoom_to_window_xy_camera().
|
nodiscard |
Create a matrix whose diagonal is defined by the given scale vector. If vector dimension is lower than matrix diagonal, the missing terms are filled with ones.
Definition at line 1430 of file BLI_math_matrix.hh.
References blender::BLI_STATIC_ASSERT(), from_scale(), blender::result, scale(), and unroll.
Referenced by blender::draw::overlay::Cursor::begin_sync(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::seq::calc_strip_transform_matrix(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), chromatic_adaption_matrix(), blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::ed::sculpt_paint::cube_tip_init(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::io::usd::USDTransformWriter::do_write(), blender::drw_shgroup_bone_custom_empty(), blender::draw::drw_volume_object_mesh_init(), blender::compositor::RealizeOnDomainOperation::execute(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_constant_size(), from_loc_scale(), from_rot_scale(), blender::math::detail::from_rotation(), from_scale(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::get_mirror_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::seq::image_transform_matrix_get(), blender::nodes::node_geo_rasterize_points::node_geo_exec(), blender::draw::overlay::Bounds::object_sync(), polar_decompose(), pseudo_invert(), blender::io::usd::USDXformReader::read_matrix(), rotate(), blender::eevee::VolumeProbeModule::set_view(), blender::draw::test_draw_manager_sync(), blender::draw::test_draw_resource_id_gen(), blender::draw::test_draw_visibility(), blender::imbuf::tests::transform_2x_smaller(), blender::imbuf::tests::transform_fractional_larger(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
|
nodiscard |
Returns a quaternion for converting local space to tracking space. This is slightly different than from_axis_conversion for legacy reasons.
Definition at line 358 of file BLI_math_rotation.hh.
References blender::math::AxisSigned::axis(), blender::math::AxisSigned::AxisSigned(), blender::BLI_assert(), from_orthonormal_axes(), from_tracking(), blender::math::QuaternionBase< T >::QuaternionBase(), rotation_between(), blender::math::AxisSigned::Y_POS, and blender::math::AxisSigned::Z_POS.
Referenced by from_tracking().
|
nodiscard |
Create a orientation from a triangle plane and the axis formed by the segment(v1, v2).
Definition at line 268 of file BLI_math_rotation.hh.
References from_triangle(), normal_tri(), and blender::v2.
|
nodiscard |
Create a orientation from a triangle plane and the axis formed by the segment(v1, v2). Takes pre-computed normal from the triangle. Used for Ngons when their normal is known.
Definition at line 234 of file BLI_math_rotation.hh.
References angle(), atan2(), conjugate(), cos(), from_triangle(), is_zero(), normalize(), safe_acos(), sin(), T, transform_point(), UNUSED_VARS, and blender::v2.
Referenced by from_triangle(), from_triangle(), and blender::math::tests::TEST().
|
nodiscard |
Create a rotation matrix from only one up axis. The other axes are chosen to always be orthogonal. The resulting matrix is a basis matrix.
Definition at line 1517 of file BLI_math_matrix.hh.
References b, blender::BLI_assert(), from_up_axis(), is_unit_scale(), sign(), square(), T, blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().
Referenced by blender::bm_vert_chain_orientation_matrix_calc(), from_up_axis(), and rotate().
|
nodiscard |
Create a rotation from a vector and a basis rotation. Used for tracking. track_flag is supposed to be #Object.trackflag up_flag is supposed to be #Object.upflag
Definition at line 276 of file BLI_math_rotation.hh.
References angle(), blender::math::Axis::as_int(), blender::math::AxisSigned::axis(), blender::math::AxisSigned::AxisSigned(), blender::math::AngleCartesianBase< T >::cos(), cross(), blender::e, eps, from_vector(), blender::math::QuaternionBase< T >::identity(), blender::math::AxisSigned::is_negative(), length(), normalize(), normalize_and_get_length(), safe_acos(), blender::math::AngleCartesianBase< T >::sin(), T, to_quaternion(), transform_point(), blender::math::Axis::X, blender::math::Axis::Y, and blender::math::Axis::Z.
Referenced by from_vector(), and blender::math::tests::TEST().
Converts half-precision (FP16) number to float (FP32).
Definition at line 113 of file math_half.cc.
References exp(), and blender::v.
Referenced by blender::gpu::convert(), blender::gpu::convert(), half_to_float_array(), blender::ViewportColorSampleSession::sample(), and blender::tests::TEST().
Definition at line 449 of file math_half.cc.
References half_to_float(), and length().
Referenced by blender::gpu::convert_buffer(), blender::tests::TEST(), and blender::tests::TEST().
Definition at line 273 of file BLI_math_base.hh.
References hypot(), T, blender::x, and y.
Referenced by hypot(), blender::math::detail::normalized_to_eul2(), and blender::math::detail::normalized_to_eul2().
|
inlinenodiscard |
Bilinear interpolation of four 3D points at parameter (u, v).
The four vertices are ordered as a bilinear patch:
| v0,v1,v2,v3 | The four corner points. |
| u | Interpolation parameter in the first direction (0..1). |
| v | Interpolation parameter in the second direction (0..1). |
Definition at line 438 of file BLI_math_geom.hh.
References interp_bilinear_quad(), T, blender::v, and blender::v2.
Referenced by interp_bilinear_quad(), and TEST().
|
inline |
Compute mean-value interpolation weights for point co inside the 2D polygon defined by verts. Writes one weight per vertex into r_weights.
| r_weights | Output weights, must have the same size as verts. |
| verts | Polygon vertices, in order. |
| co | The query point. |
Definition at line 403 of file BLI_math_geom.hh.
References blender::BLI_assert(), blender::MutableSpan< T >::data(), blender::Span< T >::data(), interp_weights_poly(), blender::interp_weights_poly_v2(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().
Referenced by blender::geometry::construct::compute_face_interp_weights(), interp_weights_poly(), and TEST().
|
inline |
Definition at line 18 of file BLI_math_color.hh.
References blender::ColorRGBA< ChannelStorageType, Space, Alpha >::a, b, blender::ColorRGBA< ChannelStorageType, Space, Alpha >::b, blender::ColorRGBA< ChannelStorageType, Space, Alpha >::g, interpolate(), and blender::ColorRGBA< ChannelStorageType, Space, Alpha >::r.
|
inline |
Definition at line 29 of file BLI_math_color.hh.
References blender::ColorRGBA< ChannelStorageType, Space, Alpha >::a, b, blender::ColorRGBA< ChannelStorageType, Space, Alpha >::b, blender::ColorRGBA< ChannelStorageType, Space, Alpha >::g, interpolate(), and blender::ColorRGBA< ChannelStorageType, Space, Alpha >::r.
| template double3x3 blender::math::interpolate | ( | const double3x3 & | a, |
| const double3x3 & | b, | ||
| double | t ) |
References b, and interpolate().
| template double4x4 blender::math::interpolate | ( | const double4x4 & | a, |
| const double4x4 & | b, | ||
| double | t ) |
References b, and interpolate().
References b, and interpolate().
References b, and interpolate().
|
nodiscard |
A polar-decomposition-based interpolation between matrix A and matrix B.
Based on "Matrix Animation and Polar Decomposition", by Ken Shoemake & Tom Duff
| a | Input matrix which is totally effective with t = 0.0. |
| b | Input matrix which is totally effective with t = 1.0. |
| t | Interpolation factor. |
Definition at line 336 of file math_matrix.cc.
References A, B, from_rotation(), interpolate(), interpolate_linear(), is_negative(), normalize(), P, polar_decompose(), T, to_quaternion(), and blender::U.
|
nodiscard |
Complete transform matrix interpolation, based on polar-decomposition-based interpolation from interpolate<T, 3, 3>.
| a | Input matrix which is totally effective with t = 0.0. |
| b | Input matrix which is totally effective with t = 1.0. |
| t | Interpolation factor. |
Definition at line 380 of file math_matrix.cc.
References A, B, interpolate(), blender::result, and T.
|
inlinenodiscard |
Use spherical interpolation between two quaternions. Always interpolate along the shortest angle.
Definition at line 304 of file BLI_math_quaternion.hh.
References b, blender::BLI_assert(), dot(), interpolate(), invert_normalized(), is_unit_scale(), pow(), and T.
|
inline |
Definition at line 279 of file BLI_math_base.hh.
References b, interpolate(), blender::result, and T.
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::nodes::node_composite_alpha_over_cc::alpha_over(), blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::apply_gradient_tint(), blender::seq::MaskSamplerDirectByte::apply_mask(), blender::seq::MaskSamplerDirectFloat::apply_mask(), blender::seq::MaskSamplerTransformedByte::apply_mask(), blender::seq::MaskSamplerTransformedFloat::apply_mask(), blender::apply_uniform_tint(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), blender::bke::armature_vert_task_with_mixer(), blender::draw::overlay::Grid::begin_sync(), blender::BKE_paint_randomize_color(), blender::animrig::blend_layer_results(), blender::bmo_flatten_exec(), blender::bmo_space_edge_loops_evenly_exec(), blender::compositor::bokeh(), blender::calc_min_radius_v3v3(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_radius_with_interpolation(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::geometry::profile::calculate_profile_segments(), blender::bke::curves::bezier::calculate_vector_handle(), blender::calculate_verts(), blender::ed::greasepencil::trim::check_segments_in_lasso(), blender::nodes::node_composite_color_balance_cc::color_balance(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::io::grease_pencil::GreasePencilExporter::compute_average_stroke_color(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_fog_glow_field_of_view(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_global_adaptation_level(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::compute_inpainting_region_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::ed::greasepencil::control_point_colors_and_sizes(), blender::bke::pbvh::pixels::copy_pixels(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::geometry::create_nurbs_to_bezier_positions(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_curve_primitive_quadratic_bezier_cc::create_quadratic_bezier_curve(), blender::nodes::node_composite_rgb_curves_cc::curves_rgba(), blender::deform_drawing(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), blender::distfactor_to_bone(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::draw::gpencil::Instance::draw(), blender::DRW_text_edit_mesh_measure_stats(), blender::ed::transform::ElementResize(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_cpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_cpu(), blender::nodes::node_composite_depth_combin_cc::ZCombineOperation::execute_single_value(), blender::geometry::extend_curve_straight(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::ed::space_node::find_bounds_by_zone_recursive(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::find_envelope(), blender::find_plane_intersection(), blender::ed::space_node::find_visible_center_of_link(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::nodes::node_sh_mix_cc::get_multi_function(), blender::nodes::node_composite_keying_screen_cc::KeyingScreenOperation::get_smoothness(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::gizmo_ruler_invoke(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::nodes::node_composite_hue_saturation_value_cc::hue_saturation_value(), blender::bke::curves::bezier::insert(), blender::ed::curves::pen_tool::insert_point_to_curve(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate(), interpolate_fast(), interpolate_fast(), interpolate_linear(), blender::ed::sculpt_paint::greasepencil::PaintOperation::interpolate_stroke_depth(), blender::length_parameterize::interpolate_to_masked(), blender::xpbd::intersect_plane(), blender::nodes::node_composite_invert_cc::invert(), blender::layerCopyValue_propfloat2(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::bke::subdiv::mesh_interpolate_position_on_edge(), blender::bke::mesh_normals_varray(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::bke::attribute_math::mix2(), blender::geometry::mix_arrays(), blender::bke::subdiv::mix_normals(), blender::compositor::morphological_distance_feather_pass(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), blender::ed::sculpt_paint::paint_smooth_stroke(), blender::geometry::perpendicular_distance(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::geometry::construct::pipe_adj_vmesh(), blender::ed::greasepencil::primitive_calculate_curve_positions(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::greasepencil::randomize_opacity(), blender::ed::greasepencil::randomize_radius(), blender::ed::greasepencil::randomize_rotation(), blender::ed::greasepencil::randomize_rotation(), rotate(), blender::bke::bSoundFrequencySampler::sample(), blender::geometry::sample_poly_curve_positions_handles(), blender::ed::sculpt_paint::color::sculpt_color_presmooth_init(), blender::ed::vse::sequencer_draw_scopes(), blender::ed::sculpt_paint::greasepencil::simplify_opacities(), blender::compositor::SMAAMovc(), blender::compositor::SMAAMovc(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::geometry::construct::square_out_adj_vmesh(), blender::table_sample(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::io::otio::value_at(), blender::nodes::node_composite_color_balance_cc::white_point_constant(), whitepoint_from_temp_tint(), whitepoint_to_temp_tint(), blender::WM_gesture_lasso_modal(), blender::wm_xr_navigation_teleport_arc_clip_to_ground(), and blender::zspan_rasterize_conservative_line().
|
inlinenodiscard |
Per component linear interpolation.
| t | interpolation factor. Return a if equal 0. Return b if equal 1. Outside of [0..1] range, use linear extrapolation. |
Definition at line 637 of file BLI_math_vector.hh.
References b, and interpolate().
|
nodiscard |
Bilinear sampling (with black border).
Takes four image samples at floor(u,v) and floor(u,v)+1, and blends them based on fractional parts of u,v. Samples outside the image are turned into transparent black.
Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.
Definition at line 368 of file math_interp.cc.
References bilinear_byte_impl(), interpolate_bilinear_border_byte(), and blender::v.
Referenced by blender::seq::MaskSamplerTransformedByte::apply_mask(), blender::imbuf::interpolate_bilinear_border_byte(), blender::imbuf::interpolate_bilinear_border_byte(), interpolate_bilinear_border_byte(), and blender::seq::MaskSamplerTransformedByte::load_mask_min().
| void blender::math::interpolate_bilinear_border_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v ) |
Definition at line 387 of file math_interp.cc.
References Border, interpolate_bilinear_border_fl(), interpolate_bilinear_wrapmode_fl(), output, and blender::v.
|
nodiscard |
Definition at line 379 of file math_interp.cc.
References Border, interpolate_bilinear_border_fl(), interpolate_bilinear_wrapmode_fl(), and blender::v.
Referenced by blender::seq::MaskSamplerTransformedFloat::apply_mask(), blender::imbuf::interpolate_bilinear_border_fl(), blender::imbuf::interpolate_bilinear_border_fl(), interpolate_bilinear_border_fl(), interpolate_bilinear_border_fl(), and blender::seq::MaskSamplerTransformedFloat::load_mask_min().
|
nodiscard |
Bilinear sampling.
Takes four image samples at floor(u,v) and floor(u,v)+1, and blends them based on fractional parts of u,v. Samples outside the image are clamped to texels at image edge.
Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.
Definition at line 374 of file math_interp.cc.
References bilinear_byte_impl(), interpolate_bilinear_byte(), and blender::v.
Referenced by blender::imbuf::interpolate_bilinear_byte(), blender::imbuf::interpolate_bilinear_byte(), interpolate_bilinear_byte(), and blender::scale_bilinear().
| void blender::math::interpolate_bilinear_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v ) |
Definition at line 409 of file math_interp.cc.
References Extend, interpolate_bilinear_fl(), interpolate_bilinear_wrapmode_fl(), output, and blender::v.
|
nodiscard |
Definition at line 401 of file math_interp.cc.
References Extend, interpolate_bilinear_fl(), interpolate_bilinear_wrapmode_fl(), and blender::v.
Referenced by blender::imbuf::interpolate_bilinear_fl(), blender::imbuf::interpolate_bilinear_fl(), interpolate_bilinear_fl(), interpolate_bilinear_fl(), blender::imbuf::transform::sample_image(), and blender::scale_bilinear().
|
nodiscard |
Wrapped bilinear sampling. (u,v) is repeated to be inside the image size, including properly wrapping samples that are right on the edges.
Definition at line 423 of file math_interp.cc.
References b, blender::BLI_assert(), floorf, interpolate_bilinear_wrap_byte(), blender::v, and wrap_coord().
Referenced by blender::imbuf::interpolate_bilinear_wrap_byte(), and interpolate_bilinear_wrap_byte().
|
nodiscard |
Definition at line 453 of file math_interp.cc.
References interpolate_bilinear_wrap_fl(), interpolate_bilinear_wrapmode_fl(), Repeat, and blender::v.
Referenced by blender::imbuf::interpolate_bilinear_wrap_fl(), and interpolate_bilinear_wrap_fl().
| BLI_INLINE void blender::math::interpolate_bilinear_wrapmode_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| InterpWrapMode | wrap_x, | ||
| InterpWrapMode | wrap_y ) |
Definition at line 290 of file BLI_math_interp.hh.
References b, blender::BLI_assert(), BLI_INLINE, Border, floorf, interpolate_bilinear_wrapmode_fl(), output, blender::v, and wrap_coord().
Referenced by interpolate_bilinear_border_fl(), interpolate_bilinear_border_fl(), interpolate_bilinear_fl(), interpolate_bilinear_fl(), interpolate_bilinear_wrap_fl(), interpolate_bilinear_wrapmode_fl(), blender::compositor::Result::sample(), blender::imbuf::transform::sample_image(), and blender::TEST().
|
nodiscard |
Cubic B-Spline sampling.
Takes 4x4 image samples at floor(u,v)-1 .. floor(u,v)+2, and blends them based on fractional parts of u,v. Uses B-Spline variant Mitchell-Netravali filter (B=1, C=0), which has no ringing but introduces quite a lot of blur. Samples outside the image are clamped to texels at image edge.
Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.
Definition at line 461 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_bspline_byte(), and blender::v.
Referenced by blender::imbuf::interpolate_cubic_bspline_byte(), blender::imbuf::interpolate_cubic_bspline_byte(), and interpolate_cubic_bspline_byte().
| void blender::math::interpolate_cubic_bspline_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v ) |
Definition at line 477 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_bspline_fl(), output, and blender::v.
|
nodiscard |
Definition at line 469 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_bspline_fl(), and blender::v.
Referenced by blender::imbuf::interpolate_cubic_bspline_fl(), blender::imbuf::interpolate_cubic_bspline_fl(), interpolate_cubic_bspline_fl(), interpolate_cubic_bspline_fl(), and blender::imbuf::transform::sample_image().
| void blender::math::interpolate_cubic_bspline_wrapmode_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| math::InterpWrapMode | wrap_u, | ||
| math::InterpWrapMode | wrap_v ) |
Definition at line 491 of file math_interp.cc.
References bicubic_interpolation(), interpolate_cubic_bspline_wrapmode_fl(), output, and blender::v.
Referenced by interpolate_cubic_bspline_wrapmode_fl(), blender::compositor::Result::sample(), and blender::TEST().
|
nodiscard |
Cubic Mitchell sampling.
Takes 4x4 image samples at floor(u,v)-1 .. floor(u,v)+2, and blends them based on fractional parts of u,v. Uses Mitchell-Netravali filter (B=C=1/3), which has a good compromise between blur and ringing. Samples outside the image are clamped to texels at image edge.
Note that you probably want to subtract 0.5 from u,v before this function, to get proper filtering.
Definition at line 505 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_mitchell_byte(), and blender::v.
Referenced by blender::imbuf::interpolate_cubic_mitchell_byte(), blender::imbuf::interpolate_cubic_mitchell_byte(), and interpolate_cubic_mitchell_byte().
| void blender::math::interpolate_cubic_mitchell_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v ) |
Definition at line 522 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_mitchell_fl(), output, and blender::v.
|
nodiscard |
Definition at line 514 of file math_interp.cc.
References bicubic_interpolation(), Extend, interpolate_cubic_mitchell_fl(), and blender::v.
Referenced by interpolate_cubic_mitchell_fl(), interpolate_cubic_mitchell_fl(), blender::imbuf::transform::sample_image(), blender::TEST(), and blender::TEST().
|
inlinenodiscard |
Generic function for implementing slerp on the [0, 1] interval (quaternions and spherical vector coords).
| t | factor in [0..1] |
| cosom | dot product from normalized quaternions. |
Definition at line 273 of file BLI_math_quaternion.hh.
References abs(), acos(), blender::BLI_assert(), blender::e, eps, IN_RANGE, IN_RANGE_INCL, interpolate_dot_slerp(), sin(), T, and w().
Referenced by interpolate_dot_slerp().
| template double3x3 blender::math::interpolate_fast | ( | const double3x3 & | a, |
| const double3x3 & | b, | ||
| double | t ) |
References b, and interpolate_fast().
| template double4x4 blender::math::interpolate_fast | ( | const double4x4 & | a, |
| const double4x4 & | b, | ||
| double | t ) |
References b, and interpolate_fast().
| template float3x3 blender::math::interpolate_fast | ( | const float3x3 & | a, |
| const float3x3 & | b, | ||
| float | t ) |
References b, and interpolate_fast().
| template float4x4 blender::math::interpolate_fast | ( | const float4x4 & | a, |
| const float4x4 & | b, | ||
| float | t ) |
References b, and interpolate_fast().
|
nodiscard |
Naive interpolation implementation, faster than polar decomposition
| a | Input matrix which is totally effective with t = 0.0. |
| b | Input matrix which is totally effective with t = 1.0. |
| t | Interpolation factor. |
Definition at line 397 of file math_matrix.cc.
References b, from_rot_scale(), interpolate(), interpolate_fast(), scale(), T, and to_rot_scale().
Referenced by interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), and rotate().
|
nodiscard |
Naive transform matrix interpolation, based on naive-decomposition-based interpolation from interpolate_fast<T, 3, 3>.
| a | Input matrix which is totally effective with t = 0.0. |
| b | Input matrix which is totally effective with t = 1.0. |
| t | Interpolation factor. |
Definition at line 416 of file math_matrix.cc.
References b, from_loc_rot_scale(), interpolate(), interpolate_fast(), scale(), T, and to_loc_rot_scale().
|
nodiscard |
Interpolate each component linearly.
Definition at line 736 of file BLI_math_matrix.hh.
References b, interpolate(), interpolate_linear(), blender::result, T, and blender::unroll().
Referenced by interpolate(), interpolate_linear(), and rotate().
|
inlinenodiscard |
Definition at line 134 of file BLI_math_interp.hh.
References interpolate_nearest_border_byte(), and blender::v.
|
inline |
Nearest (point) sampling (with black border).
Returns texel at floor(u,v) integer index. Samples outside the image are turned into transparent black.
Note that it is not "nearest to u,v coordinate", but rather with fractional part truncated (it would be "nearest" if subtracting 0.5 from input u,v).
Definition at line 114 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_border_byte(), output, blender::v, blender::x, and y.
Referenced by blender::imbuf::interpolate_nearest_border_byte(), blender::imbuf::interpolate_nearest_border_byte(), interpolate_nearest_border_byte(), and interpolate_nearest_border_byte().
|
inline |
Definition at line 142 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_border_fl(), output, blender::v, blender::x, and y.
Referenced by blender::imbuf::interpolate_nearest_border_fl(), blender::imbuf::interpolate_nearest_border_fl(), interpolate_nearest_border_fl(), interpolate_nearest_border_fl(), and blender::imbuf::transform::sample_image().
|
inlinenodiscard |
Definition at line 163 of file BLI_math_interp.hh.
References interpolate_nearest_border_fl(), and blender::v.
|
inlinenodiscard |
Definition at line 195 of file BLI_math_interp.hh.
References interpolate_nearest_byte(), and blender::v.
|
inline |
Nearest (point) sampling.
Returns texel at floor(u,v) integer index. Samples outside the image are clamped to texels at image edge.
Note that it is not "nearest to u,v coordinate", but rather with fractional part truncated (it would be "nearest" if subtracting 0.5 from input u,v).
Definition at line 181 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_byte(), output, blender::v, blender::x, and y.
Referenced by interpolate_nearest_byte(), and interpolate_nearest_byte().
|
inline |
Definition at line 203 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_fl(), output, blender::v, blender::x, and y.
Referenced by interpolate_nearest_fl(), and interpolate_nearest_fl().
|
inlinenodiscard |
Definition at line 216 of file BLI_math_interp.hh.
References interpolate_nearest_fl(), and blender::v.
|
inlinenodiscard |
Definition at line 257 of file BLI_math_interp.hh.
References interpolate_nearest_wrap_byte(), and blender::v.
|
inline |
Wrapped nearest sampling. (u,v) is repeated to be inside the image size.
Definition at line 242 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_wrap_byte(), output, blender::v, wrap_coord(), blender::x, and y.
Referenced by blender::imbuf::interpolate_nearest_wrap_byte(), interpolate_nearest_wrap_byte(), and interpolate_nearest_wrap_byte().
|
inline |
Definition at line 265 of file BLI_math_interp.hh.
References blender::BLI_assert(), blender::data, interpolate_nearest_wrap_fl(), output, blender::v, wrap_coord(), blender::x, and y.
Referenced by blender::imbuf::interpolate_nearest_wrap_fl(), interpolate_nearest_wrap_fl(), and interpolate_nearest_wrap_fl().
|
inlinenodiscard |
Definition at line 279 of file BLI_math_interp.hh.
References interpolate_nearest_wrap_fl(), and blender::v.
| BLI_INLINE void blender::math::interpolate_nearest_wrapmode_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| InterpWrapMode | wrap_u, | ||
| InterpWrapMode | wrap_v ) |
Definition at line 78 of file BLI_math_interp.hh.
References blender::BLI_assert(), BLI_INLINE, blender::data, interpolate_nearest_wrapmode_fl(), output, blender::v, wrap_coord(), blender::x, and y.
Referenced by interpolate_nearest_wrapmode_fl(), and blender::compositor::Result::sample().
|
inlinenodiscard |
Return the inverse transformation represented by the given basis. This is conceptually the equivalent to a rotation matrix transpose, but much faster.
Definition at line 460 of file BLI_math_basis_types.hh.
References blender::math::AxisSigned::axis(), invert(), blender::math::AxisSigned::is_negative(), blender::result, blender::math::Axis::X, blender::math::CartesianBasis::x(), blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, blender::math::Axis::Y, blender::math::CartesianBasis::y(), blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, blender::math::Axis::Z, blender::math::CartesianBasis::z(), blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.
Referenced by blender::ed::object::apply_objects_internal(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::BKE_grease_pencil_point_coords_apply(), blender::BKE_grease_pencil_point_coords_apply_with_mat4(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::calculate_circle_best_fit(), blender::ocio::calculate_white_point_matrix(), blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction::call(), chromatic_adaption_matrix(), blender::colormanage_update_matrices(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::nodes::node_geo_bone_info_cc::compute_bone_info(), blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::draw::View::compute_visibility(), blender::ed::sculpt_paint::cube_tip_init(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::vse::cursor_set_by_mouse_position(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::eevee::ShadowTileMap::debug_draw(), blender::nodes::node_geo_deform_curves_on_surface_cc::deform_curves(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ocio::display_as_extended_srgb(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::io::usd::USDHairWriter::do_write(), blender::ui::draw_but_VECTORSCOPE(), blender::ed::vse::draw_vectorscope_graticule(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::compositor::RealizeOnDomainOperation::execute(), blender::nodes::node_composite_stabilize_2d_cc::Stabilize2DOperation::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::bke::get_armature_deform_params(), blender::get_mirror_matrix(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ocio::LibOCIOConfig::get_xyz_to_scene_linear_matrix(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_layer_parent_set(), blender::ed::greasepencil::grease_pencil_paste_strokes_exec(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::IMB_colormanagement_file_read_post(), blender::IMB_colormanagement_undo_read_post(), blender::IMB_colormanagement_working_space_convert(), blender::imb_colormanagement_working_space_set_from_matrix(), blender::seq::input_preprocess(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), invert(), blender::ed::greasepencil::join_object_with_active(), blender::median_dims_scale_matrix_calc(), blender::ed::greasepencil::merge_layers(), blender::geometry::merge_layers(), blender::ed::sculpt_paint::brushes::multiplane_scrape_preview_draw(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_invert_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_matrix_multiply_cc::node_eval_inverse(), blender::object_grid_element_to_tangent_displacement(), blender::ed::object::object_origin_set_exec(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_projected(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_projected(), blender::draw::ObjectRef::particles_matrix(), blender::ed::curves::convert_from_particle_system::particles_to_curves(), blender::io::grease_pencil::persmat_from_camera_object(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::greasepencil::process_stroke_weights(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), pseudo_invert(), blender::ed::transform::raycastMesh(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), rotation_between(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ocio::LibOCIOView::scope_info(), blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), blender::ed::sculpt_paint::sculpt_init_mirror_clipping(), blender::sculptsession_update(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::eevee::VolumeModule::set_view(), blender::eevee::VolumeProbeModule::set_view(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::geometry::construct::snap_to_pipe_profile(), blender::ed::transform::snapCamera(), blender::ed::transform::store_transform_properties(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::draw::View::sync(), blender::eevee::Camera::sync(), ObjectMatrices::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), to_dual_quaternion(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), blender::bke::greasepencil::update_triangle_and_offsets_cache(), blender::view3d_ruler_item_mousemove(), blender::draw::volume_grid_cache_get(), blender::workbench_render_to_image(), and blender::ed::AnimTransformable::world_to_local().
References invert().
References invert().
References invert().
References invert().
References invert().
References invert().
|
nodiscard |
Definition at line 649 of file BLI_math_matrix.hh.
References invert().
|
nodiscard |
Returns the inverse of a square matrix or zero matrix on failure. r_success is optional and set to true if the matrix was inverted successfully.
Definition at line 203 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), invert(), M, R, and blender::result.
|
inlinenodiscard |
Return invert of q or identity if q is ill-formed. The invert allows quaternion division.
Definition at line 234 of file BLI_math_quaternion.hh.
References conjugate(), dot(), blender::math::QuaternionBase< T >::identity(), invert(), length_squared(), and T.
|
inlinenodiscard |
Return invert of q assuming it is a unit quaternion. In this case, the inverse is just the conjugate. conjugate(q) could be use directly, but this function shows the intent better, and asserts if q ever becomes non-unit-length.
Definition at line 244 of file BLI_math_quaternion.hh.
References blender::BLI_assert(), conjugate(), invert_normalized(), and is_unit_scale().
Referenced by blender::xpbd::evaluate_align_rotations_constraint(), interpolate(), invert_normalized(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), and blender::math::QuaternionBase< T >::wrapped_around().
Definition at line 28 of file BLI_math_base.hh.
References is_any_zero(), is_zero(), and T.
Referenced by blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::execute(), is_any_zero(), is_any_zero(), and blender::nodes::gizmos::node_gizmo_safe_calc_dims().
|
inlinenodiscard |
Returns true if at least one component is exactly equal to 0.
Definition at line 798 of file BLI_math_vector.hh.
References is_any_zero(), and T.
|
inlinenodiscard |
Returns true if matrices are equal within the given epsilon.
Definition at line 510 of file BLI_math_matrix.hh.
References abs(), b, is_equal(), and T.
Referenced by blender::bke::build_mesh_positions(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::colormanage_update_matrices(), blender::io::usd::USDTransformWriter::do_write(), blender::bke::subdiv::eval_limit_point_and_derivatives(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_cpu(), blender::IMB_colormanagement_working_space_convert(), blender::imb_colormanagement_working_space_set_from_matrix(), blender::SELECTID_Context::is_dirty(), blender::compositor::Domain::is_equal(), is_equal(), is_equal(), is_equal(), blender::compositor::Domain::realize_transformation(), blender::geometry::skip_transform(), skip_transform(), blender::geometry::construct::snap_to_pipe_profile(), transform_normals(), and transform_normals().
|
inlinenodiscard |
Returns true if the quaternions are equal within the given epsilon. Return false otherwise.
Definition at line 117 of file BLI_math_quaternion.hh.
References abs(), b, is_equal(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
inlinenodiscard |
Returns true if vectors are equal within the given epsilon.
Definition at line 766 of file BLI_math_vector.hh.
References abs(), b, is_equal(), and T.
|
inlinenodiscard |
Returns true if the matrix is exactly the identity matrix.
Definition at line 528 of file BLI_math_matrix.hh.
References is_identity().
Referenced by blender::seq::apply_modifier_op(), and is_identity().
| template bool blender::math::is_negative | ( | const double3x3 & | mat | ) |
References is_negative().
| template bool blender::math::is_negative | ( | const double4x4 & | mat | ) |
References is_negative().
| template bool blender::math::is_negative | ( | const float3x3 & | mat | ) |
References is_negative().
| template bool blender::math::is_negative | ( | const float4x4 & | mat | ) |
References is_negative().
Returns true if matrix has inverted handedness.
Definition at line 143 of file math_matrix.cc.
References determinant(), is_negative(), and T.
Referenced by blender::geometry::execute_realize_mesh_tasks(), interpolate(), is_negative(), is_negative(), is_negative(), is_negative(), is_negative(), is_negative(), blender::geometry::boolean::mesh_bm_concat(), blender::math::detail::normalized_to_quat_fast(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::math::AngleFraction< T >::radian(), to_dual_quaternion(), to_rot_scale(), to_rot_scale(), to_scale(), and to_scale().
Definition at line 148 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), is_negative(), and T.
|
inlinenodiscard |
Returns true if the DualQuaternion has not been mixed with other DualQuaternion and needs no normalization.
Definition at line 301 of file BLI_math_quaternion_types.hh.
References is_normalized(), blender::math::DualQuaternionBase< T >::quat_weight, and T.
Referenced by blender::math::detail::from_rotation(), is_normalized(), and transform_point().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other.
Definition at line 543 of file BLI_math_matrix.hh.
References abs(), dot(), and is_orthogonal().
Referenced by is_orthogonal(), is_orthonormal(), and is_uniformly_scaled().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other and unit length.
Definition at line 560 of file BLI_math_matrix.hh.
References abs(), is_orthogonal(), is_orthonormal(), and length_squared().
Referenced by blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), is_orthonormal(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), and to_dual_quaternion().
| bool blender::math::is_similarity_transform | ( | const MatBase< T, 3, 3 > & | matrix, |
| const T & | epsilon = 1e-6 ) |
Check that each column is orthogonal to the others, and that each column is the same length. In other words, there is no shear, and any scaling is uniform.
Definition at line 528 of file math_matrix.cc.
References abs(), dot(), blender::e, is_similarity_transform(), length_squared(), and T.
Referenced by is_similarity_transform(), transform_normals(), and transform_normals().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other and the same length.
Definition at line 580 of file BLI_math_matrix.hh.
References abs(), blender::e, eps, is_orthogonal(), is_uniformly_scaled(), length_squared(), T, blender::x, y, and z().
Referenced by is_uniformly_scaled().
|
inlinenodiscard |
Return true if the squared length of the vector is (almost) equal to 1 (with a 10 * std::numeric_limits<T>::epsilon() epsilon error by default).
Definition at line 813 of file BLI_math_vector.hh.
References abs(), is_unit(), length(), length_squared(), and T.
Referenced by blender::xpbd::closest_on_segment_to_ray(), blender::xpbd::intersect_plane(), is_unit(), rotate_direction_around_axis(), and blender::xpbd::CollisionEdgeConstraintSet::solve_single().
|
inlinenodiscard |
Definition at line 638 of file BLI_math_matrix.hh.
References is_unit_scale().
Referenced by angle_between(), angle_of(), angle_of_signed(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::math::DualQuaternionBase< T >::DualQuaternionBase(), blender::math::DualQuaternionBase< T >::DualQuaternionBase(), blender::math::QuaternionBase< T >::expmap(), from_direction(), from_orthonormal_axes(), blender::math::detail::from_rotation(), from_up_axis(), interpolate(), invert_normalized(), is_unit_scale(), is_unit_scale(), is_unit_scale(), blender::ed::view3d::geometry_nodes_gizmos::matrix_from_position_and_up_direction(), blender::math::detail::normalized_to_angle(), blender::math::detail::normalized_to_eul2(), blender::math::detail::normalized_to_eul2(), blender::math::detail::normalized_to_quat_fast(), pow(), reflect(), to_axis_angle(), to_euler(), to_euler(), to_quaternion(), transform_point(), and blender::math::QuaternionBase< T >::wrapped_around().
|
inlinenodiscard |
Definition at line 125 of file BLI_math_quaternion.hh.
References abs(), is_unit_scale(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
inlinenodiscard |
Return true if each individual column is unit scaled. Mainly for assert usage.
Definition at line 463 of file BLI_math_vector.hh.
References abs(), is_unit_scale(), length_squared(), T, blender::v, and blender::math::AssertUnitEpsilon< T >::value.
|
inline |
Definition at line 594 of file BLI_math_matrix.hh.
References is_zero().
|
inlinenodiscard |
Returns true if all components are exactly equal to 0.
Definition at line 108 of file BLI_math_quaternion.hh.
References is_zero(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
Definition at line 23 of file BLI_math_base.hh.
Referenced by blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_fixed_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::cloth::apply_filter_forces_bmesh(), blender::ed::sculpt_paint::cloth::apply_filter_forces_grids(), blender::ed::sculpt_paint::cloth::apply_filter_forces_mesh(), blender::apply_stroke_transform(), blender::bmo_flatten_exec(), blender::ed::sculpt_paint::calc_brush_node_mask(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask(), blender::calc_radius_limit(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_bmesh(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_faces(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_grids(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::geometry::profile::calculate_profile_segments(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::transform::drawEdgeSlide(), blender::ed::transform::edge_slide_snap_apply(), blender::bke::subdiv::eval_limit_point_and_derivatives(), blender::geometry::extend_curve_straight(), blender::bke::mesh::face_normal_calc(), blender::geometry::fillet_handle_type(), blender::find_envelope(), blender::bke::float2_to_bool(), blender::bke::float3_to_bool(), blender::bke::float4_to_bool(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::nodes::node_fn_axes_to_rotation_cc::get_orthogonal_of_non_zero_vector(), blender::IMB_colormanagement_working_space_convert(), blender::IMB_colormanagement_working_space_convert(), blender::imb_colormanagement_working_space_init_startup(), blender::imb_colormanagement_working_space_set_from_file(), blender::bke::int2_to_bool(), blender::bke::int3_to_bool(), is_any_zero(), is_zero(), is_zero(), is_zero(), is_zero(), blender::knife_constrain_axis(), blender::geometry::geom::make_unit_square_map(), blender::bke::mesh_translate(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::transform::mouse_delta_to_world_dir(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::ed::transform::node_snap_grid_apply(), blender::ed::sculpt_paint::pbvh_gather_generic_cube(), blender::geometry::perpendicular_distance(), blender::point_in_slice(), project(), rotate_direction_around_axis(), blender::bke::rotate_directions_around_axes(), blender::bke::short2_to_bool(), blender::bke::CurvesGeometry::translate(), blender::geometry::translate_geometry(), blender::geometry::translate_pointcloud(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), and blender::geometry::zero_degenerate_radii().
|
inlinenodiscard |
Return true if the absolute values of all components are smaller than given epsilon (0 by default).
Definition at line 785 of file BLI_math_vector.hh.
|
inlinenodiscard |
Find the closest points between two infinite 3D lines.
| v1,v2 | Two points on line A. |
| v3,v4 | Two points on line B. |
| r_i1 | Closest point on line A to line B. |
| r_i2 | Closest point on line B to line A. |
Definition at line 249 of file BLI_math_geom.hh.
References isect_line_line(), blender::isect_line_line_v3(), and blender::v2.
Referenced by blender::calculate_verts(), isect_line_line(), blender::geometry::geom::offset_meet(), blender::geometry::profile::project_to_edge(), blender::geometry::profile::set_profile_params(), blender::geometry::construct::square_out_adj_vmesh(), and TEST().
|
inlinenodiscard |
Intersect the infinite line through (l1, l2) with the plane defined by point plane_co and (not necessarily unit) normal plane_no.
Definition at line 266 of file BLI_math_geom.hh.
References isect_line_plane(), and blender::isect_line_plane_v3().
Referenced by blender::geometry::construct::adjust_miter_coords(), blender::geometry::profile::calculate_profile_segments(), isect_line_plane(), and TEST().
Test whether point pt lies inside a polygon in 2D. Uses the ray-casting method.
| verts | The polygon vertices, in order (CW or CCW). |
Definition at line 339 of file BLI_math_geom.hh.
References blender::Span< T >::data(), isect_point_poly(), blender::isect_point_poly_v2(), and blender::Span< T >::size().
Referenced by blender::edbm_mesh_knife_point_isect(), blender::geometry::construct::face_point_inside_test(), isect_point_poly(), and TEST().
|
inlinenodiscard |
Test whether point p lies inside the convex quad (v1, v2, v3, v4) in 2D.
Definition at line 313 of file BLI_math_geom.hh.
References cross(), isect_point_quad(), T, and blender::v2.
Referenced by isect_point_quad(), and TEST().
|
inlinenodiscard |
Test whether point pt lies inside the triangle (v1, v2, v3) in 2D.
Definition at line 287 of file BLI_math_geom.hh.
References cross(), isect_point_tri(), T, and blender::v2.
Referenced by isect_point_tri(), and TEST().
| isect_result< double2 > blender::math::isect_seg_seg | ( | const double2 & | v1, |
| const double2 & | v2, | ||
| const double2 & | v3, | ||
| const double2 & | v4 ) |
Definition at line 46 of file math_vec.cc.
References isect_seg_seg(), blender::math::isect_result< T >::kind, blender::math::isect_result< T >::lambda, blender::math::isect_result< T >::LINE_LINE_COLINEAR, blender::math::isect_result< T >::LINE_LINE_CROSS, blender::math::isect_result< T >::LINE_LINE_EXACT, blender::math::isect_result< T >::LINE_LINE_NONE, and blender::v2.
| isect_result< float2 > blender::math::isect_seg_seg | ( | const float2 & | v1, |
| const float2 & | v2, | ||
| const float2 & | v3, | ||
| const float2 & | v4 ) |
Definition at line 16 of file math_vec.cc.
References isect_seg_seg(), blender::math::isect_result< T >::kind, blender::math::isect_result< T >::lambda, blender::math::isect_result< T >::LINE_LINE_COLINEAR, blender::math::isect_result< T >::LINE_LINE_CROSS, blender::math::isect_result< T >::LINE_LINE_EXACT, blender::math::isect_result< T >::LINE_LINE_NONE, and blender::v2.
|
nodiscard |
References isect_seg_seg(), and blender::v2.
Referenced by blender::meshintersect::fill_crossdata_for_intersect(), blender::ed::greasepencil::find_curve_intersections(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), isect_seg_seg(), isect_seg_seg(), and isect_seg_seg().
|
inlinenodiscard |
Definition at line 457 of file BLI_math_vector.hh.
References length(), length_squared(), sqrt(), and T.
Referenced by blender::apply_gradient_tint(), area_tri(), blender::bm_vert_chain_orientation_matrix_calc(), blender::compositor::bokeh(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::brushes::calc_distances(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::calculate_circle_best_fit(), blender::bke::curves::bezier::calculate_point_handles(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::ed::greasepencil::calculate_radius_projection_factor(), blender::nodes::node_shader_tex_gradient_cc::GradientFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_satisfy_constraints(), blender::noise::compute_3d_orientation(), blender::compositor::compute_fog_glow_kernel_value(), blender::nodes::node_composite_vector_blur_cc::compute_motion_line(), blender::nodes::node_composite_relative_to_pixel_cc::RelativeToPixelOperation::compute_reference_size(), cotangent_tri_weight(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::ed::transform::createEdgeSlideVerts(), blender::bke::curves::poly::delta_dir(), blender::bke::curves::poly::direction_bisect(), distance(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams(), blender::bke::tests::EXPECT_M3_ORTHOGONAL(), blender::geometry::extend_curve_straight(), blender::geometry::fillet_handle_type(), blender::find_envelope(), float_to_half_array(), float_to_half_clamp_array(), float_to_half_make_finite_array(), from_vector(), blender::draw::View::frustum_culling_planes_calc(), blender::noise::gabor(), blender::noise::gabor(), blender::nodes::node_composite_vector_blur_cc::gather_blur(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::nodes::node_composite_vector_blur_cc::gather_sample(), blender::ed::greasepencil::generate_corner(), blender::generate_curves(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_delta_translation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_fn_compare_cc::get_multi_function(), blender::nodes::gizmos::gizmo_input_dims_from_log(), blender::ed::greasepencil::grease_pencil_primitive_scale_all_update(), half_to_float_array(), blender::geometry::geom::is_outside_edge(), is_unit(), length(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::ed::sculpt_paint::PaintStroke::modal(), blender::modify_drawing(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), blender::ed::sculpt_paint::paint_stroke_line_constrain(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::imbuf::transform::process_scanlines(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), blender::fn::multi_function::register_common_functions_impl(), blender::eevee::MotionBlurModule::render(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::math::tests::TEST(), blender::tests::TEST(), to_axis_angle(), to_scale(), to_scale(), blender::tests::transform_normals_test(), blender::ed::transform::transform_result_get(), blender::math::projection::translate(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value(), whitepoint_to_temp_tint(), and blender::seq::WipeData::WipeData().
|
inlinenodiscard |
Returns summation of all components.
Definition at line 443 of file BLI_math_vector.hh.
References abs(), length_manhattan(), blender::result, and T.
Referenced by blender::apply_to_curves_point_selection(), distance_manhattan(), length_manhattan(), to_euler(), to_euler(), to_nearest_euler(), and to_nearest_euler().
|
inlinenodiscard |
Definition at line 452 of file BLI_math_vector.hh.
References dot(), length_squared(), and T.
Referenced by blender::geometry::construct::adj_vmesh(), blender::BKE_mball_polygonize(), blender::bke::pbvh::bmesh_update_topology(), blender::calc_min_radius_v3v3(), blender::seq::calc_wipe_blend(), blender::calculate_verts(), blender::xpbd::closest_on_segment_to_ray(), closest_to_line_segment(), closest_to_plane(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_2d_gabor_noise_cell(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_gabor_noise_cell(), blender::geometry::dist_signed_squared_to_edge(), dist_squared_to_line_segment(), dist_squared_to_plane(), distance_squared(), blender::xpbd::evaluate_align_rotations_constraint(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::execute_curve_chain(), blender::ed::sculpt_paint::filter_plane_trim_limit_factors(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), invert(), is_orthonormal(), is_similarity_transform(), is_uniformly_scaled(), is_unit(), is_unit_scale(), blender::isect_vert_calc_z(), length(), length_squared(), line_point_factor(), blender::nodes::node_composite_vector_blur_cc::max_velocity(), blender::ed::transform::nearest_world_tree(), normalize_and_get_length(), blender::ed::sculpt_paint::project_translations(), blender::geometry::signed_distance_fat_triangle(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), to_dual_quaternion(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::eevee::Film::update_sample_table(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::nodes::node_geo_transform_geometry_cc::use_translate(), blender::noise::voronoi_distance_bound(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), blender::noise::voronoi_n_sphere_radius(), and blender::WM_gesture_lasso_modal().
|
inlinenodiscard |
Return the scalar factor lambda such that l1 + lambda * (l2 - l1) is the closest point on the infinite line through (l1, l2) to p. Returns 0 when the line is degenerate (l1 == l2). Works for any number of dimensions Size.
Definition at line 199 of file BLI_math_geom.hh.
References dot(), length_squared(), line_point_factor(), and T.
Referenced by line_point_factor(), TEST(), and TEST().
Definition at line 224 of file BLI_math_base.hh.
References log(), T, and blender::x.
Referenced by log(), log(), and blender::tests::TEST().
|
inlinenodiscard |
Definition at line 291 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, log(), and blender::x.
Map a 3D direction vector co to spherical (u, v) texture coordinates returned as float2.
Definition at line 461 of file BLI_math_geom.hh.
References blender::map_to_sphere(), map_to_sphere(), and blender::result.
Referenced by map_to_sphere(), and TEST().
Definition at line 49 of file BLI_math_base.hh.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_cpu(), blender::eevee::RenderBuffers::acquire(), bicubic_interpolation(), blender::BKE_camera_params_from_object(), blender::BKE_camera_params_from_view3d(), blender::BKE_object_minmax_dupli(), blender::BKE_pchan_minmax(), blender::box_select_action(), blender::nodes::node_composite_brightness_contrast_cc::brightness_and_contrast(), blender::gpu::render_graph::VKUpdateMipmapsNode::build_commands(), blender::bke::builtin_attributes(), blender::buttons_context_path_material(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::vse::ScopeHistogram::calc_from_ibuf(), blender::nodes::node_shader_radial_tiling_cc::RoundedPolygonFunction::call(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::nodes::node_composite_channel_key_cc::channel_key(), blender::ed::greasepencil::trim::check_line_segment_lasso_intersection(), clamp(), clamp(), clamp(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::compositor::compute_anti_diagonal_start(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_base_ghost_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_chain_length(), blender::nodes::node_composite_lens_distortion_cc::compute_chromatic_distortion_scale(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_crop_cc::CropOperation::compute_cropping_bounds(), blender::compositor::compute_diagonal_start(), blender::nodes::node_composite_lens_distortion_cc::compute_distortion_scale(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_eccentricity(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_cpu(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_log_maximum_luminance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_log_minimum_luminance(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_luminance_scale_blend_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::compute_maximum_blur_size(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::compositor::compute_sigma_from_radius(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::compute_variable_size_search_radius(), blender::compositor::convolve(), blender::io::fbx::ArmatureImportContext::create_armature_bones(), blender::create_array_copies(), blender::deform_drawing(), blender::deform_drawing(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::do_version_glare_node_bloom_strength(), blender::do_version_map_value_node(), blender::ed::vse::draw_strip_thumbnails(), blender::drawviewborder(), blender::imbuf::transform::edge_aa(), blender::ed::transform::ElementResize(), blender::eevee::LightModule::end_sync(), blender::eevee::VolumeModule::end_sync(), blender::seq::entry_add_or_replace_frame(), blender::evaluate_film_like(), blender::nodes::node_composite_blank_image_cc::BlankImageOperation::execute(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_depth_combin_cc::ZCombineOperation::execute_single_value(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::ed::curves::extend_range(), blender::fcurve_to_keylist(), blender::nodes::FileOutputItemsAccessor::find_available_identifier(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_cut_boundary(), blender::ed::greasepencil::fit_strokes_to_view(), blender::noise::gabor(), blender::noise::gabor(), blender::seq::gaussian_blur_x(), blender::seq::gaussian_blur_y(), blender::nodes::node_composite_bilateral_blur_cc::BilateralBlurOperation::get_blur_radius(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::get_blur_radius(), blender::nodes::node_composite_blur_cc::BlurOperation::get_blur_size(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::get_color_threshold(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_contrast(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_despill_strength(), blender::get_distance_factor(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_edge_search_size(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_f_stop(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::get_falloff_size(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_focal_length(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_gamma(), blender::nodes::node_composite_glare_cc::GlareOperation::get_highlights_smoothness(), blender::nodes::node_composite_id_mask_cc::IDMaskOperation::get_index(), blender::nodes::node_composite_tone_map_cc::ToneMapOperation::get_key(), blender::nodes::node_composite_anti_aliasing_cc::AntiAliasingOperation::get_local_contrast_adaptation_factor(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::get_max_distance(), blender::nodes::node_composite_glare_cc::GlareOperation::get_max_highlights(), blender::nodes::node_composite_glare_cc::GlareOperation::get_normalization_scale(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::get_pixel_size(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_postprocess_blur_size(), blender::nodes::node_composite_keying_cc::KeyingOperation::get_preprocess_blur_size(), blender::nodes::node_composite_glare_cc::GlareOperation::get_saturation(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_scale(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_crop(), blender::nodes::node_composite_vector_blur_cc::VectorBlurOperation::get_shutter(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::get_size(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::get_size(), blender::nodes::node_composite_mask_cc::MaskOperation::get_size(), blender::nodes::node_composite_glare_cc::GlareOperation::get_strength(), blender::nodes::node_composite_bilateral_blur_cc::BilateralBlurOperation::get_threshold(), blender::nodes::node_composite_glare_cc::GlareOperation::get_threshold(), blender::ed::greasepencil::get_tri_max_weight(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_uniformity(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::nodes::node_composite_string_to_image_cc::StringToImageOperation::get_wrap_width(), blender::seq::glow_blur_bitmap(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_vertex_paint_brightness_contrast_exec(), blender::nodes::node_composite_hue_correct_cc::hue_correct(), blender::nodes::node_composite_hue_saturation_value_cc::hue_saturation_value(), blender::IMB_create_gpu_texture(), blender::IMB_gpu_texture_apply_partial_update(), blender::imb_gpu_texture_update_region(), blender::eevee::Film::init(), blender::eevee::Sampling::init(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::seq::ColorBalanceApplyOp::init_lgg(), blender::seq::ColorBalanceApplyOp::init_sop(), blender::bounds::intersect(), blender::ed::sculpt_paint::CutOperationExecutor::intersect_line_segment_sphere_2d(), blender::compositor::jump_flooding(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::nodes::node_composite_color_balance_cc::lift_gamma_gain(), max(), max(), max(), max(), blender::compositor::maximum_color_cpu(), blender::compositor::maximum_float2_cpu(), min_max(), min_max(), blender::bounds::detail::min_max_lanes_with_radii(), blender::modify_drawing(), blender::compositor::morphological_distance_cpu(), blender::ed::space_node::node_clipboard_paste_exec(), blender::ed::space_node::node_frame_rect_inside(), blender::ed::space_node::node_get_resize_direction(), blender::draw::overlay::Bounds::object_sync(), blender::geometry::geom::offset_meet(), blender::nodes::node_composite_color_balance_cc::offset_power_slope(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::PaintOperationExecutor(), blender::eevee::panoramic_equiangular_cubemap_face_view_mask_get(), blender::point_counts_to_keep_concurrent(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::seq::query_thumbnail(), blender::ed::greasepencil::randomize_radius(), blender::eevee::IrradianceBake::raylists_build(), blender::io::spz::read_rotations(), blender::compositor::Domain::realize_transformation(), blender::region_select_action_keys(), blender::fn::multi_function::register_common_functions_impl(), blender::reorder_strokes(), blender::ed::vse::ripple_gaps_get(), blender::scale_up_x_func(), blender::scale_up_y_func(), blender::bke::greasepencil::separate_fill_ids(), blender::seq::seq_prefetch_start_ex(), blender::seq::seq_prefetch_update_area(), blender::ed::vse::sequencer_box_blade_exec(), blender::seq::should_ripple_insert(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::space_node::socket_link_connection_location(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::StringImage::StringImage(), blender::seq::strip_transform_ripple_range(), blender::StatusValue< T >::sum(), blender::eevee::HiZBuffer::sync(), blender::ui::template_ID(), blender::tests::TEST(), blender::gpu::tests::test_mipmap_partial_matches_full(), blender::seq::text_gaussian_blur_x(), blender::seq::text_gaussian_blur_y(), blender::seq::thumbnail_cache_update_scene_thumbs(), blender::seq::tonemap_calc_chunk_luminance(), blender::seq::tonemap_simple(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::transform_mpath_point_to_camera(), blender::seq::transform_ripple_ranges_get(), blender::seq::transform_shuffle_vertical(), blender::geometry::tri_to_cell_bounds(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::bke::greasepencil::update_curve_plane_normal_cache(), and blender::ed::greasepencil::vertex_group_normalize_exec().
|
inlinenodiscard |
Definition at line 88 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and max().
|
inlinenodiscard |
Element-wise maximum of the passed vectors.
Definition at line 97 of file BLI_math_vector.hh.
References blender::BLI_assert(), max(), blender::result, and blender::v.
|
inlinenodiscard |
Element-wise maximum of the passed vectors.
Definition at line 113 of file BLI_math_vector.hh.
References max(), and blender::Span< T >::Span().
Definition at line 55 of file BLI_math_base.hh.
References b, max_inplace(), and T.
Referenced by blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::UniqueName_Value::mark_used(), max_inplace(), and blender::io::obj::Geometry::track_vertex_index().
See std::midpoint from C++20.
Definition at line 288 of file BLI_math_base.hh.
References b, midpoint(), sign(), and T.
Referenced by blender::BKE_mesh_remap_calc_edges_from_mesh(), blender::bmo_circularize_exec(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), blender::bke::calc_edge_centers(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::nodes::node_geo_field_average_cc::calculate_median(), blender::Bounds< T >::center(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::edbm_rip_edge_side_measure(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::ed::space_node::find_visible_center_of_link(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::ed::greasepencil::grease_pencil_snap_cursor_to_sel_exec(), blender::bke::int2_to_int(), midpoint(), midpoint(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Bounds::object_sync(), blender::geometry::geom::offset_meet(), blender::paint_init_pivot_curves(), blender::paint_init_pivot_grease_pencil(), blender::paint_init_pivot_mesh(), blender::bke::partition_faces_recursively(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::bke::pbvh::pbvh_bmesh_split_edge(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::geometry::profile::set_profile_params(), blender::bke::short2_to_int(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::geometry::construct::square_out_adj_vmesh(), ObjectInfos::sync(), blender::tests::TEST(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), blender::draw::Manager::unique_handle_for_sculpt(), blender::view3d_ob_drop_matrix_from_snap(), and blender::view3d_orbit_calc_center().
|
inlinenodiscard |
Definition at line 648 of file BLI_math_vector.hh.
References b, and midpoint().
Definition at line 43 of file BLI_math_base.hh.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::adaptive_smooth_clamp(), bicubic_interpolation(), blender::BKE_camera_frame_size(), blender::BKE_object_minmax_dupli(), blender::BKE_path_apply_template_alloc(), blender::BKE_pchan_minmax(), blender::seq::blur_isolate_highlights(), blender::box_select_action(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::calc_tile_rect(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::Bounds< blender::VecBase< float, 3 > >::center(), blender::nodes::node_composite_channel_key_cc::channel_key(), blender::ed::greasepencil::trim::check_line_segment_lasso_intersection(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), clamp(), clamp(), clamp(), blender::ed::sculpt_paint::greasepencil::closest_distance_to_surface_2d(), blender::nodes::node_composite_color_balance_cc::color_balance(), blender::nodes::node_composite_color_correction_cc::color_correction(), blender::nodes::node_composite_color_key_cc::color_matte(), blender::compositor::compute_anti_diagonal_start(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::compute_classic(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_defocus_radius_from_depth_cpu(), blender::compositor::compute_diagonal_length(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_image_cpu(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_matte_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_defocus_radius(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), blender::compositor::compute_output_domain(), blender::nodes::node_composite_keying_cc::KeyingOperation::compute_tweaked_matte_cpu(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::do_version_glare_node_options_to_inputs(), blender::do_version_map_value_node(), blender::eevee::VolumeModule::end_sync(), blender::draw::gpencil::erfinv_approx(), blender::evaluate_film_like(), blender::nodes::node_composite_pixelate_cc::PixelateOperation::execute_cpu(), blender::nodes::node_composite_dilate_erode_cc::DilateErodeOperation::execute_step_pass_cpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::geometry::extend_curve_curved(), blender::ed::curves::extend_range(), blender::fcurve_to_keylist(), blender::nodes::node_composite_inpaint_cc::InpaintOperation::fill_inpainting_region_cpu(), blender::seq::fill_rect_alpha_under(), blender::find_first_points(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::index_mask::IndexMask::foreach_segment_zipped(), blender::noise::fractal_voronoi_distance_to_edge(), blender::seq::gaussian_blur_x(), blender::seq::gaussian_blur_y(), blender::get_build_factor(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::get_iterations(), blender::io::grease_pencil::get_miter_limit_angle(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_fit(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::seq::glow_blur_bitmap(), blender::bounds::intersect(), blender::ed::object::lattice_add_to_selected_collect_targets_and_calc_bounds(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::nodes::node_composite_luminance_key_cc::luminance_matte(), blender::bke::calc_edges::mask_first_distinct_edges(), min(), min(), min(), min(), min_max(), min_max(), blender::bounds::detail::min_max_lanes_with_radii(), blender::compositor::minimum_color_cpu(), blender::compositor::morphological_distance_cpu(), blender::ed::space_node::node_add_nodes_modal(), blender::ed::space_node::node_clipboard_paste_exec(), blender::ed::space_node::node_insert_offset_modal(), blender::eevee::panoramic_equiangular_cubemap_face_view_mask_get(), blender::region_select_action_keys(), blender::fn::multi_function::register_common_functions_impl(), blender::ed::vse::ripple_gaps_get(), blender::ed::vse::sequencer_add_effect_strip_exec(), blender::ed::vse::sequencer_box_blade_exec(), blender::ed::vse::sequencer_snap_exec(), blender::eevee::VolumeModule::set_view(), blender::nodes::node_composite_glare_cc::GlareOperation::smooth_min(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::StringImage::StringImage(), blender::seq::strip_transform_ripple_range(), blender::compositor::summed_area_table_sum(), blender::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::seq::text_gaussian_blur_x(), blender::seq::text_gaussian_blur_y(), blender::seq::tonemap_calc_chunk_luminance(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::seq::transform_shuffle_vertical(), blender::geometry::tri_to_cell_bounds(), blender::bke::pbvh::TriRasterizer::TriRasterizer(), blender::nodes::node_composite_vector_blur_cc::velocity_atomic_max_value(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), and blender::nodes::node_composite_color_balance_cc::white_point_constant().
|
inlinenodiscard |
Definition at line 57 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and min().
|
inlinenodiscard |
Element-wise minimum of the passed vectors.
Definition at line 66 of file BLI_math_vector.hh.
References blender::BLI_assert(), min(), blender::result, and blender::v.
|
inlinenodiscard |
Element-wise minimum of the passed vectors.
Definition at line 82 of file BLI_math_vector.hh.
References min(), and blender::Span< T >::Span().
Definition at line 62 of file BLI_math_base.hh.
References b, min_inplace(), and T.
Referenced by min_inplace(), and blender::io::obj::Geometry::track_vertex_index().
Definition at line 99 of file BLI_math_base.hh.
References max(), min(), min_max(), and T.
Referenced by blender::BKE_object_minmax(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), blender::bke::pbvh::calc_face_bounds(), blender::bke::pbvh::calc_face_grid_bounds(), blender::meshintersect::cdt_draw(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::fcurve_to_keylist(), blender::bke::pbvh::Tree::from_bmesh(), blender::ed::greasepencil::grease_pencil_snap_compute_centroid(), blender::hair_get_boundbox(), blender::init_meta(), blender::ed::sculpt_paint::image::init_uv_primitives_brush_test(), blender::layerDoMinMax_propfloat2(), blender::median_bounds_add(), min_max(), min_max(), blender::particle_intersect_mesh(), blender::bke::partition_faces_recursively(), blender::bke::pbvh::pbvh_bmesh_node_finalize(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::PE_minmax(), blender::bounds::detail::segment_bounds(), blender::TEST(), blender::bke::pbvh::update_node_bounds_bmesh(), blender::bke::pbvh::update_node_bounds_grids(), and blender::bke::pbvh::update_node_bounds_mesh().
|
inline |
Definition at line 332 of file BLI_math_vector.hh.
Definition at line 79 of file BLI_math_base.hh.
Referenced by blender::deform_drawing(), blender::ed::greasepencil::get_control_point_type(), blender::get_rand_matrix(), mod(), mod(), mod(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::ed::greasepencil::primitive_calculate_curve_positions(), safe_mod(), and blender::geometry::sample_curve_attribute().
|
inlinenodiscard |
Definition at line 164 of file BLI_math_vector.hh.
References b, blender::BLI_assert(), mod(), blender::result, and T.
|
inlinenodiscard |
Definition at line 158 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and mod().
Repeats the saw-tooth pattern even on negative numbers. ex: mod_periodic(-3, 4) = 1, mod(-3, 4)= -3. This will cause undefined behavior for negative b.
Definition at line 127 of file BLI_math_base.hh.
References abs(), b, blender::BLI_assert(), floor(), mod_periodic(), and T.
Referenced by blender::ed::transform::angle_to_quadrant_or_null_from_degrees(), blender::compositor::bokeh(), blender::calculate_splines_axis(), blender::calculate_splines_axis(), blender::ed::transform::curves::cyclic_curve_connected_point_distances(), blender::execute_curve_chain(), blender::find_longest_unselected_gap(), blender::nodes::node_geo_mesh_topology_offset_corner_in_face_cc::OffsetCornerInFaceFieldInput::get_varray_for_context(), blender::nodes::node_geo_offset_point_in_curve_cc::ControlPointNeighborFieldInput::get_varray_for_context(), mod_periodic(), blender::fn::multi_function::register_common_functions_impl(), blender::tests::TEST(), blender::trim_chains_to_boundaries(), blender::ed::greasepencil::segment::Segment::wrap_index(), blender::math::AngleFraction< T >::wrapped(), and blender::math::AngleRadianBase< float >::wrapped().
|
inlinenodiscard |
Compute the normalized normal of a quad (v1, v2, v3, v4). Uses the cross product of the two diagonals, so the result is correct for planar quads and a reasonable approximation for slightly non-planar ones. The result is not guaranteed to be non-degenerate.
Definition at line 32 of file BLI_math_geom.hh.
References cross(), normal_quad(), normalize(), and blender::v2.
Referenced by normal_quad(), and TEST().
|
inlinenodiscard |
Return normal vector to a triangle. The result is normalized but can still be degenerate.
Definition at line 624 of file BLI_math_vector.hh.
References cross_tri(), normal_tri(), normalize(), and blender::v2.
Referenced by blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::io::stl::export_frame(), blender::bke::mesh::face_normal_calc(), from_triangle(), blender::bke::pbvh::node_raycast_bmesh(), and normal_tri().
|
nodiscard |
Apply all accumulated weights to the dual-quaternions. Also make sure the rotation quaternions is normalized.
Definition at line 451 of file BLI_math_quaternion.hh.
References dot(), blender::math::DualQuaternionBase< T >::identity(), normalize(), blender::math::DualQuaternionBase< T >::quat, blender::math::DualQuaternionBase< T >::quat_weight, blender::math::DualQuaternionBase< T >::scale, blender::math::DualQuaternionBase< T >::scale_weight, sqrt(), T, and blender::math::DualQuaternionBase< T >::trans.
|
nodiscard |
Normalize each column of the matrix individually.
Definition at line 784 of file BLI_math_matrix.hh.
References normalize(), blender::result, and blender::unroll().
Referenced by blender::bke::mesh::accumulate_fan_normal(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_jitter(), blender::geometry::construct::adjust_miter_coords(), blender::geometry::construct::adjust_miter_inner_coords(), blender::ed::sculpt_paint::pose::align_pivot_local_space(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::xpbd::apply_rotation_offset(), blender::armature_bone_primitive_add_exec(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::draw::overlay::Meshes::begin_sync(), blender::draw::overlay::Paints::begin_sync(), blender::ed::sculpt_paint::boundary::bend_data_init_bmesh(), blender::ed::sculpt_paint::boundary::bend_data_init_grids(), blender::ed::sculpt_paint::boundary::bend_data_init_mesh(), blender::BKE_multires_construct_tangent_matrix(), blender::BM_face_splits_check_legal(), blender::bm_vert_chain_orientation_matrix_calc(), blender::bmo_circularize_exec(), blender::bke::build_point_matrix(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_bmesh(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_grids(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::smooth::calc_boundary_normal_corner(), blender::ed::sculpt_paint::calc_brush_plane(), blender::bke::mesh::calc_edge_directions(), blender::ed::sculpt_paint::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix(), blender::ed::sculpt_paint::cloth::calc_perpendicular_pinch_forces(), blender::ed::sculpt_paint::cloth::calc_pinch_forces(), blender::ed::sculpt_paint::cloth::calc_plane_pinch_forces(), blender::ed::sculpt_paint::pose::calc_pose_data(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_position_without_interpolation(), blender::ed::sculpt_paint::pose::calc_scale_from_grab_delta(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::ed::sculpt_paint::calc_stabilized_plane(), blender::bke::curves::bezier::calculate_align_both_handles(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::geometry::calculate_directions(), blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::bke::curves::poly::calculate_normals_z_up(), blender::calculate_plane(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::calculate_target_locations(), blender::ed::greasepencil::calculate_texture_space(), blender::calculate_verts(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::nodes::node_geo_curve_sample_cc::SampleCurveFunction::call(), blender::nodes::node_composite_chroma_key_cc::chroma_matte(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::nodes::node_geo_curve_primitive_arc_cc::colinear_f3_f3_f3(), blender::nodes::node_geo_curve_primitive_circle_cc::colinear_f3_f3_f3(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::geometry::compute_surface_point_normal(), blender::io::ply::convert_gsplat_ply_to_point_cloud(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_line_cc::create_direction_line_curve(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::deform_drawing(), blender::bke::curves::poly::direction_bisect(), blender::ed::sculpt_paint::boundary::displacement_from_grab_delta_get(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::do_version_normal_node_dot_product(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::drw_render_border_mask(), blender::DRW_text_edit_mesh_measure_stats(), blender::dynamic_paint_paint_mesh_cell_point_cb_ex(), blender::edbm_flatten_exec(), blender::edbm_rip_edge_exec(), blender::geometry::construct::edges_angle_kind(), blender::bke::subdiv::eval_limit_point_and_normal(), blender::bke::CurvesGeometry::evaluated_tangents(), blender::geometry::extend_curve_curved(), blender::geometry::fillet_handle_type(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::find_envelope(), blender::find_internal_spring_target_vertex(), blender::ed::greasepencil::segment::find_intersections_between_curve_and_curves(), blender::bke::float4x4_to_quaternion(), from_triangle(), from_vector(), blender::noise::gabor(), blender::ed::greasepencil::generate_cap(), blender::ed::greasepencil::generate_corner(), blender::ed::greasepencil::generate_stroke_perimeter(), blender::ed::sculpt_paint::trim::gesture_to_screen_points(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::nodes::node_composite_normal_cc::get_normal(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::gizmo_ruler_draw(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::sculpt_paint::imapaint_pick_face(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::transform::initVertSlide_ex(), interpolate(), blender::knife_draw_line(), blender::knife_find_closest_edge_of_face(), blender::knife_snap_update_from_mval(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::ed::greasepencil::boolean::LR_states_from_segment(), blender::geometry::construct::make_cube_corner_adj_vmesh(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::geometry::geom::make_unit_square_map(), blender::bke::mesh_normals_varray(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::bke::attribute_math::mix3(), blender::bke::subdiv::mix_normals(), blender::bke::subdiv::mix_normals(), blender::bke::subdiv::mix_normals(), blender::ed::transform::mouse_delta_to_world_dir(), blender::geometry::profile::move_profile_plane(), blender::multires_reshape_apply_base_refit_base_mesh(), blender::geometry::geom::nearly_parallel(), blender::geometry::construct::next_edgehalf_bev(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_quaternion_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), normal_quad(), blender::nodes::node_geo_distribute_points_on_faces_cc::normal_to_rotation(), normal_tri(), normalize(), normalize(), normalize(), normalize(), normalize(), blender::bke::normalize_span(), blender::geometry::normalize_span(), blender::draw::overlay::LightProbes::object_sync(), blender::geometry::construct::offset_in_plane(), blender::geometry::geom::offset_meet(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), orthogonalize(), blender::draw::detail::pack_gaussian(), blender::bke::pbvh::pbvh_bmesh_split_edge(), blender::geometry::construct::pipe_test(), blender::geometry::geom::point_between_edges(), blender::ed::sculpt_paint::boundary::populate_twist_data(), pow(), blender::ed::curves::primitive_random_sphere(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::nodes::node_geo_raycast_cc::raycast_to_mesh(), blender::fn::multi_function::register_common_functions_impl(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), blender::ed::greasepencil::DrawingPlacement::reproject(), blender::bke::mesh_surface_sample::sample_corner_normals(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::bke::mesh_surface_sample::sample_point_normals(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::geometry::profile::set_profile_params(), blender::ed::sculpt_paint::boundary::slide_data_init_bmesh(), blender::ed::sculpt_paint::boundary::slide_data_init_grids(), blender::ed::sculpt_paint::boundary::slide_data_init_mesh(), blender::geometry::construct::snap_to_superellipsoid(), blender::ed::sculpt_paint::pose::solve_ik_chain(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::geometry::curve_constraints::solve_length_constraints(), blender::ed::sculpt_paint::pose::solve_roll_chain(), blender::geometry::construct::square_out_adj_vmesh(), blender::draw::statvis_calc_thickness(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::ed::sculpt_paint::stroke_cache_init(), TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::io::ply::TEST_F(), blender::ed::sculpt_paint::tilt_apply_to_normal(), to_dual_quaternion(), to_quaternion_legacy(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::ed::transform::transform_mesh_uv_edge_slide_data_create(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), blender::geometry::transform_volume(), blender::ed::transform::VertSlideData::update_active_edges(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::value_attribute_to_matrix(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), whitepoint_from_temp_tint(), and blender::wm_xr_navigation_teleport_arc_scene_intersect().
|
nodiscard |
Definition at line 753 of file BLI_math_matrix.hh.
References normalize(), blender::result, and blender::unroll().
|
inlinenodiscard |
Return a unit quaternion representing the same rotation as q or the identity quaternion if q is ill-formed.
Definition at line 258 of file BLI_math_quaternion.hh.
References len(), normalize(), normalize_and_get_length(), and T.
|
inlinenodiscard |
Definition at line 543 of file BLI_math_vector.hh.
References len(), normalize(), normalize_and_get_length(), T, and blender::v.
|
inlinenodiscard |
Definition at line 251 of file BLI_math_quaternion.hh.
References dot(), blender::math::QuaternionBase< T >::identity(), normalize_and_get_length(), sqrt(), and T.
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::bke::build_point_matrix_miter_scale(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), blender::convexhull_2d_angle_iter_init(), blender::convexhull_2d_angle_iter_step_on_axis(), blender::distfactor_to_bone(), blender::xpbd::evaluate_distance_constraint(), blender::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curve_curved(), blender::ed::greasepencil::find_curve_intersections(), from_vector(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::geometry::profile::move_profile_plane(), blender::geometry::profile::move_weld_profile_planes(), blender::bke::node_foreach_working_space_color(), normalize(), normalize(), normalize_and_get_length(), normalize_and_get_length(), normalize_and_get_size(), normalize_and_get_size(), blender::bke::pbvh::normals_calc_verts_simple(), orthogonalize(), blender::project_on_mesh(), blender::ed::sculpt_paint::raycast_init(), blender::ed::transform::raycastMesh(), blender::geometry::geom::slide_dist(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::xpbd::AngularDampingConstraintSet::solve_single(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionEdgeConstraintSet::solve_single(), blender::xpbd::FrictionFaceConstraintSet::solve_single(), blender::xpbd::LinearDampingConstraintSet::solve_single(), blender::ed::transform::transform_mesh_edge_slide_data_create(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::math::QuaternionBase< T >::wrapped_around(), and blender::write_fill_transforms().
|
inlinenodiscard |
Definition at line 527 of file BLI_math_vector.hh.
References length_squared(), normalize_and_get_length(), sqrt(), T, blender::v, and blender::VecBase< T, Size >::VecBase().
|
nodiscard |
Normalize each column of the matrix individually. Return the length of each column vector.
Definition at line 792 of file BLI_math_matrix.hh.
References blender::BLI_STATIC_ASSERT(), normalize_and_get_length(), normalize_and_get_size(), blender::result, and blender::unroll().
Referenced by blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), normalize_and_get_size(), normalize_and_get_size(), to_rot_scale(), and to_rot_scale().
|
nodiscard |
Definition at line 771 of file BLI_math_matrix.hh.
References blender::BLI_STATIC_ASSERT(), normalize_and_get_length(), normalize_and_get_size(), blender::result, and blender::unroll().
|
inlinenodiscard |
This is "safe" in the sense that the input matrix may not actually encode a rotation but can also contain shearing etc.
Definition at line 1291 of file BLI_math_matrix.hh.
References normalized_to_quaternion_safe(), to_euler(), and to_quaternion().
Referenced by blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::bke::float4x4_to_quaternion(), blender::bke::attribute_math::mix3(), normalized_to_quaternion_safe(), and blender::tests::TEST().
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const Axis | axis ) |
Definition at line 15 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const AxisSigned | axis ) |
Definition at line 29 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const CartesianBasis & | rot ) |
Definition at line 44 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| EulerOrder | order ) |
Definition at line 144 of file math_rotation.cc.
References operator<<(), XYZ, XZY, YXZ, YZX, ZXY, and ZYX.
Referenced by operator<<().
|
constexpr |
Definition at line 185 of file BLI_math_basis_types.hh.
References b, and operator<=().
Referenced by operator<=(), and operator<=().
|
constexpr |
Definition at line 190 of file BLI_math_basis_types.hh.
References b, and operator<=().
|
inlinenodiscard |
Calculates a perpendicular vector to v.
Definition at line 757 of file BLI_math_vector.hh.
References orthogonal(), and blender::v.
|
inlinenodiscard |
Calculates a perpendicular vector to v.
Definition at line 739 of file BLI_math_vector.hh.
References dominant_axis(), orthogonal(), and blender::v.
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::ed::transform::isect_face_dst(), orthogonal(), and orthogonal().
|
nodiscard |
This returns a version of mat with orthonormal basis axes. This leaves the given axis untouched.
In other words this removes the shear of the matrix. However this doesn't properly account for volume preservation, and so, the axes keep their respective length.
The secondary axis is chosen as follow (X->Y, Y->X, Z->X). If this axis is co-planar try the third axis. If also co-planar, make up an axis by shuffling the primary axis coordinates (XYZ > YZX).
Definition at line 1534 of file BLI_math_matrix.hh.
References BLI_assert_unreachable, cross(), dot(), normalize(), normalize_and_get_length(), orthogonalize(), R, blender::result, scale(), T, blender::math::Axis::X, blender::math::Axis::Y, and blender::math::Axis::Z.
Referenced by orthogonalize(), rotate(), and to_dual_quaternion().
|
inlinenodiscard |
Build a plane from a point and a (not necessarily unit-length) normal.
Definition at line 81 of file BLI_math_geom.hh.
References dot(), and plane_from_point_normal().
Referenced by blender::geometry::construct::build_boundary_terminal_edge(), blender::geometry::geom::offset_meet(), plane_from_point_normal(), blender::geometry::construct::snap_to_pipe_profile(), and TEST().
|
inlinenodiscard |
Return the signed distance of co from plane. Positive values are on the side the normal points toward.
Definition at line 94 of file BLI_math_geom.hh.
References plane_point_side(), and T.
Referenced by closest_to_plane(), dist_squared_to_plane(), plane_point_side(), and TEST().
|
static |
Right polar decomposition: M = UP
U is the rotation-like component, the closest orthogonal matrix to M. P is the scaling-like component, defined in U space.
See https://en.wikipedia.org/wiki/Polar_decomposition for more.
WORKAROUND: (ComputeThinU | ComputeThinV) must be set as runtime parameters in Eigen < 3.4.0. But this requires the matrix type to be dynamic to avoid an assert.
Definition at line 292 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), from_scale(), polar_decompose(), transpose(), V, and W.
Referenced by interpolate(), and polar_decompose().
|
nodiscardconstexpr |
Compute the total number of triangles needed to tessellate a mesh, or the index of the first triangle for a polygon given its loop start index.
| poly_count | Number of polygons (or polygon index). |
| corner_count | Number of corners / loop index. |
Definition at line 382 of file BLI_math_geom.hh.
References poly_to_tri_count().
Referenced by poly_to_tri_count(), and TEST().
|
nodiscard |
Raise a unit Quaternion q to the real y exponent.
Definition at line 204 of file BLI_math_quaternion.hh.
References blender::BLI_assert(), cos(), blender::math::QuaternionBase< T >::imaginary_part(), is_unit_scale(), normalize(), pow(), safe_acos(), sin(), T, blender::math::QuaternionBase< T >::w, and y.
Definition at line 194 of file BLI_math_base.hh.
References pow(), power(), T, and blender::x.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::compute_fog_glow_field_of_view(), blender::do_version_glare_node_options_to_inputs(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::geometry::extend_curve_curved(), blender::geometry::profile::find_even_superellipse_chords_general(), blender::geometry::profile::find_superellipse_chord_endpoint(), interpolate(), blender::nodes::node_composite_color_balance_cc::lift_gamma_gain(), blender::nodes::node_composite_color_balance_cc::offset_power_slope(), pow(), pow(), pow(), pow(), blender::ed::greasepencil::simplify_fixed(), blender::ed::sculpt_paint::simplify_fixed(), blender::simplify_fixed(), blender::geometry::profile::superellipse_co(), and blender::math::tests::TEST().
|
inlinenodiscard |
Return the value of x raised to the y power. The result is undefined if x < 0 or if x = 0 and y <= 0.
Definition at line 228 of file BLI_math_vector.hh.
References pow(), blender::result, T, blender::x, and y.
|
inlinenodiscard |
Return the value of x raised to the y power. The result is undefined if x < 0 or if x = 0 and y <= 0.
Definition at line 272 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, pow(), blender::x, and y.
|
inlinenodiscard |
Project p onto v_proj . Returns zero vector if v_proj is degenerate (zero length).
Definition at line 517 of file BLI_math_vector.hh.
References dot(), is_zero(), project(), and blender::VecBase< T, Size >::VecBase().
Referenced by project(), and blender::fn::multi_function::register_common_functions_impl().
References project_point().
References project_point().
| VecBase< T, N > blender::math::project_point | ( | const MatBase< T, N+1, NumRow > & | mat, |
| const VecBase< T, N > & | point ) |
Definition at line 1702 of file BLI_math_matrix.hh.
References abs(), N, project_point(), T, and blender::VecBase< T, Size >::VecBase().
|
nodiscard |
Project a point using a matrix (location & rotation & scale & perspective divide).
References project_point().
Referenced by blender::ed::sculpt_paint::do_brush_action(), blender::ed::sculpt_paint::image::ops::paint::do_brush_action(), blender::ed::transform::EdgeSlideData::project(), blender::ed::transform::VertSlideData::project(), project_point(), project_point(), project_point(), project_point(), blender::io::grease_pencil::GreasePencilExporter::project_to_screen(), blender::draw::View::screen_pixel_radius(), and blender::eevee::VolumeObjectBounds::VolumeObjectBounds().
|
extern |
References project_point_safe().
|
extern |
References project_point_safe().
| VecBase< T, N > blender::math::project_point_safe | ( | const MatBase< T, N+1, NumRow > & | mat, |
| const VecBase< T, N > & | point ) |
Definition at line 1711 of file BLI_math_matrix.hh.
References abs(), N, project_point_safe(), safe_divide(), and T.
|
nodiscard |
Safely project a point using a matrix (location & rotation & scale & perspective divide).
References project_point_safe().
Referenced by blender::nodes::node_fn_project_point_cc::node_build_multi_function(), project_point_safe(), project_point_safe(), project_point_safe(), and project_point_safe().
References pseudo_invert().
References pseudo_invert().
References pseudo_invert().
References pseudo_invert().
References pseudo_invert().
References pseudo_invert().
|
nodiscard |
Compute Moore-Penrose pseudo inverse of matrix. Singular values below epsilon are ignored for stability (truncated SVD). Gives a good enough approximation of the regular inverse matrix if the given matrix is non-invertible (ex: degenerate transform). The returned pseudo inverse matrix A+ of input matrix A will not satisfy A+ * A = Identity but will satisfy A * A+ * A = A. For more detail, see https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse.
Compute the Single Value Decomposition of an arbitrary matrix A That is compute the 3 matrices U,W,V with U column orthogonal (m,n) ,W a diagonal matrix and V an orthogonal square matrix s.t.A = U.W.Vt. From this decomposition it is trivial to compute the (pseudo-inverse) of A as Ainv = V.Winv.transpose(U).
WORKAROUND: (ComputeThinU | ComputeThinV) must be set as runtime parameters in Eigen < 3.4.0. But this requires the matrix type to be dynamic to avoid an assert.
Definition at line 223 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), from_scale(), invert(), pseudo_invert(), T, transpose(), blender::U, blender::unroll(), V, and W.
Referenced by blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::ed::transform::curves::curve_populate_trans_data_structs(), blender::median_dims_scale_matrix_calc(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), rotate(), and blender::tests::TEST().
Definition at line 160 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::cloth::apply_forces(), blender::ed::sculpt_paint::apply_hardness_to_distances(), blender::ed::sculpt_paint::smooth::average_positions(), blender::BKE_brush_calc_curve_factors(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_grids(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_mesh(), blender::ed::sculpt_paint::auto_mask::calc_interpolated_face_factors(), blender::geometry::calc_straight_curve_positions(), blender::ed::sculpt_paint::face_set::fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::face_set::fill_factor_from_hide_and_mask(), blender::bke::attribute_math::float4x4Mixer::finalize(), blender::seq::ColorBalanceApplyOp::init_lgg(), blender::seq::ColorBalanceApplyOp::init_sop(), blender::ed::sculpt_paint::mask::mask_increase_contrast(), blender::bke::mix_deform_verts(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::multires_reshape_apply_base_refit_base_mesh(), blender::nodes::node_geo_grid_solve_poisson_cc::node_geo_exec(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::ed::sculpt_paint::project_translations(), rcp(), rcp(), blender::tests::TEST(), and to_quaternion().
|
inlinenodiscard |
Per-element inverse. Zero elements are evaluated to NaN.
Definition at line 403 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and rcp().
|
inlinenodiscard |
Definition at line 705 of file BLI_math_vector.hh.
References reduce_add(), blender::result, and T.
Referenced by average(), blender::compositor::compute_boundary_coefficient(), blender::compositor::compute_boundary_coefficient(), blender::compositor::compute_feedforward_coefficient(), blender::compositor::compute_normalization_scale(), blender::nodes::node_composite_glare_cc::GlareOperation::karis_brightness_weighted_sum(), and reduce_add().
|
inlinenodiscard |
Definition at line 677 of file BLI_math_vector.hh.
References reduce_max(), blender::result, and T.
Referenced by blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::bke::pbvh::pixels::can_be_extended(), blender::nodes::node_composite_relative_to_pixel_cc::RelativeToPixelOperation::compute_reference_size(), blender::compositor::deriche_gaussian_blur(), blender::do_version_glare_node_options_to_inputs(), blender::evaluate_film_like(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_fog_glow(), blender::ed::greasepencil::fit_strokes_to_view(), blender::draw::overlay::FlatObjectRef::flat_axis_index_get(), blender::io::obj::geometry_to_blender_objects(), blender::eevee::IrradianceBake::init(), blender::eevee::VolumeModule::init(), blender::nodes::node_composite_glare_cc::GlareOperation::karis_brightness_weighted_sum(), blender::draw::overlay::Bounds::object_sync(), blender::draw::overlay::LightProbes::object_sync(), blender::eevee::Film::overscan_pixels_get(), blender::compositor::recursive_gaussian_blur(), reduce_max(), blender::eevee::VolumePipeline::register_and_get_layer(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::gpu::tests::test_mipmap_partial_matches_full(), and blender::compositor::van_vliet_gaussian_blur().
|
inlinenodiscard |
Definition at line 691 of file BLI_math_vector.hh.
References reduce_min(), blender::result, and T.
Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::compute_bloom_chain_length(), blender::nodes::node_composite_relative_to_pixel_cc::RelativeToPixelOperation::compute_reference_size(), blender::do_version_glare_node_bloom_strength(), blender::evaluate_film_like(), reduce_min(), and blender::eevee::IrradianceBake::surfels_create().
|
inlinenodiscard |
Definition at line 717 of file BLI_math_vector.hh.
References reduce_mul(), blender::result, and T.
Referenced by blender::nodes::node_composite_tone_map_cc::ToneMapOperation::compute_global_adaptation_level(), blender::nodes::node_composite_levels_cc::LevelsOperation::compute_mean(), blender::nodes::node_composite_levels_cc::LevelsOperation::compute_standard_deviation(), blender::eevee::VolumeProbeModule::init(), blender::draw::overlay::Fluids::object_sync(), and reduce_mul().
|
inlinenodiscard |
Definition at line 492 of file BLI_math_vector.hh.
References blender::BLI_assert(), dot(), is_unit_scale(), and reflect().
Referenced by reflect(), and blender::fn::multi_function::register_common_functions_impl().
|
inlinenodiscard |
Definition at line 500 of file BLI_math_vector.hh.
References dot(), refract(), sqrt(), T, and blender::VecBase< T, Size >::VecBase().
Referenced by refract(), and blender::fn::multi_function::register_common_functions_impl().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 206 of file BLI_math_rotation.hh.
References blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), b, and rotate().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 219 of file BLI_math_rotation.hh.
References b, from_rotation(), blender::math::Euler3Base< T >::order(), rotate(), and to_euler().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 212 of file BLI_math_rotation.hh.
References b, from_rotation(), rotate(), and to_euler().
|
nodiscard |
Definition at line 688 of file BLI_math_matrix.hh.
References cos(), from_rotation(), blender::result, rotate(), sin(), T, and unroll.
|
nodiscard |
Equivalent to mat * from_rotation(rotation) but with fewer operation. Optimized for AxisAngle rotation on basis vector (i.e: AxisAngle({1, 0, 0}, 0.2)).
References b, blender::e, from_direction(), from_loc_rot(), from_loc_rot_scale(), from_loc_scale(), from_location(), from_origin_transform(), from_orthonormal_axes(), from_rot_scale(), from_rotation(), from_scale(), from_up_axis(), interpolate(), interpolate_fast(), interpolate_linear(), orthogonalize(), pseudo_invert(), rotate(), scale(), T, to_angle(), to_euler(), to_loc_rot_scale(), to_nearest_euler(), to_quaternion(), to_quaternion_legacy(), to_rot_scale(), to_scale(), transform_direction(), and transform_point().
Referenced by rotate(), rotate(), rotate(), rotate(), rotate(), and rotate().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 200 of file BLI_math_rotation.hh.
References b, blender::math::QuaternionBase< T >::QuaternionBase(), and rotate().
| float3 blender::math::rotate_around_axis | ( | const float3 & | vector, |
| const float3 & | center, | ||
| const float3 & | axis, | ||
| float | angle ) |
Rotate any arbitrary vector around the center position, with a unit-length axis and the specified angle.
Definition at line 131 of file math_rotation.cc.
References angle(), blender::axis_angle_normalized_to_mat3(), blender::mul_m3_v3(), blender::result, and rotate_around_axis().
Referenced by blender::ed::sculpt_paint::boundary::calc_twist_position(), and rotate_around_axis().
|
inline |
Definition at line 188 of file BLI_math_rotation.hh.
References angle(), from_rotation(), and rotate_around_point_2d().
Referenced by rotate_around_point_2d().
| float3 blender::math::rotate_direction_around_axis | ( | const float3 & | direction, |
| const float3 & | axis, | ||
| float | angle ) |
Rotate the unit-length direction around the unit-length axis by the angle.
Definition at line 112 of file math_rotation.cc.
References angle(), blender::BLI_assert(), cross(), diff(), dot(), is_unit(), is_zero(), and rotate_direction_around_axis().
Referenced by blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), rotate_direction_around_axis(), blender::bke::rotate_directions_around_axes(), blender::math::tests::TEST(), and blender::ed::sculpt_paint::tilt_apply_to_normal().
|
inlinenodiscard |
Create an CartesianBasis for converting from an a orientation defined only by its forward vector to a b orientation defined only by its forward vector. Rotation is given to be non flipped and deterministic.
Definition at line 430 of file BLI_math_basis_types.hh.
References abs(), from_orthonormal_axes(), blender::math::AxisSigned::next_after(), rotation_between(), and sign().
|
inlinenodiscard |
Create an CartesianBasis for converting from a orientation to b orientation.
Definition at line 415 of file BLI_math_basis_types.hh.
References abs(), blender::math::CartesianBasis::axes, b, rotation_between(), sign(), blender::math::CartesianBasis::x(), blender::math::CartesianBasis::y(), and blender::math::CartesianBasis::z().
Referenced by angle_between(), angle_between_signed(), from_tracking(), rotation_between(), rotation_between(), rotation_between(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), and blender::math::tests::TEST().
|
nodiscard |
Return rotation from orientation a to orientation b into another quaternion.
Definition at line 227 of file BLI_math_rotation.hh.
References b, invert(), and rotation_between().
Definition at line 117 of file BLI_math_base.hh.
Referenced by blender::seq::apply_text_alignment(), blender::geometry::assign_samples_to_segments(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::bke::attribute_math::detail::double2_to_int2(), blender::seq::final_image_cache_get(), blender::seq::final_image_cache_put(), blender::bke::attribute_math::detail::float2_to_short2(), blender::get_build_factor(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::jpeg_density_from_ppm(), blender::ed::space_node::mark_sockets_collapsed_recursive(), blender::nodes::gizmos::node_input_from_rect(), blender::ed::transform::node_snap_grid_apply(), blender::ed::space_node::node_update_basis(), blender::ed::space_node::node_update_basis_buttons(), blender::ed::space_node::node_update_basis_from_declaration(), blender::ed::space_node::node_update_collapsed(), blender::draw::detail::pack_gaussian(), blender::draw::detail::pack_radiance(), round(), round(), blender::compositor::SMAAArea(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::ed::transform::snap_grid(), blender::seq::source_image_cache_get(), blender::seq::source_image_cache_put(), blender::store_pixel(), blender::seq::thumbnail_cache_get(), and blender::uv_copy_mirrored_faces().
|
inlinenodiscard |
Definition at line 364 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and round().
Definition at line 229 of file BLI_math_base.hh.
References acos(), safe_acos(), and T.
Referenced by angle_between(), angle_of(), angle_of_signed(), from_triangle(), from_vector(), blender::ed::sculpt_paint::auto_mask::normal_calc(), pow(), safe_acos(), and to_quaternion_legacy().
Faster/approximate version of safe_acos. Max error 4.51803e-5 (0.00258 degrees).
Definition at line 241 of file BLI_math_base.hh.
References float, safe_acos_approx(), and blender::x.
Referenced by blender::bke::mesh::accumulate_fan_normal(), blender::accumulate_vertex_normals_poly_v3(), blender::accumulate_vertex_normals_tri_v3(), blender::accumulate_vertex_normals_v3(), blender::bm_loop_normal_accum(), blender::bm_mesh_loops_calc_normals_for_loop(), blender::bm_vert_calc_normals_accum_loop(), blender::calc_tangent_spaces(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), and safe_acos_approx().
Definition at line 107 of file BLI_math_base.hh.
References b, safe_divide(), and T.
Referenced by blender::nodes::node_composite_alpha_over_cc::alpha_over_conjoint(), blender::nodes::node_composite_alpha_over_cc::alpha_over_disjoint(), blender::apply_gradient_tint(), blender::ed::sculpt_paint::smooth::average_data_bmesh(), blender::ed::sculpt_paint::smooth::average_data_grids(), blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::geometry::build_point_to_sample_map(), blender::nodes::node_shader_map_range_cc::build_vector_linear(), blender::nodes::node_shader_map_range_cc::build_vector_stepped(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::calc_vertex_displacement(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::xpbd::closest_on_segment_to_ray(), blender::deform_drawing(), blender::nodes::node_composite_difference_key_cc::difference_matte(), blender::nodes::node_composite_distance_key_cc::distance_key(), blender::ed::sculpt_paint::ScaleCurvesEffect::execute(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_constant_size_cpu(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute_cpu(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size_cpu(), blender::nodes::node_composite_bokeh_blur_cc::BokehBlurOperation::execute_variable_size_cpu(), blender::ed::greasepencil::fit_strokes_to_view(), blender::ed::greasepencil::segment::get_intersection_distance_of_segments(), blender::nodes::node_composite_glare_cc::GlareOperation::get_sample_position(), blender::geometry::limit_radius(), blender::ed::sculpt_paint::move_last_point_and_resample(), blender::ed::sculpt_paint::smooth::neighbor_color_average(), blender::nodes::node_fn_integer_math_cc::node_eval_inverse(), blender::nodes::node_shader_math_cc::node_eval_inverse(), blender::nodes::node_shader_vector_math_cc::node_eval_inverse(), blender::openexr_header_metadata_pixelinfo(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), project_point_safe(), blender::fn::multi_function::register_common_functions_impl(), safe_divide(), safe_divide(), safe_divide(), blender::length_parameterize::sample_at_length(), blender::geometry::sample_curve_padded(), blender::nodes::node_shader_map_range_cc::sh_node_map_range_build_multi_function(), blender::stretchto_evaluate(), blender::compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::view3d_panel_curve_data(), blender::wm_xr_navigation_teleport_arc_clip_to_ground(), and blender::zspan_rasterize_conservative_line().
|
inlinenodiscard |
Returns 0 if denominator is exactly equal to 0.
Definition at line 352 of file BLI_math_vector.hh.
References b, safe_divide(), T, and blender::VecBase< T, Size >::VecBase().
|
inlinenodiscard |
Returns 0 if denominator is exactly equal to 0.
Definition at line 342 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_divide().
Definition at line 94 of file BLI_math_base.hh.
References b, safe_floored_mod(), and T.
Referenced by safe_floored_mod().
Definition at line 84 of file BLI_math_base.hh.
References b, safe_mod(), and T.
Referenced by blender::fn::multi_function::register_common_functions_impl(), safe_mod(), safe_mod(), and safe_mod().
|
inlinenodiscard |
Safe version of mod(a, b) that returns 0 if b is equal to 0.
Definition at line 188 of file BLI_math_vector.hh.
References b, mod(), blender::result, safe_mod(), T, and blender::VecBase< T, Size >::VecBase().
|
inlinenodiscard |
Safe version of mod(a, b) that returns 0 if b is equal to 0.
Definition at line 178 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_mod().
Definition at line 199 of file BLI_math_base.hh.
References power(), safe_pow(), T, and blender::x.
Referenced by blender::nodes::node_shader_gamma_cc::node_build_multi_function(), safe_pow(), and safe_pow().
|
inlinenodiscard |
Return the value of x raised to the y power. The result is x if x < 0 or if x = 0 and y <= 0.
Definition at line 242 of file BLI_math_vector.hh.
References blender::result, safe_pow(), T, blender::x, and y.
Definition at line 168 of file BLI_math_base.hh.
References safe_rcp(), and T.
Referenced by blender::ed::sculpt_paint::smooth::average_positions(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::nodes::node_geo_uv_tangent_cc::compute_triangle_tangent(), blender::ed::greasepencil::image_render::draw_dots(), blender::draw::drw_volume_object_mesh_init(), blender::draw::overlay::MeshUVs::end_sync(), blender::xpbd::evaluate_align_rotations_constraint(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::ed::greasepencil::fit_strokes_to_view(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::nodes::node_composite_glare_cc::GlareOperation::karis_brightness_weighted_sum(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), safe_rcp(), safe_rcp(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::tests::TEST(), blender::seq::WipeData::WipeData(), blender::write_fill_transforms(), blender::write_stroke_transforms(), and blender::nodes::node_geo_xpbd_solver_cc::XpbdSolverStep::XpbdSolverStep().
|
inlinenodiscard |
Per-element inverse. Zero elements are evaluated to zero.
Definition at line 413 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and safe_rcp().
|
inlinenodiscard |
Per-element square root. Negative elements are evaluated to zero.
Definition at line 390 of file BLI_math_vector.hh.
References blender::result, safe_sqrt(), and T.
Referenced by safe_sqrt(), and blender::tests::TEST().
|
nodiscard |
Equivalent to mat * from_scale(scale) but with fewer operation.
Definition at line 725 of file BLI_math_matrix.hh.
References blender::BLI_STATIC_ASSERT(), blender::result, scale(), and unroll.
Referenced by blender::bke::build_point_matrix(), blender::io::alembic::ABCTransformWriter::do_write(), filter_kernel_value(), from_loc_rot_scale(), from_loc_scale(), from_rot_scale(), from_scale(), interpolate_fast(), interpolate_fast(), orthogonalize(), blender::io::grease_pencil::SVGImporter::read(), rotate(), scale(), blender::eevee::LookdevModule::sync(), and to_dual_quaternion().
|
inlinenodiscard |
Definition at line 206 of file BLI_math_basis_types.hh.
References blender::math::AxisSigned::sign(), and sign().
Definition at line 38 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::pose::calc_squash_stretch_deform(), blender::noise::compute_3d_orientation(), blender::nodes::node_composite_vector_blur_cc::compute_motion_rect(), float_to_half(), from_up_axis(), midpoint(), blender::fn::multi_function::register_common_functions_impl(), rotation_between(), rotation_between(), blender::bke::greasepencil::Drawing::set_texture_matrices(), sign(), sign(), sign(), blender::tests::TEST(), and to_axis_angle().
|
inlinenodiscard |
Returns -1 if a is less than 0, 0 if a is equal to 0, and +1 if a is greater than 0.
Definition at line 51 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and sign().
| T blender::math::sin | ( | const AngleCartesianBase< T > & | a | ) |
Definition at line 701 of file BLI_math_angle_types.hh.
References blender::math::AngleCartesianBase< T >::sin(), sin(), and T.
| T blender::math::sin | ( | const AngleFraction< T > & | a | ) |
Definition at line 714 of file BLI_math_angle_types.hh.
| T blender::math::sin | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 688 of file BLI_math_angle_types.hh.
References blender::math::AngleRadianBase< T >::radian(), sin(), and T.
Referenced by blender::math::AngleRadianBase< float >::AngleRadianBase(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::compositor::compute_numerator_1(), blender::compositor::compute_numerator_2(), blender::compositor::compute_numerator_3(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), blender::bke::tests::GreasePencilInterpolate::create_test_shape(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_box_mask_cc::BoxMaskOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_cpu(), blender::nodes::node_composite_ellipse_mask_cc::EllipseMaskOperation::execute_cpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_cpu(), blender::nodes::node_composite_directional_blur_cc::DirectionalBlurOperation::execute_gpu(), blender::nodes::node_composite_split_cc::SplitOperation::execute_gpu(), blender::geometry::profile::find_even_superellipse_chords(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), blender::math::detail::from_rotation(), from_triangle(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::ed::greasepencil::generate_circle_from_point(), blender::get_rand_matrix(), blender::compositor::get_regular_polygon_vertex_position(), blender::ed::greasepencil::grease_pencil_primitive_rotate_all_update(), interpolate_dot_slerp(), blender::workbench::SceneResources::load_jitter_tx(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), pow(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::draw::overlay::ring_vertices(), rotate(), blender::ed::sculpt_paint::greasepencil::rotate_by_angle(), blender::rotate_by_angle(), sin(), sin(), sin(), sin(), blender::math::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), blender::write_fill_transforms(), blender::io::grease_pencil::PDFExporter::write_path(), blender::io::grease_pencil::write_stroke_color_attribute(), and blender::write_weights_for_drawing().
Definition at line 179 of file BLI_math_base.hh.
|
static |
Definition at line 603 of file math_matrix.cc.
References blender::MatBase< float, 4, 4 >::identity(), is_equal(), and skip_transform().
Referenced by skip_transform(), transform_points(), and transform_points().
Definition at line 153 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::geometry::construct::build_boundary_terminal_edge(), blender::bke::build_point_matrix_miter_scale(), blender::calc_min_radius_v3v3(), blender::ed::sculpt_paint::pose::calc_squash_stretch_deform(), blender::calculate_circle_inside_fit(), blender::noise::compute_2d_gabor_standard_deviation(), blender::noise::compute_3d_gabor_standard_deviation(), blender::nodes::node_composite_lens_distortion_cc::compute_chromatic_distortion_scale(), blender::nodes::node_composite_lens_distortion_cc::compute_distortion_scale(), blender::nodes::node_composite_lens_distortion_cc::compute_number_of_integration_steps_heuristic(), blender::nodes::node_composite_levels_cc::LevelsOperation::compute_standard_deviation(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::nodes::node_composite_despeckle_cc::DespeckleOperation::execute_cpu(), blender::nodes::node_composite_filter_cc::FilterOperation::execute_cpu(), blender::geometry::profile::find_even_superellipse_chords_general(), blender::geometry::profile::find_superellipse_chord_endpoint(), blender::math::AngleCartesianBase< float >::from_point(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::hook_falloff(), blender::geometry::BevelState::initialize_profile_data(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), length(), blender::multires_reshape_store_original_grids(), normalize(), normalize_and_get_length(), normalize_and_get_length(), blender::math::detail::normalized_to_quat_fast(), blender::math::AngleCartesianBase< float >::operator/, refract(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::ed::transform::snap_object_project_view3d_ex(), sqrt(), sqrt(), blender::tests::TEST(), and blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property().
|
inlinenodiscard |
Per-element square root. Negative elements are evaluated to NaN.
Definition at line 380 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and sqrt().
Definition at line 209 of file BLI_math_base.hh.
Referenced by blender::BKE_light_area(), blender::BKE_mball_polygonize(), blender::bmesh_find_doubles_by_distance_connected_impl(), blender::bone_envelope_falloff(), blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::calc_brush_node_mask(), blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask(), blender::calculate_verts(), blender::compositor::compute_fog_glow_kernel_value(), blender::nodes::node_composite_corner_pin_cc::CornerPinOperation::compute_plane_cpu(), blender::nodes::node_composite_plane_track_deform_cc::PlaneTrackDeformOperation::compute_plane_cpu(), blender::compositor::compute_scaled_poles_variance_derivative(), blender::ed_tracking_pick_plane_track(), blender::ed_tracking_pick_point_track(), blender::xpbd::evaluate_distance_constraint(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu(), blender::execute_curve_chain(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_sun_beams_cpu(), blender::compositor::find_scale_factor(), from_up_axis(), blender::get_space_input_chains(), blender::compositor::morphological_distance_cpu(), blender::nodes::node_geo_grid_solve_poisson_cc::node_geo_exec(), blender::ed::sculpt_paint::pbvh_gather_generic(), blender::KDTreeNew< T >::search(), blender::xpbd::CollisionEdgeConstraintSet::solve_single(), blender::xpbd::CollisionFaceConstraintSet::solve_single(), square(), square(), blender::compositor::sum_squared_difference_color_cpu(), blender::tests::TEST(), to_dual_quaternion(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::uv_remove_doubles_to_selected_shared_vertex().
|
inlinenodiscard |
Per-element square.
Definition at line 279 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and square().
Definition at line 74 of file BLI_math_base.hh.
Referenced by blender::compositor::SMAACalculateDiagWeights(), blender::compositor::SMAADetectHorizontalCornerPattern(), blender::compositor::SMAADetectVerticalCornerPattern(), blender::compositor::SMAALumaEdgeDetectionPS(), step(), step(), step(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inlinenodiscard |
Definition at line 148 of file BLI_math_vector.hh.
References blender::result, step(), and T.
|
inlinenodiscard |
Definition at line 141 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and step().
| T blender::math::tan | ( | const AngleCartesianBase< T > & | a | ) |
Definition at line 705 of file BLI_math_angle_types.hh.
References T, blender::math::AngleCartesianBase< T >::tan(), and tan().
| T blender::math::tan | ( | const AngleFraction< T > & | a | ) |
Definition at line 718 of file BLI_math_angle_types.hh.
| T blender::math::tan | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 692 of file BLI_math_angle_types.hh.
References blender::math::AngleRadianBase< T >::radian(), T, and tan().
Referenced by blender::nodes::node_composite_chroma_key_cc::chroma_matte(), blender::math::projection::perspective_fov(), tan(), tan(), tan(), and tan().
Definition at line 184 of file BLI_math_base.hh.
| blender::math::TEST | ( | math_geom_hh | , |
| AreaPoly | ) |
Definition at line 358 of file BLI_math_geom_hh_test.cc.
References area_poly(), blender::area_poly_v2(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), EXPECT_NEAR, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| AreaTri | ) |
Definition at line 39 of file BLI_math_geom_hh_test.cc.
References area_tri(), blender::area_tri_v3(), EXPECT_NEAR, TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| AxisDominantToM3 | ) |
Definition at line 229 of file BLI_math_geom_hh_test.cc.
References axis_dominant_to_m3(), blender::axis_dominant_v3_to_m3(), EXPECT_NEAR, normalize(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| BarycentricWeights | ) |
Definition at line 325 of file BLI_math_geom_hh_test.cc.
References barycentric_weights(), blender::barycentric_weights_v2(), EXPECT_NEAR, TEST(), blender::v2, and w().
| blender::math::TEST | ( | math_geom_hh | , |
| ClosestToLineSegment3D | ) |
Definition at line 133 of file BLI_math_geom_hh_test.cc.
References closest_to_line_segment(), blender::closest_to_line_segment_v3(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| ClosestToPlane | ) |
Definition at line 168 of file BLI_math_geom_hh_test.cc.
References closest_to_plane(), blender::closest_to_plane_v3(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| ClosestToPlaneNormalized | ) |
Definition at line 153 of file BLI_math_geom_hh_test.cc.
References closest_to_plane_normalized(), blender::closest_to_plane_normalized_v3(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| CotangentTriWeight | ) |
Definition at line 53 of file BLI_math_geom_hh_test.cc.
References cotangent_tri_weight(), blender::cotangent_tri_weight_v3(), EXPECT_NEAR, TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| DistSquaredToLineSegment2D | ) |
Definition at line 106 of file BLI_math_geom_hh_test.cc.
References dist_squared_to_line_segment(), blender::dist_squared_to_line_segment_v2(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| DistSquaredToLineSegment3D | ) |
Definition at line 125 of file BLI_math_geom_hh_test.cc.
References dist_squared_to_line_segment(), blender::dist_squared_to_line_segment_v3(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| DistSquaredToPlane | ) |
Definition at line 185 of file BLI_math_geom_hh_test.cc.
References dist_squared_to_plane(), blender::dist_squared_to_plane_v3(), EXPECT_NEAR, and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| InterpBilinearQuad | ) |
Definition at line 399 of file BLI_math_geom_hh_test.cc.
References blender::EXPECT_EQ(), EXPECT_NEAR, interp_bilinear_quad(), blender::interp_bilinear_quad_v3(), TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| InterpWeightsPoly | ) |
Definition at line 374 of file BLI_math_geom_hh_test.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::data(), EXPECT_NEAR, interp_weights_poly(), blender::interp_weights_poly_v2(), blender::MutableSpan< T >::MutableSpan(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), TEST(), and w().
| blender::math::TEST | ( | math_geom_hh | , |
| IsectLineLine3D | ) |
Definition at line 249 of file BLI_math_geom_hh_test.cc.
References blender::EXPECT_EQ(), EXPECT_NEAR, isect_line_line(), TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| IsectLinePlane | ) |
Definition at line 260 of file BLI_math_geom_hh_test.cc.
References EXPECT_FALSE, EXPECT_NEAR, isect_line_plane(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| IsectPointPoly | ) |
Definition at line 305 of file BLI_math_geom_hh_test.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::EXPECT_EQ(), EXPECT_FALSE, EXPECT_TRUE, isect_point_poly(), blender::isect_point_poly_v2(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| IsectPointQuad2D | ) |
Definition at line 288 of file BLI_math_geom_hh_test.cc.
References blender::EXPECT_EQ(), isect_point_quad(), blender::isect_point_quad_v2(), TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| IsectPointTri2D | ) |
Definition at line 276 of file BLI_math_geom_hh_test.cc.
References blender::EXPECT_EQ(), isect_point_tri(), TEST(), and blender::v2.
| blender::math::TEST | ( | math_geom_hh | , |
| LinePointFactor2D | ) |
Definition at line 217 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, line_point_factor(), blender::line_point_factor_v2(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| LinePointFactor3D | ) |
Definition at line 208 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, line_point_factor(), blender::line_point_factor_v3(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| MapToSphere | ) |
Definition at line 437 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, blender::map_to_sphere(), map_to_sphere(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| NormalQuad | ) |
Definition at line 26 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, normal_quad(), blender::normal_quad_v3(), TEST(), and blender::v2.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| PlaneFromPointNormal | ) |
Definition at line 72 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, plane_from_point_normal(), blender::plane_from_point_normal_v3(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| PlanePointSide | ) |
Definition at line 86 of file BLI_math_geom_hh_test.cc.
References EXPECT_NEAR, plane_point_side(), blender::plane_point_side_v3(), and TEST().
| blender::math::TEST | ( | math_geom_hh | , |
| PolyToTriCount | ) |
Definition at line 348 of file BLI_math_geom_hh_test.cc.
References blender::EXPECT_EQ(), poly_to_tri_count(), blender::poly_to_tri_count(), and TEST().
|
inlinenodiscard |
Extract euler rotation from transform matrix.
Definition at line 1190 of file BLI_math_matrix.hh.
References blender::math::detail::normalized_to_angle(), and to_angle().
Referenced by rotate(), to_angle(), and blender::math::detail::to_rotation().
References to_axis_angle().
| AxisAngleBase< T, AngleT > blender::math::to_axis_angle | ( | const Euler3Base< T > & | euler | ) |
Definition at line 106 of file BLI_math_euler.hh.
References to_axis_angle(), and to_quaternion().
References to_axis_angle().
| AxisAngleBase< T, AngleT > blender::math::to_axis_angle | ( | const EulerXYZBase< T > & | euler | ) |
Definition at line 99 of file BLI_math_euler.hh.
References to_axis_angle(), and to_quaternion().
Referenced by blender::nodes::node_fn_rotation_to_axis_angle_cc::QuaterniontoAxisAngleFunction::call(), blender::io::fbx::create_transform_curve_data(), blender::math::QuaternionBase< T >::expmap(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_eval_inverse(), blender::math::tests::TEST(), to_axis_angle(), to_axis_angle(), to_axis_angle(), to_axis_angle(), to_axis_angle(), and to_axis_angle().
|
extern |
References to_axis_angle().
| AxisAngleBase< T, AngleT > blender::math::to_axis_angle | ( | const QuaternionBase< T > & | quat | ) |
Definition at line 630 of file BLI_math_quaternion.hh.
References abs(), angle(), blender::math::AxisAngleBase< T, AngleT >::axis(), blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::BLI_assert(), blender::math::AxisAngleBase< T, AngleT >::identity(), is_unit_scale(), length(), sign(), T, to_axis_angle(), blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
nodiscard |
Convert transformation mat with parent transform basemat into a dual-quaternion representation.
This allows volume preserving deformation for skinning.
Conversion routines between (regular quaternion, translation) and dual quaternion.
Version 1.0.0, February 7th, 2007
SPDX-License-Identifier: Zlib Copyright 2006-2007 University of Dublin, Trinity College, All Rights Reserved.
Changes for Blender:
Definition at line 554 of file BLI_math_quaternion.hh.
References blender::math::DualQuaternionBase< T >::DualQuaternionBase(), from_rotation(), invert(), is_negative(), is_orthonormal(), length_squared(), normalize(), orthogonalize(), R, scale(), square(), T, to_dual_quaternion(), to_quaternion(), to_scale(), blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::Axis::Y, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
Referenced by blender::math::tests::TEST(), and to_dual_quaternion().
References to_euler().
|
extern |
References to_euler().
| EulerXYZBase< T > blender::math::to_euler | ( | const AxisAngleBase< T, AngleT > & | axis_angle | ) |
Definition at line 97 of file BLI_math_axis_angle.hh.
References blender::math::AxisAngleBase< T, AngleT >::angle(), blender::math::AxisAngleBase< T, AngleT >::axis(), blender::math::EulerXYZBase< T >::EulerXYZBase(), T, to_euler(), and to_quaternion().
| Euler3Base< T > blender::math::to_euler | ( | const AxisAngleBase< T, AngleT > & | axis_angle, |
| EulerOrder | order ) |
Definition at line 90 of file BLI_math_axis_angle.hh.
References to_euler(), and to_quaternion().
Referenced by blender::io::fbx::create_transform_curve_data(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::io::usd::ensure_root_prim(), blender::nodes::node_fn_rotation_to_euler_cc::node_build_multi_function(), blender::nodes::node_fn_euler_to_rotation_cc::node_eval_inverse(), normalized_to_quaternion_safe(), blender::bke::quaternion_to_float2(), blender::bke::quaternion_to_float3(), rotate(), rotate(), rotate(), blender::nodes::node_geo_rotate_instances_cc::rotate_instances(), blender::nodes::inverse_eval::set_modifier_value(), blender::nodes::inverse_eval::set_socket_value(), blender::nodes::inverse_eval::set_value_node_value(), blender::io::usd::USDTransformWriter::set_xform_ops(), blender::bke::store_socket_value(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_euler(), to_nearest_euler(), to_nearest_euler(), blender::math::detail::to_rotation(), and blender::math::detail::to_rotation().
|
extern |
References to_euler().
|
extern |
References to_euler().
|
inlinenodiscard |
Definition at line 1205 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), and to_euler().
|
inlinenodiscard |
Definition at line 1196 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), and to_euler().
|
inlinenodiscard |
Definition at line 1221 of file BLI_math_matrix.hh.
References to_euler().
|
inlinenodiscard |
Definition at line 1215 of file BLI_math_matrix.hh.
References to_euler().
|
extern |
References to_euler().
|
extern |
References to_euler().
| EulerXYZBase< T > blender::math::to_euler | ( | const QuaternionBase< T > & | quat | ) |
Definition at line 660 of file BLI_math_quaternion.hh.
References blender::BLI_assert(), from_rotation(), is_unit_scale(), and to_euler().
| Euler3Base< T > blender::math::to_euler | ( | const QuaternionBase< T > & | quat, |
| EulerOrder | order ) |
Definition at line 668 of file BLI_math_quaternion.hh.
References blender::BLI_assert(), from_rotation(), is_unit_scale(), and to_euler().
|
nodiscard |
Convert euler rotation to gimbal rotation matrix.
Definition at line 368 of file BLI_math_rotation.hh.
References from_rotation(), blender::math::Euler3Base< T >::i(), blender::result, T, and to_gimbal_axis().
Referenced by blender::math::tests::TEST(), and to_gimbal_axis().
|
inline |
Definition at line 1368 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), to_loc_rot_scale(), and to_rot_scale().
Referenced by blender::nodes::node_composite_image_info_cc::ImageInfoOperation::execute(), interpolate_fast(), rotate(), blender::io::usd::USDTransformWriter::set_xform_ops(), to_loc_rot_scale(), to_loc_rot_scale(), and to_loc_rot_scale_safe().
|
inline |
Definition at line 1393 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), to_loc_rot_scale(), and to_rot_scale().
|
inline |
Same as to_loc_rot_scale but is handles matrices that are not only location, rotation and scale more gracefully, e.g. when the matrix has skew.
Definition at line 1407 of file BLI_math_matrix.hh.
References to_loc_rot_scale(), to_loc_rot_scale_safe(), and to_quaternion().
Referenced by blender::nodes::node_geo_object_info_cc::ObjectInfoOperation::execute(), blender::bke::attribute_math::float4x4Mixer::mix_in(), blender::bke::attribute_math::mix_indices(), blender::bke::attribute_math::mix_indices(), blender::nodes::node_fn_combine_transform_cc::node_eval_inverse(), blender::nodes::node_geo_object_info_cc::node_geo_exec(), blender::ed::object::set_local_object_transform(), blender::bke::greasepencil::Layer::set_local_transform(), and to_loc_rot_scale_safe().
|
inlinenodiscard |
Definition at line 1228 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), blender::math::Euler3Base< T >::order(), to_nearest_euler(), and blender::math::Euler3Base< T >::wrapped_around().
|
inlinenodiscard |
Extract euler rotation from transform matrix. The returned euler triple is given to be the closest from the reference. It avoids axis flipping for animated f-curves for eg.
Definition at line 1243 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), to_nearest_euler(), and blender::math::EulerXYZBase< T >::wrapped_around().
Referenced by rotate(), blender::tests::TEST(), to_nearest_euler(), to_nearest_euler(), to_nearest_euler(), and to_nearest_euler().
|
inlinenodiscard |
Definition at line 1258 of file BLI_math_matrix.hh.
References to_euler(), and to_nearest_euler().
|
inlinenodiscard |
Definition at line 1266 of file BLI_math_matrix.hh.
References to_euler(), and to_nearest_euler().
|
extern |
References to_quaternion().
| QuaternionBase< T > blender::math::to_quaternion | ( | const AxisAngleBase< T, AngleT > & | axis_angle | ) |
Definition at line 71 of file BLI_math_axis_angle.hh.
References blender::math::AxisAngleBase< T, AngleT >::angle(), blender::math::AxisAngleBase< T, AngleT >::axis(), blender::BLI_assert(), cos(), is_unit_scale(), blender::math::QuaternionBase< T >::QuaternionBase(), sin(), T, and to_quaternion().
Referenced by blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::brush_delta_update(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_geo_mesh_primitive_cube_cc::create_cube_mesh(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::compositor::SingleValueNodeInputOperation::execute(), blender::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curve_curved(), blender::bke::float2_to_quaternion(), blender::bke::float3_to_quaternion(), blender::bke::float_to_quaternion(), from_vector(), blender::compositor::get_effect_input(), blender::compositor::get_input_value_link(), blender::nodes::init_socket_cpp_value(), interpolate(), blender::make_socket_type_rotation(), blender::bke::attribute_math::mix4(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_euler_to_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_input_rotation_cc::node_build_multi_function(), blender::nodes::node_fn_rotation_to_axis_angle_cc::node_eval_inverse(), blender::nodes::node_fn_rotation_to_euler_cc::node_eval_inverse(), blender::nodes::node_geo_tool_3d_cursor_cc::node_geo_exec(), normalized_to_quaternion_safe(), rotate(), blender::seq::set_single_input_from_rna_value(), blender::math::tests::TEST(), to_axis_angle(), to_axis_angle(), to_dual_quaternion(), to_euler(), to_euler(), to_loc_rot_scale_safe(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), to_quaternion(), and blender::math::detail::to_rotation().
|
extern |
References to_quaternion().
| QuaternionBase< T > blender::math::to_quaternion | ( | const CartesianBasis & | rotation | ) |
Creates a quaternion from an axis triple. This is faster and more precise than converting from another representation.
There are only 6 * 4 = 24 possible valid orthonormal orientations. We precompute them and store them inside this switch using a key. Generated using generate_axes_to_quaternion_switch_cases().
Definition at line 400 of file BLI_math_rotation.hh.
References blender::math::QuaternionBase< T >::identity(), rcp(), T, to_quaternion(), blender::x, blender::math::AxisSigned::X_NEG, blender::math::AxisSigned::X_POS, y, blender::math::AxisSigned::Y_NEG, blender::math::AxisSigned::Y_POS, z(), blender::math::AxisSigned::Z_NEG, and blender::math::AxisSigned::Z_POS.
|
extern |
References to_quaternion().
| QuaternionBase< T > blender::math::to_quaternion | ( | const Euler3Base< T > & | eulO | ) |
Definition at line 75 of file BLI_math_euler.hh.
References blender::math::Euler3Base< T >::i_index(), blender::math::Euler3Base< T >::ijk(), blender::math::Euler3Base< T >::j_index(), blender::math::Euler3Base< T >::k_index(), blender::math::Euler3Base< T >::parity(), to_quaternion(), UNPACK3, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::EulerBase< T >::y(), blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
extern |
References to_quaternion().
| QuaternionBase< T > blender::math::to_quaternion | ( | const EulerXYZBase< T > & | eul | ) |
Definition at line 50 of file BLI_math_euler.hh.
References cos(), sin(), T, to_quaternion(), blender::math::QuaternionBase< T >::w, blender::math::EulerBase< T >::x(), blender::math::QuaternionBase< T >::x, blender::math::EulerBase< T >::y(), blender::math::QuaternionBase< T >::y, blender::math::EulerBase< T >::z(), and blender::math::QuaternionBase< T >::z.
|
inlinenodiscard |
Extract quaternion rotation from transform matrix.
Definition at line 1274 of file BLI_math_matrix.hh.
References blender::math::detail::normalized_to_quat_with_checks(), and to_quaternion().
|
inlinenodiscard |
Definition at line 1280 of file BLI_math_matrix.hh.
References to_quaternion().
|
nodiscard |
Extract quaternion rotation from transform matrix. Legacy version of to_quaternion which has slightly different behavior. Keep for particle-system & boids since replacing this will make subtle changes that impact hair in existing files. See: D15772.
Definition at line 442 of file math_matrix.cc.
References atan2(), conjugate(), cos(), normalize(), safe_acos(), sin(), to_quaternion_legacy(), transform_point(), blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().
Referenced by rotate(), blender::tests::TEST(), and to_quaternion_legacy().
|
inline |
Decompose a matrix into location, rotation, and scale components.
| AllowNegativeScale | if true, will compute determinant to know if matrix is negative. Rotation and scale values will be flipped if it is negative. This is a costly operation so it is disabled by default. |
Definition at line 1353 of file BLI_math_matrix.hh.
References is_negative(), normalize_and_get_size(), to_rot_scale(), and blender::math::detail::to_rotation().
Referenced by interpolate_fast(), rotate(), to_loc_rot_scale(), to_loc_rot_scale(), to_rot_scale(), and to_rot_scale().
|
inline |
Definition at line 1378 of file BLI_math_matrix.hh.
References is_negative(), normalize_and_get_size(), to_rot_scale(), and blender::math::detail::to_rotation().
|
inlinenodiscard |
Definition at line 1312 of file BLI_math_matrix.hh.
References is_negative(), length(), blender::result, and to_scale().
|
inlinenodiscard |
Extract the absolute 3d scale from a transform matrix.
| AllowNegativeScale | if true, will compute determinant to know if matrix is negative. This is a costly operation so it is disabled by default. |
Definition at line 1300 of file BLI_math_matrix.hh.
References is_negative(), length(), blender::result, to_scale(), blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().
Referenced by blender::BKE_light_area(), blender::boundbox_to_dimensions(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::ed::greasepencil::create_curves_outline(), blender::io::usd::USDPointInstancerWriter::do_write(), blender::ed::greasepencil::image_render::draw_circles(), blender::generate_curves(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::eevee::IrradianceBake::init(), blender::bke::attribute_math::mix3(), blender::bke::attribute_math::mix4(), blender::draw::overlay::LightProbes::object_sync(), blender::workbench::VolumePass::object_sync_volume(), rotate(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::eevee::IrradianceBake::surfels_create(), to_dual_quaternion(), to_scale(), to_scale(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
Create basis vector.
Definition at line 322 of file BLI_math_basis_types.hh.
References blender::math::Axis::as_int(), blender::BLI_assert(), T, and to_vector().
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::math::detail::from_rotation(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::ed::view3d::geometry_nodes_gizmos::matrix_from_position_and_up_direction(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), to_vector(), to_vector(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), and blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property().
| T blender::math::to_vector | ( | const AxisSigned | axis | ) |
Create signed basis vector.
Definition at line 331 of file BLI_math_basis_types.hh.
References abs(), blender::BLI_assert(), blender::math::AxisSigned::from_int(), blender::math::AxisSigned::is_negative(), T, and to_vector().
|
extern |
References transform_direction().
|
extern |
References transform_direction().
|
nodiscard |
Transform a 3d direction vector using a 3x3 matrix (rotation & scale).
Definition at line 1659 of file BLI_math_matrix.hh.
References transform_direction().
Referenced by blender::apply_to_curves_point_selection(), blender::assign_final_coords_from_mdisps(), blender::assign_final_elements_from_orig_mdisps(), blender::bke::subdiv::average_read_displacement_object(), blender::ed::sculpt_paint::calc_brush_plane(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_position_without_interpolation(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::edbm_flatten_exec(), blender::bke::subdiv::eval_displacement(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::get_axis_gizmo_matrix_basis(), blender::workbench::get_light_data_from_studio_solidlight(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::workbench::ShadowPass::init(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::modify_drawing(), blender::multires_reshape_apply_base_update_mesh_coords(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_transform_direction_cc::node_build_multi_function(), blender::object_grid_element_to_tangent_displacement(), blender::ed::object::object_origin_set_exec(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::project_brush_radius_grease_pencil(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::transform::raycastMesh(), rotate(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::ed::sculpt_paint::stroke_cache_common_init(), blender::ed::sculpt_paint::stroke_cache_init(), blender::ed::sculpt_paint::tilt_apply_to_normal(), blender::ed::transform::transdata_elem_translate(), transform_direction(), transform_direction(), transform_direction(), transform_direction(), blender::ed::greasepencil::boolean::transform_plane(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), and blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property().
|
nodiscard |
Transform a 3d direction vector using a 4x4 matrix (rotation & scale).
Definition at line 1665 of file BLI_math_matrix.hh.
References transform_direction().
| VecBase< T, 3 > blender::math::transform_direction_transposed | ( | const MatBase< T, 3, 3 > & | mat, |
| const VecBase< T, 3 > & | direction ) |
mat is treated as if it were transposed. This is typically used for transforming normals which requires the use of the transpose of the inverse of the transformation matrix.
Definition at line 1676 of file BLI_math_matrix.hh.
References T, transform_direction_transposed(), blender::x, y, and z().
Referenced by blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), transform_direction_transposed(), and transform_direction_transposed().
| VecBase< T, 3 > blender::math::transform_direction_transposed | ( | const MatBase< T, 4, 4 > & | mat, |
| const VecBase< T, 3 > & | direction ) |
Definition at line 1689 of file BLI_math_matrix.hh.
References T, transform_direction_transposed(), blender::x, y, and z().
| void blender::math::transform_normals | ( | const float3x3 & | transform, |
| MutableSpan< float3 > | normals ) |
Transform normal vectors, maintaining their unit length status, but implementing some optimizations for identity matrix and uniform scaling.
Definition at line 554 of file math_matrix.cc.
References blender::Default, blender::MatBase< float, 3, 3 >::identity(), blender::MutableSpan< T >::index_range(), invert(), is_equal(), is_similarity_transform(), normalize(), blender::threading::parallel_for(), PRF_scope, transform_normals(), and transpose().
Referenced by blender::geometry::execute_realize_curve_task(), blender::ed::mesh::join_normals(), blender::bke::transform_custom_normal_attribute(), transform_normals(), transform_normals(), and blender::tests::transform_normals_test().
| void blender::math::transform_normals | ( | Span< float3 > | src, |
| const float3x3 & | transform, | ||
| MutableSpan< float3 > | dst ) |
Definition at line 578 of file math_matrix.cc.
References blender::MutableSpan< T >::copy_from(), blender::Default, blender::MatBase< float, 3, 3 >::identity(), blender::Span< T >::index_range(), invert(), is_equal(), is_similarity_transform(), normalize(), blender::threading::parallel_for(), PRF_scope, transform_normals(), and transpose().
|
inlinenodiscard |
Definition at line 446 of file BLI_math_basis_types.hh.
References blender::math::Axis::as_int(), blender::math::AxisSigned::axis(), blender::math::AxisSigned::is_negative(), blender::result, transform_point(), blender::v, blender::math::CartesianBasis::x(), blender::math::CartesianBasis::y(), and blender::math::CartesianBasis::z().
Referenced by blender::bke::BoneDeformLinearMixer< full_deform >::accumulate(), blender::bke::BoneDeformLinearMixer< full_deform >::accumulate_bbone(), blender::geometry::add_curves_on_mesh(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::sculpt_paint::apply_crazyspace_to_translations(), blender::apply_gradient_tint(), blender::apply_stroke_transform(), blender::apply_to_curves_point_selection(), blender::ed::transform::applyTranslationValue(), blender::bke::armature_vert_task_with_mixer(), blender::BKE_grease_pencil_point_coords_apply(), blender::BKE_grease_pencil_point_coords_apply_with_mat4(), blender::BKE_grease_pencil_point_coords_get(), blender::BKE_object_minmax(), blender::draw::overlay::BoneInstanceData::BoneInstanceData(), blender::ed::greasepencil::boundary_to_curves(), blender::bounds_min_max_with_transform(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::calc_local_positions(), blender::ed::sculpt_paint::pose::calc_segment_translations(), blender::seq::calc_strip_transform_matrix(), blender::ed::sculpt_paint::calc_symm_area_transform_translations(), blender::ed::sculpt_paint::calc_transform_translations(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::transform::calculate_new_origin_position(), blender::geometry::profile::calculate_profile_segments(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical_with_symmetry(), blender::ed::vse::cursor_set_by_mouse_position(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::deform_drawing(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), blender::dims_apply_restore(), blender::dims_apply_store(), blender::io::usd::USDHairWriter::do_write(), blender::ed::greasepencil::image_render::draw_circles(), blender::ed::greasepencil::draw_control_points(), blender::ed::greasepencil::image_render::draw_dot(), blender::ed::greasepencil::image_render::draw_dots(), blender::ed::greasepencil::image_render::draw_grease_pencil_stroke(), blender::ed::greasepencil::image_render::draw_lines(), blender::ed::greasepencil::image_render::draw_polyline(), blender::draw::drw_debug_matrix(), blender::drw_shgroup_bone_relationship_lines_ex(), blender::drw_shgroup_bone_stick(), blender::DRW_text_edit_mesh_measure_stats(), blender::edbm_fit_edge_loops_to_annotation_exec(), blender::edbm_rip_edge_exec(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::xpbd::evaluate_rod_stretch_and_shear_constraint(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::geometry::extend_curve_curved(), blender::bke::fill_mesh_positions(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical_with_symmetry(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_points_in_stroke_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors_with_symmetry(), from_triangle(), from_vector(), blender::draw::View::frustum_boundbox_calc(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::greasepencil::get_boundary_bounds(), blender::get_distance_factor(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::ed::sculpt_paint::grease_pencil_cursor_draw(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_compute_centroid(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::seq::image_transform_quad_get(), blender::ed::sculpt_paint::imapaint_pick_face(), blender::init_curves_point_selection_status(), blender::ViewOpsData::init_navigation(), blender::ed::sculpt_paint::CombOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::sculpt_paint::DeleteOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::initialize_spherical_brush_reference_point(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), blender::median_bounds_add(), blender::median_dims_scale_matrix_calc(), blender::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::MOD_lineart_gpencil_generate_v3(), blender::ed::sculpt_paint::PaintStroke::modal(), blender::ed::transform::nearest_world_tree(), blender::nodes::node_fn_rotate_vector_cc::node_build_multi_function(), blender::nodes::node_fn_transform_point_cc::node_build_multi_function(), blender::nodes::node_geo_tool_3d_cursor_cc::node_geo_exec(), blender::ed::sculpt_paint::node_in_box(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Relations::object_sync(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical_with_symmetry(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::pixel_radius_update(), blender::ed::greasepencil::DrawingPlacement::place(), blender::ed::greasepencil::primitive_local_to_screen(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::greasepencil::DrawingPlacement::project(), blender::io::grease_pencil::GreasePencilExporter::project_to_screen(), blender::ed::greasepencil::DrawingPlacement::project_with_shift(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::sculpt_paint::raycast_init(), blender::ed::transform::raycastMesh(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical_with_symmetry(), blender::ed::transform::SnapData::register_result(), blender::ed::transform::SnapData::register_result_raycast(), blender::ed::greasepencil::DrawingPlacement::reproject(), rotate(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::sample_curves_surface_3d_brush(), blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), blender::ed::vse::sequencer_text_editing_cursor_region_xy_get(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::geometry::construct::snap_to_pipe_profile(), blender::ed::transform::snapCamera(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), blender::seq::strip_result_covers_strip_quad(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::ed::vse::text_edit_draw_cursor(), blender::ed::vse::text_selection_draw(), to_quaternion_legacy(), blender::bounds::transform_bounds(), blender::bounds::transform_bounds(), blender::ed::sculpt_paint::transform_brush_radius(), blender::ed::greasepencil::boolean::transform_plane(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_point(), transform_points_no_threading(), transform_points_no_threading(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::geometry::construct::tri_corner_adj_vmesh(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::image_engine::OneTexture::update_bounds(), blender::image_engine::ScreenTileTextures< Divisions >::update_bounds(), blender::view3d_calc_point_in_selected_bounds(), blender::view3d_orbit_calc_center(), blender::ed::sculpt_paint::greasepencil::view_positions_from_curve_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_left_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_positions_right_from_point_mask(), blender::ed::sculpt_paint::greasepencil::view_radii_from_point_selection(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), blender::WIDGETGROUP_camera_refresh(), blender::io::obj::OBJWriter::write_vertex_coords(), and blender::write_weights_for_drawing().
|
nodiscard |
Transform point using the dual-quaternion dq . Applying the DualQuaternion transform can only happen if the DualQuaternion was normalized first. Optionally outputs crazy space matrix.
From: "Skinning with Dual Quaternions" Ladislav Kavan, Steven Collins, Jiri Zara, Carol O'Sullivan Trinity College Dublin, Czech Technical University in Prague
Definition at line 492 of file BLI_math_quaternion.hh.
References blender::BLI_assert(), is_normalized(), is_unit_scale(), M, blender::math::DualQuaternionBase< T >::quat, blender::result, blender::math::DualQuaternionBase< T >::scale, blender::math::DualQuaternionBase< T >::scale_weight, T, blender::math::DualQuaternionBase< T >::trans, and transform_point().
|
extern |
References transform_point().
|
extern |
References transform_point().
|
nodiscard |
Transform a 2d point using a 2x2 matrix (rotation & scale).
Definition at line 1635 of file BLI_math_matrix.hh.
References transform_point().
|
nodiscard |
Transform a 2d point using a 3x3 matrix (location & rotation & scale).
Definition at line 1641 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and transform_point().
|
nodiscard |
Transform a 3d point using a 3x3 matrix (rotation & scale).
Definition at line 1647 of file BLI_math_matrix.hh.
References transform_point().
|
nodiscard |
Transform a 3d point using a 4x4 matrix (location & rotation & scale).
Definition at line 1653 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and transform_point().
|
inlinenodiscard |
Transform v by rotation using the quaternion q.
Definition at line 319 of file BLI_math_quaternion.hh.
References conjugate(), R, T, transform_point(), UNPACK3, V, blender::v, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
| void blender::math::transform_points | ( | const float4x4 & | transform, |
| MutableSpan< float3 > | points, | ||
| bool | use_threading = true ) |
Transform point vectors with matrix multiplication, optionally using multi-threading.
Definition at line 646 of file math_matrix.cc.
References blender::MutableSpan< T >::index_range(), blender::threading::parallel_for(), skip_transform(), transform_points(), and transform_points_no_threading().
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::greasepencil::add_armature_envelope_weights(), blender::ed::object::apply_objects_internal(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::ed::sculpt_paint::brushes::calc_bmesh(), blender::ed::sculpt_paint::brushes::calc_faces(), blender::ed::sculpt_paint::brushes::calc_grids(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::ed::greasepencil::create_curves_outline(), blender::ed::object::data_xform_by_mat4(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_mesh_task(), blender::geometry::execute_realize_pointcloud_task(), blender::geometry::execute_realize_pointcloud_tasks(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::draw::grease_pencil_cache_add_nurbs(), blender::draw::grease_pencil_edit_batch_ensure(), blender::draw::grease_pencil_weight_batch_ensure(), blender::ed::mesh::join_positions(), blender::ed::mesh::join_shape_keys(), blender::bke::mesh_transform(), blender::ed::sculpt_paint::greasepencil::process_stroke_weights(), blender::ed::sculpt_paint::brushes::sample_node_surface_bmesh(), blender::ed::sculpt_paint::brushes::sample_node_surface_grids(), blender::ed::sculpt_paint::brushes::sample_node_surface_mesh(), blender::bke::CurvesGeometry::transform(), blender::geometry::transform_curve_edit_hints(), blender::geometry::transform_grease_pencil_edit_hints(), blender::geometry::transform_pointcloud(), transform_points(), and transform_points().
| void blender::math::transform_points | ( | Span< float3 > | src, |
| const float4x4 & | transform, | ||
| MutableSpan< float3 > | dst, | ||
| bool | use_threading = true ) |
Definition at line 618 of file math_matrix.cc.
References blender::MutableSpan< T >::copy_from(), blender::Span< T >::index_range(), blender::threading::parallel_for(), skip_transform(), transform_points(), and transform_points_no_threading().
|
static |
Definition at line 638 of file math_matrix.cc.
References blender::Default, position, PRF_scope, transform_point(), and transform_points_no_threading().
|
static |
Definition at line 608 of file math_matrix.cc.
References blender::Default, blender::Span< T >::index_range(), PRF_scope, transform_point(), and transform_points_no_threading().
Referenced by transform_points(), transform_points(), transform_points_no_threading(), and transform_points_no_threading().
|
nodiscard |
Equivalent to mat * from_location(translation) but with fewer operation.
Definition at line 665 of file BLI_math_matrix.hh.
References blender::BLI_STATIC_ASSERT(), blender::result, translate(), and unroll.
Referenced by blender::image_engine::Instance::compute_screen_space_to_sampler_space_transformation(), blender::ed::sculpt_paint::cursor_space_drawing_setup(), blender::compositor::RealizeOnDomainOperation::execute(), blender::ed::sculpt_paint::layer_brush_height_preview_draw(), blender::draw::overlay::Fluids::object_sync(), blender::draw::overlay::ForceFields::object_sync(), blender::compositor::Domain::realize_transformation(), blender::eevee::CaptureView::render_probes(), and translate().
|
nodiscard |
Flip the matrix across its diagonal. Also flips dimensions for non square matrices.
Definition at line 657 of file BLI_math_matrix.hh.
References blender::result, transpose(), and blender::unroll().
Referenced by blender::ocio::LibOCIOView::append_scope_space_transforms(), blender::ed::greasepencil::calculate_texture_space(), blender::ed::transform::SnapData::clip_planes_enable(), blender::ocio::create_ocio_display_processor(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ocio::create_untonemapped_ocio_display_transform(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::ocio::display_as_extended_srgb(), blender::io::usd::USDTransformWriter::do_write(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::io::usd::ensure_root_prim(), blender::ed::spreadsheet::format_matrix_to_grid(), blender::get_legacy_stroke_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::nodes::node_fn_transpose_matrix_cc::node_build_multi_function(), polar_decompose(), pseudo_invert(), blender::draw::sculpt_batches_get_ex(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::eevee::VolumeProbeModule::set_view(), blender::eevee::Camera::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::eevee::ShadowTileMap::sync_orthographic(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), transform_normals(), transform_normals(), blender::tests::transform_normals_test(), and transpose().
|
constexpr |
Definition at line 178 of file BLI_math_vector_types.hh.
References BLI_assert_unreachable_static, blender::BLI_STATIC_ASSERT(), blender::get_default_hash(), T, and vector_hash().
Referenced by blender::VecBase< T, 3 >::hash(), and vector_hash().
Definition at line 962 of file math_color.cc.
References clamp(), interpolate(), blender::math::locus_entry_t::mired, normalize(), planck_locus, blender::math::locus_entry_t::t, blender::math::locus_entry_t::uv, whitepoint_from_temp_tint(), blender::x, and y.
Referenced by blender::ocio::calculate_white_point_matrix(), blender::nodes::node_composite_color_balance_cc::get_white_point_matrix(), blender::IMB_colormanagement_get_whitepoint(), blender::nodes::node_composite_color_balance_cc::white_point_variable(), and whitepoint_from_temp_tint().
| bool blender::math::whitepoint_to_temp_tint | ( | const float3 & | white, |
| float & | temperature, | ||
| float & | tint ) |
Definition at line 930 of file math_color.cc.
References blender::math::locus_entry_t::dist(), dot(), interpolate(), length(), blender::math::locus_entry_t::mired, planck_locus, sqrtf, blender::math::locus_entry_t::t, blender::math::locus_entry_t::uv, and whitepoint_to_temp_tint().
Referenced by blender::IMB_colormanagement_set_whitepoint(), and whitepoint_to_temp_tint().
Equal to int(mod_periodic(u, float(size))) for |u| <= MAXINT. However other values of u, including inf and NaN, produce in-range values, this is also at least 5% faster.
Definition at line 229 of file BLI_math_interp.hh.
References floor(), wrap_coord(), and blender::x.
| BLI_INLINE int32_t blender::math::wrap_coord | ( | float | u, |
| int32_t | size, | ||
| InterpWrapMode | wrap ) |
Definition at line 48 of file BLI_math_interp.hh.
References BLI_INLINE, Border, floorf, Repeat, blender::gpu::wrap(), wrap_coord(), and blender::x.
Referenced by bicubic_interpolation(), interpolate_bilinear_wrap_byte(), interpolate_bilinear_wrapmode_fl(), interpolate_nearest_wrap_byte(), interpolate_nearest_wrap_fl(), interpolate_nearest_wrapmode_fl(), wrap_coord(), and wrap_coord().
|
inlineconstexpr |
Definition at line 20 of file BLI_math_base.hh.
Referenced by blender::seq::gaussian_blur_x(), and blender::seq::gaussian_blur_y().
|
inlineconstexpr |
Definition at line 21 of file BLI_math_base.hh.
|
static |
Definition at line 911 of file math_color.cc.
Referenced by whitepoint_from_temp_tint(), and whitepoint_to_temp_tint().