|
Blender V4.3
|
Namespaces | |
| namespace | detail |
| namespace | numbers |
| 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 | 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 > | |
| 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 | square (const T &a) |
| template<typename T > | |
| T | exp (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) |
| uint16_t | float_to_half (float v) |
| float | half_to_float (uint16_t v) |
| void | float_to_half_array (const float *src, uint16_t *dst, size_t length) |
| void | half_to_float_array (const uint16_t *src, float *dst, size_t length) |
| 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) |
| 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) |
| 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) |
| void | interpolate_bilinear_wrap_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y) |
| 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) |
| 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) |
| 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 > | max (const VecBase< T, Size > &a, const VecBase< T, Size > &b) |
| 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 > | pow (const VecBase< T, Size > &x, const T &y) |
| 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 > | 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 > | |
| 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 > | |
| 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) |
| template<enum eCubicFilter filter> | |
| static float4 | cubic_filter_coefficients (float f) |
| template<typename T , eCubicFilter filter> | |
| static void | bicubic_interpolation (const T *src_buffer, T *output, int width, int height, int components, float u, float v) |
| template<bool border> | |
| BLI_INLINE void | bilinear_fl_impl (const float *buffer, float *output, int width, int height, int components, float u, float v, bool wrap_x=false, bool wrap_y=false) |
| template<bool border> | |
| BLI_INLINE uchar4 | bilinear_byte_impl (const uchar *buffer, int width, int height, float u, float v) |
| 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) |
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 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, 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 T > | |
| VecBase< T, 3 > | transform_point (const QuaternionBase< T > &q, const VecBase< T, 3 > &v) |
Compare / Test | |
| template<typename T , int Size> | |
| bool | is_negative (const MatBase< T, Size, Size > &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 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 , int N, int NumRow> | |
| VecBase< T, N > | project_point (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) |
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) |
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 float4x4 &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) |
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 90 of file BLI_math_axis_angle_types.hh.
Definition at line 91 of file BLI_math_axis_angle_types.hh.
Definition at line 317 of file BLI_math_quaternion_types.hh.
| using blender::math::Euler3 = Euler3Base<float> |
Definition at line 436 of file BLI_math_euler_types.hh.
| using blender::math::EulerXYZ = EulerXYZBase<float> |
Definition at line 435 of file BLI_math_euler_types.hh.
| using blender::math::Quaternion = QuaternionBase<float> |
Definition at line 316 of file BLI_math_quaternion_types.hh.
|
strong |
| Enumerator | |
|---|---|
| BSpline | |
| Mitchell | |
Definition at line 23 of file math_interp.cc.
| Enumerator | |
|---|---|
| XYZ | |
| XZY | |
| YXZ | |
| YZX | |
| ZXY | |
| ZYX | |
Definition at line 40 of file BLI_math_euler_types.hh.
|
inline |
Definition at line 201 of file BLI_math_basis_types.hh.
Definition at line 33 of file BLI_math_base.hh.
Referenced by almost_equal_relative(), angle_between(), blender::math::AngleCartesianBase< T >::AngleCartesianBase(), blender::apply_stroke_transform(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::filter::calc_sphere_translations(), blender::bke::pbvh::pixels::CopyPixelCommand::can_be_extended(), blender::math::CartesianBasis::CartesianBasis(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::ed::sculpt_paint::clip_and_lock_translations(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_diameter_of_circle_of_confusion(), blender::compositor::compute_motion_rect(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::realtime_compositor::compute_realized_transformation_domain(), convexhull_2d_angle_iter_init(), blender::draw::create_lines_for_remaining_edges(), cross(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), dominant_axis(), blender::imbuf::transform::edge_aa(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_horizontal_pass(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::execute_step_vertical_pass(), blender::geometry::extend_curves_curved(), blender::find_envelope(), blender::realtime_compositor::find_scale_factor(), from_orthonormal_axes(), blender::ed::greasepencil::generate_arc_from_point_to_point(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::get_morphological_distance_threshold_radius(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), blender::realtime_compositor::horizontal_pass(), interpolate_dot_slerp(), is_equal(), is_equal(), is_equal(), blender::compositor::is_inside_motion_line(), is_orthogonal(), is_orthonormal(), is_uniformly_scaled(), is_unit(), is_unit_scale(), is_unit_scale(), is_zero(), length_manhattan(), blender::draw::lines_adjacency_triangle(), mod_periodic(), blender::realtime_compositor::morphological_distance(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_done(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), OVERLAY_wireframe_cache_init(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), project_point(), blender::seq::query_thumbnail(), blender::math::AngleFraction< T >::radian(), rotation_between(), rotation_between(), blender::nodes::node_fn_integer_math_cc::safe_divide_round_i(), blender::draw::overlay::ShapeCache::ShapeCache(), blender::Bounds< T >::size(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAALumaEdgeDetectionPS(), snap_object_context_runtime_init(), blender::eevee::IrradianceBake::surfels_create(), blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), blender::tests::TEST(), to_vector(), blender::compositor::BokehImageOperation::update_memory_buffer_partial(), blender::compositor::VariableSizeBokehBlurOperation::update_memory_buffer_partial(), blender::realtime_compositor::vertical_pass(), and blender::math::AngleFraction< T >::wrapped().
Definition at line 39 of file BLI_math_vector.hh.
References result.
Definition at line 169 of file BLI_math_base.hh.
Referenced by blender::noise::compute_3d_orientation(), interpolate_dot_slerp(), and safe_acos().
Returns the adjoint of the matrix (also known as adjugate matrix).
Definition at line 157 of file math_matrix.cc.
References determinant(), and T.
|
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 26 of file BLI_math_vector.hh.
References abs(), b, and distance().
Referenced by blender::bke::curves::poly::calculate_tangents(), blender::bke::curves::poly::direction_bisect(), and blender::bke::CurvesGeometry::evaluated_tangents().
|
nodiscard |
Definition at line 163 of file BLI_math_rotation.hh.
References abs(), 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 150 of file BLI_math_rotation.hh.
References angle_of(), b, and rotation_between().
Referenced by blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::geometry::extend_curves_curved(), and blender::math::tests::TEST().
|
nodiscard |
Definition at line 156 of file BLI_math_rotation.hh.
References b, BLI_assert, 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 180 of file BLI_math_rotation.hh.
References angle_of_signed(), b, and rotation_between().
Referenced by 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 123 of file BLI_math_rotation.hh.
References BLI_assert, is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.
Referenced by angle_between(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::math::tests::TEST(), and blender::nodes::node_geo_transform_geometry_cc::use_translate().
|
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 137 of file BLI_math_rotation.hh.
References BLI_assert, is_unit_scale(), safe_acos(), T, and blender::math::QuaternionBase< T >::w.
Referenced by angle_between_signed(), and blender::math::tests::TEST().
Definition at line 218 of file BLI_math_base.hh.
Definition at line 223 of file BLI_math_base.hh.
Referenced by blender::tests::TEST().
Definition at line 228 of file BLI_math_base.hh.
Referenced by 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< T >::operator T(), to_quaternion_legacy(), and blender::write_fill_transforms().
Definition at line 616 of file BLI_math_vector.hh.
References reduce_add(), and T.
Referenced by blender::ed::greasepencil::create_curves_outline(), blender::ed::greasepencil::image_render::create_shader_ubo(), blender::ed::greasepencil::image_render::draw_circles(), 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().
|
static |
Definition at line 117 of file math_interp.cc.
References BLI_assert, CLAMP, copy_v3_v3(), copy_v4_v4(), cubic_filter_coefficients(), float, floor(), int, max(), min(), Mitchell, v, and w().
Referenced by interpolate_cubic_bspline_byte(), interpolate_cubic_bspline_fl(), interpolate_cubic_bspline_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 331 of file math_interp.cc.
References b, BLI_assert, clamp(), floorf, int, and v.
Referenced by interpolate_bilinear_border_byte(), and interpolate_bilinear_byte().
| BLI_INLINE void blender::math::bilinear_fl_impl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| bool | wrap_x = false, | ||
| bool | wrap_y = false ) |
Definition at line 219 of file math_interp.cc.
References b, BLI_assert, clamp(), copy_vn_fl(), floored_fmod(), floorf, int, and v.
Referenced by interpolate_bilinear_border_fl(), interpolate_bilinear_border_fl(), interpolate_bilinear_fl(), interpolate_bilinear_fl(), interpolate_bilinear_wrap_fl(), and interpolate_bilinear_wrap_fl().
|
inlinenodiscard |
Negate the quaternion if real component (w) is negative.
Definition at line 227 of file BLI_math_quaternion.hh.
References blender::math::QuaternionBase< T >::w.
Referenced by blender::math::QuaternionBase< T >::swing(), blender::math::tests::TEST(), blender::math::QuaternionBase< T >::twist(), and blender::math::QuaternionBase< T >::twist_angle().
Definition at line 120 of file BLI_math_base.hh.
Referenced by blender::bke::compositor::add_passes_used_by_cryptomatte_node(), ceil(), blender::compositor::compute_motion_rect(), blender::compositor::compute_symmetric_separable_blur_weights(), blender::compositor::DefocusNode::convert_to_operations(), blender::deform_drawing(), draw_strip_thumbnails(), blender::nodes::node_composite_defocus_cc::DefocusOperation::execute(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_constant_size(), blender::nodes::node_composite_blur_cc::BlurOperation::execute_variable_size(), blender::geometry::extend_curves(), blender::geometry::extend_curves_curved(), blender::geometry::extend_curves_straight(), blender::nodes::node_composite_bilateralblur_cc::BilateralBlurOperation::get_blur_radius(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_composite_cryptomatte_cc::CryptoMatteOperation::get_layers_from_render(), blender::nodes::node_composite_dilate_cc::DilateErodeOperation::get_morphological_distance_threshold_radius(), blender::draw::image_engine::ScreenTileTextures< Divisions >::gpu_texture_size(), blender::realtime_compositor::horizontal_pass(), blender::TimeMapping::local_frame_after_scene_frame(), blender::draw::mesh_render_data_edge_flag(), blender::draw::mesh_render_data_vert_flag(), blender::eevee::Film::overscan_pixels_get(), blender::TimeMapping::scene_frame_after_local_frame(), blender::compositor::BilateralBlurOperation::set_data(), blender::realtime_compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::realtime_compositor::SymmetricSeparableBlurWeights::SymmetricSeparableBlurWeights(), blender::table_sample(), blender::compositor::GaussianBlurReferenceOperation::update_memory_buffer_partial(), blender::compositor::velocity_atomic_max_value(), and blender::realtime_compositor::vertical_pass().
Definition at line 262 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 194 of file BLI_math_vector.hh.
References b, BLI_assert, and result.
Referenced by 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 966 of file math_color.cc.
References from_scale(), and invert().
Referenced by blender::nodes::node_composite_colorbalance_cc::ColorBalanceShaderNode::compile(), and blender::compositor::ColorBalanceWhitepointOperation::init_execution().
Definition at line 63 of file BLI_math_base.hh.
References min.
Referenced by blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), bilinear_byte_impl(), bilinear_fl_impl(), blender::imbuf::transform::calc_coverage(), blender::calc_min_radius_v3v3(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), clamp(), clamp(), clamp_rect(), blender::ed::sculpt_paint::color::color_filter_task(), blender::nodes::node_composite_blur_cc::BlurOperation::compute_blur_radius(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::compute_blur_radius(), blender::realtime_compositor::compute_marker_points(), blender::realtime_compositor::compute_realized_transformation_domain(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::compute_variable_size_search_radius(), blender::create_envelope_stroke_for_point(), blender::deform_drawing(), blender::compositor::depth_compare(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::geometry::extend_curves_curved(), fill_rect_alpha_under(), blender::ed::greasepencil::fit_strokes_to_view(), blender::noise::gabor(), blender::noise::gabor(), blender::get_build_factor(), get_default_fac_fade(), blender::compositor::MemoryBuffer::get_elem_clamped(), blender::get_factor_from_draw_speed(), blender::ed::greasepencil::trim::get_intersection_distance_of_segments(), blender::nodes::node_sh_mix_cc::get_multi_function(), initialize_shadow_alpha(), interpolate_nearest_byte(), interpolate_nearest_fl(), blender::compositor::load_mask(), 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(), paint_sample_color(), blender::imbuf::transform::process_scanlines(), project_face_pixel(), project_paint_PickColor(), blender::ed::greasepencil::retrieve_editable_drawings_from_layer_with_falloff(), blender::ed::greasepencil::retrieve_editable_drawings_with_falloff(), blender::geometry::ReverseUVSampler::sample(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::spread_compare(), blender::tests::TEST(), blender::tests::TEST(), blender::compositor::VariableSizeBokehBlurOperation::update_memory_buffer_partial(), blender::ed::greasepencil::weight_sample_invoke(), whitepoint_from_temp_tint(), blender::io::ply::write_vertices(), and blender::write_weights_for_drawing().
|
inlinenodiscard |
Definition at line 82 of file BLI_math_vector.hh.
|
inlinenodiscard |
Definition at line 70 of file BLI_math_vector.hh.
|
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 221 of file BLI_math_quaternion.hh.
References blender::math::QuaternionBase< T >::w.
Referenced by 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.
| T blender::math::cos | ( | const AngleFraction< T > & | a | ) |
Definition at line 710 of file BLI_math_angle_types.hh.
References cos().
| T blender::math::cos | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 684 of file BLI_math_angle_types.hh.
References cos().
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::realtime_compositor::compute_denominator_1(), blender::realtime_compositor::compute_denominator_2(), blender::realtime_compositor::compute_denominator_3(), blender::compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_numerator_1(), blender::realtime_compositor::compute_numerator_2(), blender::realtime_compositor::compute_numerator_3(), blender::realtime_compositor::compute_realized_transformation_domain(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), cos(), cos(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), blender::workbench::filter_blackman_harris(), 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::grease_pencil_primitive_rotate_all_update(), 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(), blender::draw::statvis_calc_thickness(), blender::math::tests::TEST(), blender::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), and blender::write_fill_transforms().
Definition at line 154 of file BLI_math_base.hh.
|
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, 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::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::build_point_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_foces(), blender::bke::mesh::corner_fan_space_define(), 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_tri(), blender::deform_drawing(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::do_nudge_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::geometry::extend_curves_curved(), from_orthonormal_axes(), from_orthonormal_axes(), from_vector(), gizmo_ruler_draw(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), orthogonalize(), rotate_direction_around_axis(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::draw::overlay::ShapeCache::ShapeCache(), blender::eevee::Light::sync(), and blender::tests::TEST().
|
inlinenodiscard |
Definition at line 450 of file BLI_math_vector.hh.
References b.
|
inlinenodiscard |
Same as cross(a, b) but use double float precision for the computation.
Definition at line 458 of file BLI_math_vector.hh.
Referenced by blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), and blender::nodes::node_fn_align_rotation_to_vector_cc::align_rotations_auto_pivot().
|
inlinenodiscard |
| poly | Array of points around a polygon. They don't have to be co-planar. |
Definition at line 471 of file BLI_math_vector.hh.
References int.
|
inlinenodiscard |
Return normal vector to a triangle. The result is not normalized and can be degenerate.
Definition at line 499 of file BLI_math_vector.hh.
Referenced by normal_tri().
|
static |
Definition at line 30 of file math_interp.cc.
References BSpline, and Mitchell.
Referenced by bicubic_interpolation().
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 130 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), and determinant().
Referenced by blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_matrix_determinant_cc::node_build_multi_function(), blender::math::detail::normalized_to_quat_with_checks(), blender::geometry::transform_volume(), and blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform().
Definition at line 125 of file BLI_math_base.hh.
References b.
Referenced by blender::length_parameterize::accumulate_lengths(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_smoothing(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::add_point_under_brush_to_brush_buffer(), almost_equal_relative(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), 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_brush_cube_distances(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::trim::calc_expand_factor(), blender::bke::curves::bezier::calculate_aligned_handle(), blender::ed::transform::curves::calculate_curve_point_distances_for_proportional_editing(), blender::ed::space_node::calculate_inner_link_bezier_points(), 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::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::deform_drawing(), blender::ed::greasepencil::dist_to_interpolated(), blender::ed::sculpt_paint::color::do_smear_brush_task(), 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(), fill_crossdata_for_intersect(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::bke::pbvh::pixels::Rows::find_copy_source(), blender::ed::greasepencil::find_curve_intersections(), blender::find_envelope(), blender::bke::pbvh::pixels::Rows::find_second_source(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::get_distance_factor(), blender::bke::greasepencil::Layer::get_frame_duration_at(), 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::sculpt_paint::pose::ik_chain_origin_heads_init(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::geometry::limit_radius(), blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh(), 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::EraseOperation::on_stroke_done(), 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::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::eevee::ShadowModule::screen_pixel_radius(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::segment_intersections_and_points_sides(), blender::ed::greasepencil::select_similar_exec(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::length_parameterize::tests::test_uniform_lengths(), blender::ed::sculpt_paint::transform_brush_radius(), transform_mesh_edge_slide_data_create(), transform_mesh_uv_edge_slide_data_create(), blender::compositor::SunBeamsOperation::update_memory_buffer_partial(), 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(), and blender::noise::voronoi_n_sphere_radius().
|
inlinenodiscard |
Definition at line 378 of file BLI_math_vector.hh.
|
inlinenodiscard |
Definition at line 366 of file BLI_math_vector.hh.
References b, and length_manhattan().
|
inlinenodiscard |
Definition at line 372 of file BLI_math_vector.hh.
References b, and length_squared().
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::sculpt_paint::cloth::add_constraints_for_verts(), blender::ed::spreadsheet::apply_row_filter(), bm_loop_uv_calc_opposite_co(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), 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::ed::sculpt_paint::greasepencil::compute_auto_flip(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), blender::ed::greasepencil::dist_to_interpolated(), blender::ed::sculpt_paint::fake_neighbor_search_bmesh(), blender::ed::sculpt_paint::fake_neighbor_search_grids(), blender::ed::sculpt_paint::fake_neighbor_search_mesh(), fill_crossdata_for_intersect(), find_closest_edge_in_poly(), 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(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), 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::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(), jump_flooding_pass(), layerEqual_propfloat2(), 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::ed::space_node::node_under_mouse_tweak(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::primitive_check_ui_hover(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), remove_non_constraint_edges_leave_valid_bmesh(), blender::bke::mesh_surface_sample::sample_nearest_weights(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::ed::curves::select_circle(), blender::ed::curves::select_circle_mask(), uv_remove_doubles_to_selected_shared_vertex(), 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 211 of file BLI_math_vector.hh.
References b, BLI_assert, and result.
Referenced by blender::realtime_compositor::compute_complete_blocks(), blender::realtime_compositor::compute_complete_x_prologues(), blender::realtime_compositor::compute_complete_y_prologues(), blender::realtime_compositor::compute_dispatch_threads_at_least(), blender::realtime_compositor::compute_incomplete_prologues(), blender::compositor::compute_max_tile_velocity(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_max_tile_velocity(), blender::eevee::LightModule::end_sync(), blender::eevee::ShadowModule::end_sync(), blender::eevee::VolumeModule::end_sync(), blender::eevee::Film::init(), blender::eevee::VolumeModule::init(), blender::realtime_compositor::parallel_reduction_dispatch(), blender::eevee::Precompute::Precompute(), blender::eevee::DepthOfField::render(), blender::eevee::MotionBlurModule::render(), blender::eevee::RayTraceModule::render(), blender::eevee::SubsurfaceModule::render(), blender::eevee::ShadowModule::set_view(), blender::eevee::VolumeProbeModule::set_view(), 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 555 of file BLI_math_vector.hh.
Referenced by blender::draw::overlay::Fluids::begin_sync(), blender::bke::pbvh::build_nodes_recursive_grids(), blender::bke::pbvh::build_nodes_recursive_mesh(), orthogonal(), 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 197 of file BLI_math_quaternion.hh.
References b.
Referenced by 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(), calcEdgeSlide_mval_range(), blender::ed::greasepencil::calculate_texture_space(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), 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::compositor::dir_compare(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), ED_transform_snap_object_project_all_view3d_ex(), ED_transform_snap_object_project_view3d_ex(), blender::draw::edge_factor_calc< float >(), blender::draw::edge_factor_calc< uint8_t >(), blender::nodes::node_composite_levels_cc::LevelsOperation::execute_single_value(), blender::find_envelope(), 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::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::ed::sculpt_paint::gesture::is_affected(), blender::compositor::is_inside_motion_line(), is_orthogonal(), blender::eevee::ForwardPipeline::material_transparent_add(), blender::bke::mesh::mesh_edges_sharp_tag(), blender::ed::sculpt_paint::auto_mask::normal_calc(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::geometry::perpendicular_distance(), blender::eevee::ForwardPipeline::prepass_transparent_add(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::project_translations(), blender::eevee::PlanarProbe::reflection_clip_plane_get(), blender::io::grease_pencil::GreasePencilExporter::retrieve_objects(), rotate_direction_around_axis(), blender::bke::mesh_surface_sample::sample_surface_points_projected(), blender::ed::mesh::set_sharpness_by_angle_exec(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::compositor::SMAASearchDiag1(), blender::compositor::SMAASearchDiag2(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::bke::mesh::split_corner_normal_fan_do(), blender::math::tests::TEST(), transform_mesh_edge_slide_data_create(), transform_mesh_uv_edge_slide_data_create(), VertSlideData::update_active_edges(), blender::compositor::KeyingScreenOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaAnisotropicStructureTensorOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaClassicOperation::update_memory_buffer_partial(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), and blender::noise::voronoi_distance_to_edge().
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.
length_manhattan(a) than dot(a, vec(1)) to get the sum of all components. Definition at line 323 of file BLI_math_vector.hh.
Definition at line 184 of file BLI_math_base.hh.
Referenced by blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::realtime_compositor::compute_denominator_1(), blender::realtime_compositor::compute_denominator_2(), blender::realtime_compositor::compute_denominator_3(), blender::realtime_compositor::compute_denominator_4(), blender::compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_numerator_1(), blender::realtime_compositor::compute_numerator_2(), blender::realtime_compositor::compute_numerator_3(), exp(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), TEST(), TEST(), and blender::compositor::KeyingScreenOperation::update_memory_buffer_partial().
Definition at line 183 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and exp().
|
inlinenodiscard |
Return vector if incident and reference are pointing in the same direction.
Definition at line 545 of file BLI_math_vector.hh.
References vector.
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 27 of file math_half.cc.
Referenced by blender::gpu::convert(), and float_to_half_array().
Definition at line 221 of file math_half.cc.
References float_to_half(), and length().
Referenced by blender::gpu::convert_buffer(), and blender::tests::TEST().
Definition at line 94 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::geometry::extend_curves_straight(), 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::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::TimeMapping::scene_frame_before_local_frame(), blender::table_sample(), 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(), and blender::noise::voronoi_smooth_f1().
Definition at line 250 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and floor().
Definition at line 130 of file BLI_math_base.hh.
Referenced by blender::deform_drawing(), blender::deform_drawing(), blender::eevee::VolumeModule::draw_prepass(), fract(), blender::compositor::interleaved_gradient_noise(), and blender::table_sample().
Definition at line 311 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and fract().
|
nodiscard |
Create a transform matrix with translation and rotation applied in this order.
Definition at line 1410 of file BLI_math_matrix.hh.
References from_rotation().
Referenced by blender::math::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
nodiscard |
Create a transform matrix with translation, rotation and scale applied in this order.
Definition at line 1398 of file BLI_math_matrix.hh.
References from_rot_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::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::realtime_compositor::compute_realized_transformation_domain(), blender::nodes::node_composite_stabilize2d_cc::Stabilize2DOperation::execute(), blender::nodes::node_composite_transform_cc::TransformOperation::execute(), blender::nodes::node_composite_scale_cc::ScaleOperation::execute_constant_size(), blender::bke::attribute_math::float4x4Mixer::finalize(), blender::get_rand_matrix(), blender::bke::greasepencil::Layer::local_transform(), blender::bke::attribute_math::mix3(), blender::bke::attribute_math::mix4(), 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(), blender::imbuf::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::draw::test_eevee_shadow_tag_update(), and blender::geometry::transform_mesh().
|
nodiscard |
Create a transform matrix with translation and scale applied in this order.
Definition at line 1420 of file BLI_math_matrix.hh.
References from_scale().
Referenced by blender::draw::overlay::Fluids::object_sync(), and OVERLAY_grease_pencil_cache_init().
|
nodiscard |
Create a translation only matrix. Matrix dimensions should be at least 4 col x 3 row.
Definition at line 1367 of file BLI_math_matrix.hh.
Referenced by blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::nodes::node_composite_translate_cc::TranslateOperation::execute(), from_origin_transform(), blender::get_array_matrix(), blender::nodes::node_geo_scale_instances_cc::scale_instances(), blender::eevee::VolumeProbeModule::set_view(), blender::tests::TEST(), 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(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 1567 of file BLI_math_matrix.hh.
References from_location().
|
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(), BLI_assert, and cross().
Referenced by from_orthonormal_axes(), from_tracking(), 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.
forward and up must be normalized. Definition at line 1429 of file BLI_math_matrix.hh.
References BLI_assert, cross(), and is_unit_scale().
|
nodiscard |
Create a transform matrix with translation and rotation from 2 basis vectors and a translation.
forward and up must be normalized. Definition at line 1445 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 1392 of file BLI_math_matrix.hh.
References from_rotation(), and from_scale().
Referenced by from_loc_rot_scale().
|
nodiscard |
Create a rotation only matrix.
Definition at line 1386 of file BLI_math_matrix.hh.
References blender::math::detail::from_rotation().
Referenced by blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::nodes::node_composite_rotate_cc::RotateOperation::execute(), blender::geometry::extend_curves_curved(), from_loc_rot(), from_rot_scale(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::get_translation(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), 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(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), TEST(), to_dual_quaternion(), to_gimbal_axis(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update(), 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().
|
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 1375 of file BLI_math_matrix.hh.
References BLI_STATIC_ASSERT, result, and blender::unroll().
Referenced by blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), chromatic_adaption_matrix(), blender::nodes::node_geo_string_to_curves_cc::create_curve_instances(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::draw::drw_volume_object_mesh_init(), from_loc_scale(), from_rot_scale(), blender::math::detail::from_rotation(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::get_mirror_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), imb_scale_via_transform(), blender::draw::overlay::Bounds::object_sync(), blender::eevee::VolumeProbeModule::set_view(), blender::tests::TEST(), 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 351 of file BLI_math_rotation.hh.
References blender::math::AxisSigned::axis(), BLI_assert, from_orthonormal_axes(), rotation_between(), blender::math::AxisSigned::Y_POS, and blender::math::AxisSigned::Z_POS.
|
nodiscard |
Create a orientation from a triangle plane and the axis formed by the segment(v1, v2).
Definition at line 261 of file BLI_math_rotation.hh.
References from_triangle(), normal_tri(), and 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 227 of file BLI_math_rotation.hh.
References atan2(), conjugate(), cos(), is_zero(), nor, normalize(), q1, safe_acos(), sin(), T, transform_point(), UNUSED_VARS, and v2.
Referenced by 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.
up must be normalized. from_orthonormal_axes for more stable output. Definition at line 1455 of file BLI_math_matrix.hh.
References b, BLI_assert, 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::tests::TEST().
|
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 269 of file BLI_math_rotation.hh.
References angle(), blender::math::Axis::as_int(), blender::math::AxisSigned::axis(), blender::math::AngleCartesianBase< T >::cos(), cross(), e, eps, blender::math::QuaternionBase< T >::identity(), blender::math::AxisSigned::is_negative(), length(), normalize(), normalize_and_get_length(), q1, safe_acos(), blender::math::AngleCartesianBase< T >::sin(), T, to_quaternion(), transform_point(), UNLIKELY, vector, blender::math::Axis::X, blender::math::Axis::Y, and blender::math::Axis::Z.
Referenced by blender::math::tests::TEST().
Converts half-precision (FP16) number to float (FP32).
Definition at line 91 of file math_half.cc.
References exp(), magic(), and v.
Referenced by blender::gpu::convert(), half_to_float_array(), ViewportColorSampleSession::sample(), and blender::tests::TEST().
Definition at line 257 of file math_half.cc.
References half_to_float(), and length().
Referenced by blender::gpu::convert_buffer(), and blender::tests::TEST().
Definition at line 233 of file BLI_math_base.hh.
Referenced by blender::math::detail::normalized_to_eul2(), and blender::math::detail::normalized_to_eul2().
|
inline |
Definition at line 21 of file BLI_math_color.hh.
References b, and interpolate().
|
inline |
Definition at line 32 of file BLI_math_color.hh.
References b, and interpolate().
| template double3x3 blender::math::interpolate | ( | const double3x3 & | a, |
| const double3x3 & | b, | ||
| double | t ) |
| template double4x4 blender::math::interpolate | ( | const double4x4 & | a, |
| const double4x4 & | b, | ||
| double | t ) |
|
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 328 of file math_matrix.cc.
References B, interpolate(), interpolate_linear(), normalize(), P, polar_decompose(), and to_quaternion().
|
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 372 of file math_matrix.cc.
|
inlinenodiscard |
Use spherical interpolation between two quaternions. Always interpolate along the shortest angle.
Definition at line 301 of file BLI_math_quaternion.hh.
References b, BLI_assert, interpolate_dot_slerp(), is_unit_scale(), and w().
|
inline |
Definition at line 239 of file BLI_math_base.hh.
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::apply_gradient_tint(), blender::apply_uniform_tint(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::apply_weight_to_point(), blender::draw::overlay::Grid::begin_sync(), blender::animrig::blend_layer_results(), blender::calc_min_radius_v3v3(), blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_radius_with_interpolation(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::bke::curves::bezier::calculate_vector_handle(), blender::io::grease_pencil::GreasePencilExporter::compute_average_stroke_color(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::compute_global_adaptation_level(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::ed::greasepencil::control_point_colors_and_sizes(), 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::deform_drawing(), blender::deform_drawing(), blender::deform_drawing_as_envelope(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), DRW_text_edit_mesh_measure_stats(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_single_value(), blender::geometry::extend_curves_straight(), 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::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::nodes::node_sh_mix_cc::get_multi_function(), get_next_crossing_from_edge(), blender::nodes::node_composite_keyingscreen_cc::KeyingScreenOperation::get_smoothness(), gizmo_ruler_invoke(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::bke::curves::bezier::insert(), interpolate(), interpolate(), interpolate(), interpolate_linear(), blender::length_parameterize::interpolate_to_masked(), layerCopyValue_propfloat2(), 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::geometry::mix_arrays(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_done(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), OVERLAY_wireframe_cache_init(), blender::geometry::perpendicular_distance(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::primitive_calulate_curve_positions(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_color(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_opacity(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_radius(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_rotation(), blender::ed::sculpt_paint::color::sculpt_color_presmooth_init(), blender::compositor::KeyingScreenOperation::set_smoothness(), blender::compositor::SMAAMovc(), blender::compositor::SMAAMovc(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::meshintersect::CDTArrangement< T >::split_edge(), blender::table_sample(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), tonemap_rd_photoreceptor(), tonemap_simple(), whitepoint_from_temp_tint(), whitepoint_to_temp_tint(), and WM_gesture_lasso_modal().
|
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 524 of file BLI_math_vector.hh.
References b.
|
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 474 of file math_interp.cc.
References bilinear_byte_impl(), and v.
Referenced by blender::imbuf::interpolate_bilinear_border_byte(), blender::imbuf::interpolate_bilinear_border_byte(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| 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 492 of file math_interp.cc.
References bilinear_fl_impl(), and v.
|
nodiscard |
Definition at line 485 of file math_interp.cc.
References bilinear_fl_impl(), and v.
Referenced by blender::imbuf::interpolate_bilinear_border_fl(), blender::imbuf::interpolate_bilinear_border_fl(), TEST(), and TEST().
|
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 480 of file math_interp.cc.
References bilinear_byte_impl(), and v.
Referenced by blender::imbuf::interpolate_bilinear_byte(), blender::imbuf::interpolate_bilinear_byte(), and TEST().
| void blender::math::interpolate_bilinear_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v ) |
Definition at line 505 of file math_interp.cc.
References bilinear_fl_impl(), and v.
|
nodiscard |
Definition at line 498 of file math_interp.cc.
References bilinear_fl_impl(), and v.
Referenced by blender::imbuf::interpolate_bilinear_fl(), blender::imbuf::interpolate_bilinear_fl(), blender::imbuf::transform::sample_image(), scale_bilinear_func(), TEST(), and blender::compositor::MemoryBuffer::texture_bilinear_extend().
|
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 524 of file math_interp.cc.
References b, BLI_assert, floored_fmod(), floorf, int, and v.
Referenced by blender::imbuf::interpolate_bilinear_wrap_byte(), and TEST().
| void blender::math::interpolate_bilinear_wrap_fl | ( | const float * | buffer, |
| float * | output, | ||
| int | width, | ||
| int | height, | ||
| int | components, | ||
| float | u, | ||
| float | v, | ||
| bool | wrap_x, | ||
| bool | wrap_y ) |
Definition at line 511 of file math_interp.cc.
References bilinear_fl_impl(), and v.
|
nodiscard |
Definition at line 566 of file math_interp.cc.
References bilinear_fl_impl(), and v.
Referenced by blender::imbuf::interpolate_bilinear_wrap_fl(), blender::compositor::MemoryBuffer::read(), blender::compositor::MemoryBuffer::read_bilinear(), blender::imbuf::transform::sample_image(), and 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 573 of file math_interp.cc.
References bicubic_interpolation(), and v.
Referenced by blender::imbuf::interpolate_cubic_bspline_byte(), blender::imbuf::interpolate_cubic_bspline_byte(), TEST(), TEST(), TEST(), and TEST().
| 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 587 of file math_interp.cc.
References bicubic_interpolation(), and v.
|
nodiscard |
Definition at line 580 of file math_interp.cc.
References bicubic_interpolation(), and v.
Referenced by blender::imbuf::interpolate_cubic_bspline_fl(), blender::imbuf::interpolate_cubic_bspline_fl(), blender::compositor::MemoryBuffer::read(), blender::compositor::MemoryBuffer::read_elem_bicubic_bspline(), blender::imbuf::transform::sample_image(), TEST(), and 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 594 of file math_interp.cc.
References bicubic_interpolation(), and v.
Referenced by blender::imbuf::interpolate_cubic_mitchell_byte(), blender::imbuf::interpolate_cubic_mitchell_byte(), TEST(), TEST(), and TEST().
| 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 609 of file math_interp.cc.
References bicubic_interpolation(), and v.
|
nodiscard |
Definition at line 602 of file math_interp.cc.
References bicubic_interpolation(), and v.
Referenced by blender::imbuf::transform::sample_image(), TEST(), and TEST().
|
inlinenodiscard |
Generic function for implementing slerp (quaternions and spherical vector coords).
| t | factor in [0..1] |
| cosom | dot product from normalized quaternions. |
Definition at line 271 of file BLI_math_quaternion.hh.
References abs(), acos(), BLI_assert, e, eps, IN_RANGE_INCL, LIKELY, sin(), T, and w().
Referenced by interpolate().
| template double3x3 blender::math::interpolate_fast | ( | const double3x3 & | a, |
| const double3x3 & | b, | ||
| double | t ) |
References interpolate_fast().
| template double4x4 blender::math::interpolate_fast | ( | const double4x4 & | a, |
| const double4x4 & | b, | ||
| double | t ) |
References interpolate_fast().
| template float3x3 blender::math::interpolate_fast | ( | const float3x3 & | a, |
| const float3x3 & | b, | ||
| float | t ) |
References interpolate_fast().
| template float4x4 blender::math::interpolate_fast | ( | const float4x4 & | a, |
| const float4x4 & | b, | ||
| float | t ) |
References 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 389 of file math_matrix.cc.
References b, and interpolate_fast().
Referenced by interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), interpolate_fast(), blender::tests::TEST(), and blender::tests::TEST().
|
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 408 of file math_matrix.cc.
References b, and interpolate_fast().
|
nodiscard |
Interpolate each component linearly.
Definition at line 696 of file BLI_math_matrix.hh.
References b, interpolate(), result, and blender::unroll().
Referenced by interpolate().
|
inlinenodiscard |
Definition at line 56 of file BLI_math_interp.hh.
References interpolate_nearest_border_byte(), and 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 36 of file BLI_math_interp.hh.
References BLI_assert, int, v, x, and y.
Referenced by blender::imbuf::interpolate_nearest_border_byte(), blender::imbuf::interpolate_nearest_border_byte(), interpolate_nearest_border_byte(), TEST(), and TEST().
|
inline |
Definition at line 64 of file BLI_math_interp.hh.
References BLI_assert, int, v, x, and y.
Referenced by blender::imbuf::interpolate_nearest_border_fl(), blender::imbuf::interpolate_nearest_border_fl(), interpolate_nearest_border_fl(), blender::imbuf::transform::sample_image(), TEST(), and TEST().
|
inlinenodiscard |
Definition at line 85 of file BLI_math_interp.hh.
References interpolate_nearest_border_fl(), and v.
|
inlinenodiscard |
Definition at line 117 of file BLI_math_interp.hh.
References interpolate_nearest_byte(), and 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 103 of file BLI_math_interp.hh.
References BLI_assert, clamp(), v, and x.
Referenced by interpolate_nearest_byte().
|
inline |
Definition at line 125 of file BLI_math_interp.hh.
References BLI_assert, clamp(), v, and x.
Referenced by interpolate_nearest_fl(), and blender::compositor::MemoryBuffer::texture_nearest_extend().
|
inlinenodiscard |
Definition at line 138 of file BLI_math_interp.hh.
References interpolate_nearest_fl(), and v.
|
inlinenodiscard |
Definition at line 167 of file BLI_math_interp.hh.
References interpolate_nearest_wrap_byte(), and v.
|
inline |
Wrapped nearest sampling. (u,v) is repeated to be inside the image size.
Definition at line 150 of file BLI_math_interp.hh.
References BLI_assert, floored_fmod(), int, v, and x.
Referenced by blender::imbuf::interpolate_nearest_wrap_byte(), and interpolate_nearest_wrap_byte().
|
inline |
Definition at line 175 of file BLI_math_interp.hh.
References BLI_assert, floored_fmod(), int, v, and x.
Referenced by blender::imbuf::interpolate_nearest_wrap_fl(), and interpolate_nearest_wrap_fl().
|
inlinenodiscard |
Definition at line 191 of file BLI_math_interp.hh.
References interpolate_nearest_wrap_fl(), and v.
|
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(), blender::math::AxisSigned::is_negative(), 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(), BKE_grease_pencil_point_coords_apply(), BKE_grease_pencil_point_coords_apply_with_mat4(), blender::nodes::node_fn_invert_matrix_cc::InvertMatrixFunction::call(), chromatic_adaption_matrix(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::draw::View::compute_visibility(), blender::geometry::copy_transformed_normals(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::eevee::ShadowTileMap::debug_draw(), blender::nodes::node_geo_deform_curves_on_surface_cc::deform_curves(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::eevee::VolumeModule::draw_prepass(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), DRW_debug_m4_as_bbox(), blender::draw::overlay::Particles::dupli_matrix_get(), blender::nodes::node_composite_stabilize2d_cc::Stabilize2DOperation::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::get_mirror_matrix(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_paste_strokes_exec(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), invert(), blender::ed::greasepencil::join_object_with_active(), blender::ed::greasepencil::merge_layers(), blender::geometry::merge_layers(), blender::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::multiplane_scrape_preview_draw(), 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::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::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(), raycastMesh(), blender::realtime_compositor::realize_on_domain(), rotation_between(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::sculpt_init_mirror_clipping(), sculpt_update_object(), blender::eevee::VolumeProbeModule::set_view(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), snapCamera(), blender::draw::View::sync(), blender::eevee::Camera::sync(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), to_dual_quaternion(), blender::bke::transform_normals(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::draw::image_engine::OneTexture::update_bounds(), blender::draw::image_engine::ScreenTileTextures< Divisions >::update_bounds(), 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(), view3d_ruler_item_mousemove(), blender::draw::volume_grid_cache_get(), and workbench_render_to_image().
Definition at line 609 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 195 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), M, R, and result.
|
inlinenodiscard |
Return invert of q or identity if q is ill-formed. The invert allows quaternion division.
Definition at line 232 of file BLI_math_quaternion.hh.
References conjugate(), blender::math::QuaternionBase< T >::identity(), 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 242 of file BLI_math_quaternion.hh.
References BLI_assert, conjugate(), and is_unit_scale().
Referenced by 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_zero().
Returns true if at least one component is exactly equal to 0.
Definition at line 685 of file BLI_math_vector.hh.
References T.
|
inlinenodiscard |
Returns true if matrices are equal within the given epsilon.
Definition at line 486 of file BLI_math_matrix.hh.
Referenced by blender::bke::build_mesh_positions(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::geometry::copy_transformed_normals(), blender::geometry::skip_transform(), blender::tests::TEST(), and blender::tests::TEST().
|
inlinenodiscard |
Returns true if the quaternions are equal within the given epsilon. Return false otherwise.
Definition at line 115 of file BLI_math_quaternion.hh.
|
inlinenodiscard |
Returns true if vectors are equal within the given epsilon.
Definition at line 653 of file BLI_math_vector.hh.
| template bool blender::math::is_negative | ( | const double4x4 & | mat | ) |
| template bool blender::math::is_negative | ( | const float4x4 & | mat | ) |
Definition at line 142 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), determinant(), and T.
Returns true if matrix has inverted handedness.
Definition at line 476 of file BLI_math_matrix.hh.
References determinant(), and T.
Referenced by 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(), blender::tests::TEST(), to_dual_quaternion(), to_rot_scale(), to_rot_scale(), to_scale(), and to_scale().
|
inlinenodiscard |
Returns true if the DualQuaternion has not been mixed with other DualQuaternion and needs no normalization.
Definition at line 286 of file BLI_math_quaternion_types.hh.
References blender::math::DualQuaternionBase< T >::quat_weight, and T.
Referenced by blender::draw::evaluate_vertex_weight(), blender::math::detail::from_rotation(), and transform_point().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other.
Definition at line 503 of file BLI_math_matrix.hh.
Referenced by is_orthonormal(), is_uniformly_scaled(), and blender::tests::TEST().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other and unit length.
Definition at line 520 of file BLI_math_matrix.hh.
References abs(), is_orthogonal(), and length_squared().
Referenced by blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), blender::tests::TEST(), and to_dual_quaternion().
|
inlinenodiscard |
Test if the X, Y and Z axes are perpendicular with each other and the same length.
Definition at line 540 of file BLI_math_matrix.hh.
References abs(), e, eps, is_orthogonal(), length_squared(), and z().
Referenced by blender::tests::TEST().
|
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 700 of file BLI_math_vector.hh.
References abs(), length_squared(), and T.
Referenced by rotate_direction_around_axis().
Definition at line 598 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_orthonormal_axes(), blender::math::detail::from_rotation(), from_up_axis(), interpolate(), invert_normalized(), 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(), blender::tests::TEST(), to_axis_angle(), to_euler(), to_euler(), to_quaternion(), transform_point(), and blender::math::QuaternionBase< T >::wrapped_around().
|
inlinenodiscard |
Definition at line 123 of file BLI_math_quaternion.hh.
References abs(), T, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
Return true if each individual column is unit scaled. Mainly for assert usage.
Definition at line 355 of file BLI_math_vector.hh.
References abs(), length_squared(), T, and v.
Definition at line 554 of file BLI_math_matrix.hh.
References is_zero().
|
inlinenodiscard |
Returns true if all components are exactly equal to 0.
Definition at line 106 of file BLI_math_quaternion.hh.
References 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.
References T.
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(), BKE_mesh_translate(), 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::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::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::bke::curves::poly::calculate_tangents(), 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_foces(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_pinch_brush(), drawEdgeSlide(), edge_slide_snap_apply(), blender::geometry::extend_curves_straight(), blender::bke::mesh::face_normal_calc(), blender::find_envelope(), blender::bke::float2_to_bool(), blender::bke::float3_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::bke::int2_to_bool(), is_any_zero(), blender::nodes::node_composite_displace_cc::DisplaceOperation::is_identity(), is_zero(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), 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::geometry::perpendicular_distance(), project(), rotate_direction_around_axis(), blender::bke::rotate_directions_around_axes(), blender::tests::TEST(), blender::bke::CurvesGeometry::translate(), blender::geometry::translate_pointcloud(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), and vpaint_proj_dm_map_cosnos_init__map_cb().
|
inlinenodiscard |
Return true if the absolute values of all components are smaller than given epsilon (0 by default).
Definition at line 672 of file BLI_math_vector.hh.
References abs().
| isect_result< double2 > blender::math::isect_seg_seg | ( | const double2 & | v1, |
| const double2 & | v2, | ||
| const double2 & | v3, | ||
| const double2 & | v4 ) |
Definition at line 48 of file math_vec.cc.
References blender::math::isect_result< T >::kind, blender::math::isect_result< T >::lambda, and v2.
| isect_result< float2 > blender::math::isect_seg_seg | ( | const float2 & | v1, |
| const float2 & | v2, | ||
| const float2 & | v3, | ||
| const float2 & | v4 ) |
Definition at line 18 of file math_vec.cc.
References blender::math::isect_result< T >::kind, blender::math::isect_result< T >::lambda, and v2.
Definition at line 349 of file BLI_math_vector.hh.
References length_squared(), and sqrt().
Referenced by blender::apply_gradient_tint(), blender::ed::sculpt_paint::calc_distances(), blender::bke::curves::bezier::calculate_point_handles(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), 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_motion_line(), createEdgeSlideVerts(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), blender::nodes::node_composite_sunbeams_cc::SunBeamsOperation::execute(), blender::geometry::extend_curves_straight(), blender::find_envelope(), blender::draw::View::frustum_culling_planes_calc(), blender::noise::gabor(), blender::noise::gabor(), blender::compositor::gather_blur(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::compositor::gather_sample(), blender::ed::greasepencil::generate_corner(), blender::generate_curves(), blender::ed::greasepencil::trim::get_intersection_distance_of_segments(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::get_iterations(), blender::nodes::node_fn_compare_cc::get_multi_function(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::get_translation(), blender::ed::greasepencil::grease_pencil_primitive_scale_all_update(), blender::ed::sculpt_paint::filter::mesh_filter_sharpen_init(), blender::modify_drawing(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::imbuf::transform::process_scanlines(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::realtime_compositor::SymmetricBlurWeights::SymmetricBlurWeights(), to_axis_angle(), blender::math::projection::translate(), blender::compositor::SunBeamsOperation::update_memory_buffer_partial(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), and blender::compositor::velocity_atomic_max_value().
Returns summation of all components.
Definition at line 335 of file BLI_math_vector.hh.
Referenced by distance_manhattan(), to_euler(), to_euler(), to_nearest_euler(), and to_nearest_euler().
Definition at line 344 of file BLI_math_vector.hh.
Referenced by blender::calc_min_radius_v3v3(), 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(), distance_squared(), blender::ed::sculpt_paint::filter_plane_trim_limit_factors(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), invert(), is_orthonormal(), is_uniformly_scaled(), is_unit(), is_unit_scale(), length(), blender::compositor::max_velocity(), 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(), to_dual_quaternion(), blender::bke::greasepencil::update_curve_plane_normal_cache(), and WM_gesture_lasso_modal().
Definition at line 48 of file BLI_math_base.hh.
References b.
Referenced by blender::eevee::RenderBuffers::acquire(), bicubic_interpolation(), blender::gpu::render_graph::VKUpdateMipmapsNode::build_commands(), blender::nodes::node_shader_tex_noise_cc::NoiseFunction::call(), blender::nodes::node_composite_bokehblur_cc::BokehBlurOperation::compute_blur_radius(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::compute_log_maximum_luminance(), blender::nodes::node_composite_tonemap_cc::ToneMapOperation::compute_log_minimum_luminance(), blender::compositor::compute_motion_rect(), blender::realtime_compositor::compute_sigma_from_radius(), blender::create_array_copies(), blender::bke::create_attribute_providers_for_mesh(), blender::deform_drawing(), blender::deform_drawing(), draw_strip_thumbnails(), blender::imbuf::transform::edge_aa(), blender::eevee::LightModule::end_sync(), blender::eevee::VolumeModule::end_sync(), evaluate_film_like(), blender::nodes::node_composite_zcombine_cc::ZCombineOperation::execute_single_value(), blender::geometry::extend_curves_curved(), fcurve_to_keylist(), blender::ed::greasepencil::fill_strokes(), blender::ed::greasepencil::fit_strokes_to_view(), blender::noise::gabor(), blender::noise::gabor(), gaussian_blur_x(), gaussian_blur_y(), blender::compositor::SMAAOperation::get_area_of_interest(), blender::realtime_compositor::Context::get_compositing_region_size(), blender::get_distance_factor(), blender::compositor::KuwaharaAnisotropicOperation::get_eccentricity(), blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::get_eccentricity(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_f_stop(), blender::get_factor_from_draw_speed(), blender::nodes::node_composite_defocus_cc::DefocusOperation::get_focal_length(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::ed::greasepencil::get_minmax_selected_frame_numbers(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_crop(), glow_blur_bitmap(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::ed::greasepencil::grease_pencil_vertex_paint_brightness_contrast_exec(), blender::eevee::Sampling::init(), blender::bounds::intersect(), blender::Bounds< blender::VecBase >::is_empty(), blender::compositor::jump_flooding(), blender::realtime_compositor::jump_flooding(), max(), max_inplace(), min_max(), min_max(), blender::modify_drawing(), blender::ed::space_node::node_frame_rect_inside(), blender::ed::space_node::node_get_resize_direction(), blender::draw::overlay::Bounds::object_sync(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), ScaleUpX::op(), ScaleUpY::op(), blender::point_counts_to_keep_concurrent(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::seq::query_thumbnail(), blender::eevee::IrradianceBake::raylists_build(), blender::reorder_strokes(), blender::ed::greasepencil::retrieve_editable_drawings_grouped_per_frame(), blender::compositor::SMAALumaEdgeDetectionPS(), blender::compositor::SMAANeighborhoodBlendingPS(), blender::ed::space_node::socket_link_connection_location(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::eevee::HiZBuffer::sync(), blender::eevee::SyncModule::sync_mesh(), blender::eevee::SyncModule::sync_sculpt(), text_gaussian_blur_x(), text_gaussian_blur_y(), tonemap_calc_chunk_luminance(), tonemap_simple(), blender::geometry::tri_to_cell_bounds(), blender::compositor::GlareThresholdOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaAnisotropicStructureTensorOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaClassicOperation::update_memory_buffer_partial(), blender::compositor::SunBeamsOperation::update_memory_buffer_partial(), blender::compositor::VariableSizeBokehBlurOperation::update_memory_buffer_partial(), and blender::ed::greasepencil::vertex_group_normalize_exec().
|
inlinenodiscard |
Definition at line 64 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and max().
Definition at line 53 of file BLI_math_base.hh.
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(), UniqueName_Value::mark_used(), blender::io::obj::Geometry::track_vertex_index(), UniqueName_Value::use_if_unused(), and UniqueName_Value::use_smallest_unused().
See std::midpoint from C++20.
Definition at line 248 of file BLI_math_base.hh.
Referenced by BKE_gpencil_centroid_3d(), 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::Bounds< T >::center(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), edbm_rip_edge_side_measure(), blender::ed::sculpt_paint::ensure_valid_pivot(), find_closest_edge_in_poly(), gpencil_depth_plane(), gpencil_object_cache_add(), blender::ed::greasepencil::grease_pencil_snap_cursor_to_sel_exec(), blender::bke::int2_to_int(), blender::ed::seq::make_vectorscope_view_from_ibuf(), blender::ed::space_node::node_group_make_insert_selected(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Bounds::object_sync(), blender::workbench::Instance::object_sync(), OVERLAY_bounds(), paint_init_pivot_curves(), paint_init_pivot_grease_pencil(), paint_init_pivot_mesh(), blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast(), blender::bke::pbvh::pbvh_bmesh_node_split(), blender::draw::Manager::resource_handle_for_sculpt(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), blender::eevee::SyncModule::sync_sculpt(), blender::tests::TEST(), transform_mesh_edge_slide_data_create(), transform_mesh_uv_edge_slide_data_create(), view3d_ob_drop_matrix_from_snap(), and view3d_orbit_calc_center().
|
inlinenodiscard |
Definition at line 535 of file BLI_math_vector.hh.
References b.
Definition at line 43 of file BLI_math_base.hh.
References b.
Referenced by bicubic_interpolation(), blur_isolate_highlights(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::ed::sculpt_paint::greasepencil::closest_distance_to_surface_2d(), blender::nodes::node_composite_defocus_cc::DefocusOperation::compute_maximum_defocus_radius(), blender::compositor::compute_motion_rect(), blender::eevee::VolumeModule::draw_prepass(), blender::eevee::VolumeModule::end_sync(), evaluate_film_like(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_bloom(), blender::geometry::extend_curves_curved(), fcurve_to_keylist(), find_first_points(), blender::ed::greasepencil::fit_strokes_to_view(), blender::index_mask::IndexMask::foreach_segment_zipped(), blender::noise::fractal_voronoi_distance_to_edge(), gaussian_blur_x(), gaussian_blur_y(), blender::compositor::GlareBloomOperation::generate_glare(), blender::get_factor_from_draw_speed(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::get_iterations(), blender::ed::greasepencil::get_minmax_selected_frame_numbers(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), blender::nodes::node_composite_scale_cc::ScaleOperation::get_scale_render_size_fit(), glow_blur_bitmap(), blender::bounds::intersect(), blender::Bounds< blender::VecBase >::is_empty(), min(), min_inplace(), min_max(), min_max(), blender::modify_geometry_set(), blender::ed::space_node::node_add_file_modal(), blender::ed::space_node::node_insert_offset_modal(), blender::ed::greasepencil::retrieve_editable_drawings_grouped_per_frame(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::compositor::summed_area_table_sum(), blender::tests::TEST(), TEST(), text_gaussian_blur_x(), text_gaussian_blur_y(), tonemap_calc_chunk_luminance(), blender::geometry::tri_to_cell_bounds(), blender::compositor::ConvertDepthToRadiusOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaAnisotropicStructureTensorOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaClassicOperation::update_memory_buffer_partial(), blender::compositor::SunBeamsOperation::update_memory_buffer_partial(), blender::compositor::VariableSizeBokehBlurOperation::update_memory_buffer_partial(), blender::compositor::velocity_atomic_max_value(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), and blender::noise::voronoi_distance_to_edge().
|
inlinenodiscard |
Definition at line 58 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and min().
Definition at line 58 of file BLI_math_base.hh.
Referenced by blender::io::obj::Geometry::track_vertex_index().
Definition at line 83 of file BLI_math_base.hh.
References max(), min(), and min.
Referenced by 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(), fcurve_to_keylist(), blender::bke::pbvh::Tree::from_bmesh(), blender::ed::space_node::get_min_max_of_nodes(), blender::ed::greasepencil::grease_pencil_snap_compute_centroid(), hair_get_boundbox(), init_meta(), blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), layerDoMinMax_propfloat2(), particle_intersect_mesh(), 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(), PE_minmax(), 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 224 of file BLI_math_vector.hh.
Definition at line 73 of file BLI_math_base.hh.
References b.
Referenced by create_src_image(), blender::deform_drawing(), blender::ed::greasepencil::get_control_point_type(), blender::get_rand_matrix(), mod(), mod(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::noise::perlin_signed(), blender::ed::greasepencil::primitive_calulate_curve_positions(), and safe_mod().
Definition at line 115 of file BLI_math_vector.hh.
References b, BLI_assert, mod(), and result.
|
inlinenodiscard |
Definition at line 109 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 109 of file BLI_math_base.hh.
References abs(), b, BLI_assert, and floor().
Referenced by blender::nodes::node_fn_integer_math_cc::get_multi_function(), blender::tests::TEST(), blender::math::AngleFraction< T >::wrapped(), and blender::math::AngleRadianBase< T >::wrapped().
|
inlinenodiscard |
Return normal vector to a triangle. The result is normalized but can still be degenerate.
Definition at line 511 of file BLI_math_vector.hh.
References cross_tri(), normalize(), and 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(), and from_triangle().
|
nodiscard |
Apply all accumulated weights to the dual-quaternions. Also make sure the rotation quaternions is normalized.
Definition at line 445 of file BLI_math_quaternion.hh.
References blender::math::DualQuaternionBase< T >::identity(), 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 744 of file BLI_math_matrix.hh.
References normalize(), result, and blender::unroll().
Referenced by blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_jitter(), 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::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::build_point_matrix(), 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::cloth::calc_forces_bmesh(), blender::ed::sculpt_paint::cloth::calc_forces_grids(), blender::ed::sculpt_paint::cloth::calc_forces_mesh(), 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::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::bke::curves::poly::calculate_tangents(), blender::ed::greasepencil::calculate_texture_space(), blender::nodes::node_fn_axes_to_rotation_cc::AxesToRotationFunction::call(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_foces(), 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::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::deform_drawing(), blender::bke::curves::poly::direction_bisect(), blender::ed::sculpt_paint::boundary::displacement_from_grab_delta_get(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::color::do_smear_brush_task(), DRW_text_edit_mesh_measure_stats(), blender::geometry::extend_curves_curved(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::find_envelope(), blender::bke::float4x4_to_quaternion(), 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::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), gizmo_ruler_draw(), blender::ed::sculpt_paint::grease_pencil_fill_get_extension_data(), imapaint_pick_face(), blender::bke::mesh::lnor_space_for_single_fan(), blender::ed::view3d::geometry_nodes_gizmos::make_matrix_orthonormal_but_keep_z_axis(), 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::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_interpolate_curves_cc::node_geo_exec(), blender::nodes::node_geo_mesh_primitive_line_cc::node_geo_exec(), blender::nodes::node_geo_raycast_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_on_faces_cc::normal_to_rotation(), normalize(), normalize(), blender::bke::normalize_span(), blender::geometry::normalize_span(), blender::bke::pbvh::normals_calc_verts_simple(), blender::draw::overlay::LightProbes::object_sync(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::boundary::populate_twist_data(), blender::ed::curves::primitive_random_sphere(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), SnapData::register_result(), 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::ed::sculpt_paint::sample_curves_surface_3d_brush(), blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center(), 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::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::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::bke::mesh::split_corner_normal_fan_do(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), transform_mesh_edge_slide_data_create(), transform_mesh_uv_edge_slide_data_create(), blender::geometry::transform_volume(), 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::noise::voronoi_distance_to_edge(), blender::noise::voronoi_distance_to_edge(), and blender::noise::voronoi_distance_to_edge().
|
nodiscard |
Definition at line 713 of file BLI_math_matrix.hh.
References normalize(), 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 256 of file BLI_math_quaternion.hh.
References len, and normalize_and_get_length().
Definition at line 435 of file BLI_math_vector.hh.
References len, normalize_and_get_length(), and v.
|
inlinenodiscard |
Definition at line 249 of file BLI_math_quaternion.hh.
References blender::math::QuaternionBase< T >::identity(), sqrt(), and T.
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), convexhull_2d_angle_iter_init(), convexhull_2d_angle_iter_step_on_axis(), blender::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curves_curved(), blender::ed::greasepencil::find_curve_intersections(), from_vector(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), normalize(), normalize(), normalize_and_get_size(), normalize_and_get_size(), orthogonalize(), raycastMesh(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::bke::mesh::split_corner_normal_fan_do(), blender::bke::greasepencil::update_curve_plane_normal_cache(), blender::math::QuaternionBase< T >::wrapped_around(), and blender::write_fill_transforms().
|
inlinenodiscard |
Definition at line 419 of file BLI_math_vector.hh.
References length_squared(), sqrt(), and v.
|
nodiscard |
Normalize each column of the matrix individually. Return the length of each column vector.
Definition at line 752 of file BLI_math_matrix.hh.
References BLI_STATIC_ASSERT, normalize_and_get_length(), result, and blender::unroll().
Referenced by blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::eevee::Light::sync(), blender::tests::TEST(), to_rot_scale(), and to_rot_scale().
|
nodiscard |
Definition at line 731 of file BLI_math_matrix.hh.
References BLI_STATIC_ASSERT, normalize_and_get_length(), 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 1236 of file BLI_math_matrix.hh.
References 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(), and blender::tests::TEST().
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const Axis | axis ) |
Definition at line 11 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const AxisSigned | axis ) |
Definition at line 25 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| const CartesianBasis & | rot ) |
Definition at line 40 of file math_basis_types.cc.
| std::ostream & blender::math::operator<< | ( | std::ostream & | stream, |
| EulerOrder | order ) |
|
constexpr |
Definition at line 185 of file BLI_math_basis_types.hh.
|
constexpr |
Definition at line 190 of file BLI_math_basis_types.hh.
|
inlinenodiscard |
Calculates a perpendicular vector to v.
Definition at line 644 of file BLI_math_vector.hh.
References v.
|
inlinenodiscard |
Calculates a perpendicular vector to v.
Definition at line 626 of file BLI_math_vector.hh.
References dominant_axis(), and v.
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), and isect_face_dst().
|
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.
from_up_axis to create a orthogonal basis around a vector. 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).
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 1472 of file BLI_math_matrix.hh.
References BLI_assert_unreachable, cross(), normalize(), normalize_and_get_length(), R, result, scale(), blender::math::Axis::X, blender::math::Axis::Y, and blender::math::Axis::Z.
Referenced by to_dual_quaternion().
|
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 284 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), Map, polar_decompose(), transpose(), V, and W.
Referenced by interpolate(), and polar_decompose().
|
nodiscard |
Raise a unit Quaternion q to the real y exponent.
Definition at line 202 of file BLI_math_quaternion.hh.
References BLI_assert, cos(), blender::math::QuaternionBase< T >::imaginary_part(), is_unit_scale(), normalize(), safe_acos(), sin(), and blender::math::QuaternionBase< T >::w.
Definition at line 174 of file BLI_math_base.hh.
References power().
Referenced by blender::geometry::extend_curves_curved(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), pow(), pow(), blender::ed::sculpt_paint::simplify_fixed(), blender::simplify_fixed(), and blender::math::tests::TEST().
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 156 of file BLI_math_vector.hh.
|
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 170 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and pow().
|
inlinenodiscard |
Project p onto v_proj . Returns zero vector if v_proj is degenerate (zero length).
Definition at line 409 of file BLI_math_vector.hh.
| VecBase< T, N > blender::math::project_point | ( | const MatBase< T, N+1, NumRow > & | mat, |
| const VecBase< T, N > & | point ) |
Definition at line 1597 of file BLI_math_matrix.hh.
|
nodiscard |
Project a point using a matrix (location & rotation & scale & perspective divide).
Referenced by blender::nodes::node_fn_project_point_cc::node_build_multi_function(), EdgeSlideData::project(), VertSlideData::project(), blender::io::grease_pencil::GreasePencilExporter::project_to_screen(), blender::eevee::ShadowModule::screen_pixel_radius(), blender::tests::TEST(), VertSlideData::update_active_edges(), and blender::eevee::VolumeObjectBounds::VolumeObjectBounds().
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.
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 215 of file math_matrix.cc.
References blender::MatBase< T, NumCol, NumRow, Alignment >::base_ptr(), invert(), pseudo_invert(), T, transpose(), U, V, and W.
Referenced by pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), pseudo_invert(), and blender::tests::TEST().
Definition at line 142 of file BLI_math_base.hh.
References T.
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::ed::sculpt_paint::smooth::average_positions(), 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::smooth::calc_average(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::geometry::calc_straight_curve_positions(), blender::bke::attribute_math::float4x4Mixer::finalize(), blender::ed::sculpt_paint::mask::mask_increase_contrast(), blender::math::AngleFraction< T >::operator AngleCartesianBase< T >(), blender::ed::sculpt_paint::project_translations(), rcp(), blender::tests::TEST(), and to_quaternion().
Per-element inverse. Zero elements are evaluated to NaN.
Definition at line 295 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and rcp().
Definition at line 592 of file BLI_math_vector.hh.
References result.
Referenced by average(), blender::realtime_compositor::compute_boundary_coefficient(), blender::realtime_compositor::compute_boundary_coefficient(), blender::realtime_compositor::compute_feedforward_coefficient(), blender::realtime_compositor::compute_normalization_scale(), and blender::compositor::karis_brightness_weighted_sum().
Definition at line 564 of file BLI_math_vector.hh.
References result.
Referenced by blender::realtime_compositor::deriche_gaussian_blur(), evaluate_film_like(), blender::ed::greasepencil::fit_strokes_to_view(), blender::eevee::IrradianceBake::init(), blender::eevee::VolumeModule::init(), blender::compositor::karis_brightness_weighted_sum(), blender::draw::overlay::Bounds::object_sync(), blender::draw::overlay::LightProbes::object_sync(), blender::eevee::Film::overscan_pixels_get(), blender::realtime_compositor::recursive_gaussian_blur(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::io::obj::transform_object(), and blender::realtime_compositor::van_vliet_gaussian_blur().
Definition at line 578 of file BLI_math_vector.hh.
References result.
Referenced by evaluate_film_like(), and blender::eevee::IrradianceBake::surfels_create().
Definition at line 604 of file BLI_math_vector.hh.
References result.
Referenced by blender::eevee::VolumeProbeModule::init(), and blender::draw::overlay::Fluids::object_sync().
|
inlinenodiscard |
Definition at line 384 of file BLI_math_vector.hh.
References BLI_assert, and is_unit_scale().
|
inlinenodiscard |
Definition at line 392 of file BLI_math_vector.hh.
References sqrt().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 199 of file BLI_math_rotation.hh.
References b.
|
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(), and to_euler().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 205 of file BLI_math_rotation.hh.
References b, from_rotation(), and to_euler().
|
nodiscard |
Definition at line 648 of file BLI_math_matrix.hh.
References cos(), from_rotation(), result, sin(), and blender::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)).
Referenced by blender::tests::TEST().
|
nodiscard |
Rotate a by b. In other word, insert the b rotation before a.
Definition at line 193 of file BLI_math_rotation.hh.
References b.
| 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 129 of file math_rotation.cc.
References axis_angle_normalized_to_mat3(), and mul_m3_v3().
Referenced by blender::ed::sculpt_paint::boundary::calc_twist_position().
| 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 BLI_assert, cross(), diff(), dot(), is_unit(), is_zero(), and UNLIKELY.
Referenced by blender::bke::curves::poly::calculate_next_normal(), blender::bke::curves::poly::calculate_normals_minimum(), blender::bke::rotate_directions_around_axes(), and blender::math::tests::TEST().
|
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, and sign().
Referenced by angle_between(), angle_between_signed(), from_tracking(), 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 220 of file BLI_math_rotation.hh.
Definition at line 99 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::realtime_compositor::compute_realized_transformation_domain(), blender::compositor::ScaleNode::convert_to_operations(), blender::ed::transform::create_transform_data_for_node(), blender::bke::attribute_math::DefaultMixerStruct< int2 >::double_to_int(), blender::ed::transform::flushTransNodes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), blender::modify_geometry_set(), round(), blender::compositor::SMAAArea(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAADecodeDiagBilinearAccess(), blender::compositor::SMAADecodeDiagBilinearAccess(), snap_grid(), store_pixel(), and blender::seq::thumbnail_cache_get().
Definition at line 256 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and round().
Definition at line 189 of file BLI_math_base.hh.
References acos(), blender::math::numbers::pi, T, and UNLIKELY.
Referenced by angle_between(), angle_of(), angle_of_signed(), from_triangle(), from_vector(), blender::ed::sculpt_paint::auto_mask::normal_calc(), pow(), and to_quaternion_legacy().
Faster/approximate version of safe_acos. Max error 4.51803e-5 (0.00258 degrees).
Definition at line 201 of file BLI_math_base.hh.
References float, and blender::math::numbers::pi.
Referenced by accumulate_vertex_normals_poly_v3(), accumulate_vertex_normals_tri_v3(), accumulate_vertex_normals_v3(), bm_loop_normal_accum(), bm_mesh_loops_calc_normals_for_loop(), bm_vert_calc_normals_accum_loop(), calc_tangent_spaces(), blender::bke::mesh::corner_fan_space_define(), blender::bke::mesh::corner_space_custom_normal_to_data(), and blender::bke::mesh::split_corner_normal_fan_do().
Definition at line 89 of file BLI_math_base.hh.
Referenced by blender::apply_gradient_tint(), blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::nodes::node_shader_map_range_cc::build_vector_linear(), blender::nodes::node_shader_map_range_cc::build_vector_stepped(), blender::ed::space_node::calculate_inner_link_bezier_points(), blender::draw::curves_sub_pass_setup_implementation(), blender::deform_drawing(), blender::draw::DRW_shgroup_curves_create_sub(), blender::ed::sculpt_paint::ScaleCurvesEffect::execute(), blender::ed::greasepencil::fill_strokes(), blender::ed::greasepencil::fit_strokes_to_view(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), blender::compositor::karis_brightness_weighted_sum(), blender::geometry::limit_radius(), blender::ed::sculpt_paint::move_last_point_and_resample(), 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::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), safe_divide(), blender::nodes::node_fn_integer_math_cc::safe_divide_round_i(), blender::length_parameterize::sample_at_length(), SCULPT_calc_vertex_displacement(), blender::nodes::node_shader_map_range_cc::sh_node_map_range_build_multi_function(), blender::realtime_compositor::SymmetricBlurWeights::SymmetricBlurWeights(), blender::compositor::BokehBlurOperation::update_memory_buffer_partial(), blender::compositor::GaussianBlurReferenceOperation::update_memory_buffer_partial(), and blender::compositor::VariableSizeBokehBlurOperation::update_memory_buffer_partial().
|
inlinenodiscard |
Returns 0 if denominator is exactly equal to 0.
Definition at line 244 of file BLI_math_vector.hh.
References b.
|
inlinenodiscard |
Returns 0 if denominator is exactly equal to 0.
Definition at line 234 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_divide().
|
inlinenodiscard |
Safe version of mod(a, b) that returns 0 if b is equal to 0.
Definition at line 139 of file BLI_math_vector.hh.
|
inlinenodiscard |
Safe version of mod(a, b) that returns 0 if b is equal to 0.
Definition at line 129 of file BLI_math_vector.hh.
References b, BLI_UNROLL_MATH_VEC_FUNC_VEC_VEC, and safe_mod().
Definition at line 149 of file BLI_math_base.hh.
References T.
Referenced by blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::boundary::calc_average_position(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::draw::drw_volume_object_mesh_init(), blender::draw::overlay::MeshUVs::end_sync(), blender::ed::greasepencil::fit_strokes_to_view(), blender::bke::greasepencil::convert::get_legacy_stroke_to_texture_matrix(), blender::ed::sculpt_paint::greasepencil::linear_interpolation(), safe_rcp(), blender::tests::TEST(), blender::write_fill_transforms(), and blender::write_stroke_transforms().
Per-element inverse. Zero elements are evaluated to zero.
Definition at line 305 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and safe_rcp().
Per-element square root. Negative elements are evaluated to zero.
Definition at line 282 of file BLI_math_vector.hh.
Referenced by blender::tests::TEST().
|
nodiscard |
Equivalent to mat * from_scale(scale) but with fewer operation.
Definition at line 685 of file BLI_math_matrix.hh.
References BLI_STATIC_ASSERT, result, and blender::unroll().
Referenced by blender::draw::drw_volume_object_mesh_init(), blender::bke::fill_mesh_positions(), blender::draw::overlay::Cameras::object_sync(), orthogonalize(), blender::io::grease_pencil::SVGImporter::read(), blender::draw::overlay::ShapeCache::ShapeCache(), blender::draw::statvis_calc_thickness(), blender::eevee::Light::sync(), blender::eevee::LookdevModule::sync(), blender::tests::TEST(), blender::tests::TEST(), and to_dual_quaternion().
|
inlinenodiscard |
Definition at line 206 of file BLI_math_basis_types.hh.
Definition at line 38 of file BLI_math_base.hh.
References T.
Referenced by blender::noise::compute_3d_orientation(), blender::compositor::compute_motion_rect(), float_to_half(), from_up_axis(), blender::nodes::node_fn_integer_math_cc::get_multi_function(), midpoint(), rotation_between(), rotation_between(), blender::nodes::node_fn_integer_math_cc::safe_divide_round_i(), sign(), blender::tests::TEST(), and to_axis_angle().
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 52 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.
| T blender::math::sin | ( | const AngleFraction< T > & | a | ) |
Definition at line 714 of file BLI_math_angle_types.hh.
References sin().
| T blender::math::sin | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 688 of file BLI_math_angle_types.hh.
References sin().
Referenced by blender::math::AxisAngleBase< T, AngleT >::AxisAngleBase(), blender::noise::compute_2d_gabor_kernel(), blender::noise::compute_3d_gabor_kernel(), blender::noise::compute_3d_orientation(), blender::realtime_compositor::compute_numerator_1(), blender::realtime_compositor::compute_numerator_2(), blender::realtime_compositor::compute_numerator_3(), blender::realtime_compositor::compute_realized_transformation_domain(), blender::nodes::node_composite_glare_cc::GlareOperation::compute_streak_direction(), blender::nodes::node_composite_directionalblur_cc::DirectionalBlurOperation::execute(), 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::get_rand_matrix(), 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(), blender::math::tests::TEST(), blender::tests::TEST(), to_quaternion(), to_quaternion(), to_quaternion_legacy(), blender::write_fill_transforms(), and blender::write_weights_for_drawing().
Definition at line 159 of file BLI_math_base.hh.
Definition at line 135 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::calc_min_radius_v3v3(), blender::noise::compute_2d_gabor_standard_deviation(), blender::noise::compute_3d_gabor_standard_deviation(), blender::compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_fog_glow_kernel_value(), ED_transform_snap_object_project_view3d_ex(), blender::math::AngleCartesianBase< T >::from_point(), blender::hook_falloff(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::intersections_segment_circle_integers(), length(), normalize(), normalize_and_get_length(), normalize_and_get_length(), blender::math::detail::normalized_to_quat_fast(), OVERLAY_wireframe_cache_init(), refract(), blender::compositor::SMAABlendingWeightCalculationPS(), blender::compositor::SMAANeighborhoodBlendingPS(), sqrt(), and blender::tests::TEST().
Per-element square root. Negative elements are evaluated to NaN.
Definition at line 272 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and sqrt().
Definition at line 179 of file BLI_math_base.hh.
Referenced by blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::filter::cache_init(), blender::compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_fog_glow_kernel_value(), blender::realtime_compositor::compute_scaled_poles_variance_derivative(), ed_tracking_pick_plane_track(), ed_tracking_pick_point_track(), blender::realtime_compositor::find_scale_factor(), from_up_axis(), blender::ed::sculpt_paint::pbvh_gather_generic(), square(), blender::tests::TEST(), to_dual_quaternion(), blender::compositor::KeyingScreenOperation::update_memory_buffer_partial(), blender::compositor::SunBeamsOperation::update_memory_buffer_partial(), and uv_remove_doubles_to_selected_shared_vertex().
Per-element square.
Definition at line 177 of file BLI_math_vector.hh.
References BLI_UNROLL_MATH_VEC_OP_VEC, and square().
Definition at line 68 of file BLI_math_base.hh.
Referenced by blender::draw::overlay::append_line_loop(), blender::compositor::SMAACalculateDiagWeights(), blender::compositor::SMAADetectHorizontalCornerPattern(), blender::compositor::SMAADetectVerticalCornerPattern(), blender::compositor::SMAALumaEdgeDetectionPS(), step(), step(), blender::eevee::VelocityModule::step_sync(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inlinenodiscard |
Definition at line 99 of file BLI_math_vector.hh.
|
inlinenodiscard |
Definition at line 92 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.
| T blender::math::tan | ( | const AngleFraction< T > & | a | ) |
Definition at line 718 of file BLI_math_angle_types.hh.
References tan().
| T blender::math::tan | ( | const AngleRadianBase< T > & | a | ) |
Definition at line 692 of file BLI_math_angle_types.hh.
References tan().
Referenced by blender::draw::curve_create_edit_curves_nor(), blender::math::projection::perspective_fov(), tan(), and tan().
Definition at line 164 of file BLI_math_base.hh.
|
inlinenodiscard |
Extract euler rotation from transform matrix.
Definition at line 1135 of file BLI_math_matrix.hh.
References blender::math::detail::normalized_to_angle().
Referenced by blender::math::detail::to_rotation().
| 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().
| 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::math::QuaternionBase< T >::expmap(), blender::nodes::node_fn_axis_angle_to_rotation_cc::node_eval_inverse(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), to_axis_angle(), to_axis_angle(), and to_axis_angle().
|
extern |
| AxisAngleBase< T, AngleT > blender::math::to_axis_angle | ( | const QuaternionBase< T > & | quat | ) |
Definition at line 624 of file BLI_math_quaternion.hh.
References abs(), blender::math::AxisAngleBase< T, AngleT >::axis(), BLI_assert, 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 548 of file BLI_math_quaternion.hh.
References from_rotation(), invert(), is_negative(), is_orthonormal(), length_squared(), normalize(), orthogonalize(), R, scale(), square(), T, 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().
|
extern |
| 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(), 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::ed::space_node::create_inspection_string_for_generic_value(), 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_float3(), 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::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), 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 |
|
extern |
|
inlinenodiscard |
Definition at line 1150 of file BLI_math_matrix.hh.
References length_manhattan(), and blender::math::detail::normalized_to_eul2().
|
inlinenodiscard |
Definition at line 1141 of file BLI_math_matrix.hh.
References length_manhattan(), and blender::math::detail::normalized_to_eul2().
|
inlinenodiscard |
Definition at line 1166 of file BLI_math_matrix.hh.
References to_euler().
|
inlinenodiscard |
Definition at line 1160 of file BLI_math_matrix.hh.
References to_euler().
|
extern |
|
extern |
| EulerXYZBase< T > blender::math::to_euler | ( | const QuaternionBase< T > & | quat | ) |
Definition at line 654 of file BLI_math_quaternion.hh.
References BLI_assert, is_unit_scale(), and to_euler().
| Euler3Base< T > blender::math::to_euler | ( | const QuaternionBase< T > & | quat, |
| EulerOrder | order ) |
Definition at line 662 of file BLI_math_quaternion.hh.
References BLI_assert, is_unit_scale(), and to_euler().
|
nodiscard |
Convert euler rotation to gimbal rotation matrix.
Definition at line 361 of file BLI_math_rotation.hh.
References from_rotation(), blender::math::Euler3Base< T >::i(), result, and T.
Referenced by blender::math::tests::TEST().
|
inline |
Definition at line 1313 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and to_rot_scale().
Referenced by blender::realtime_compositor::compute_realized_transformation_domain(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), blender::tests::TEST(), blender::tests::TEST(), and to_loc_rot_scale_safe().
|
inline |
Definition at line 1338 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), 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 1352 of file BLI_math_matrix.hh.
References to_loc_rot_scale(), and to_quaternion().
Referenced by blender::nodes::node_fn_combine_transform_cc::node_eval_inverse(), blender::nodes::node_geo_object_info_cc::node_geo_exec(), and blender::bke::greasepencil::Layer::set_local_transform().
|
inlinenodiscard |
Definition at line 1173 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), 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 1188 of file BLI_math_matrix.hh.
References length_manhattan(), blender::math::detail::normalized_to_eul2(), and blender::math::EulerXYZBase< T >::wrapped_around().
Referenced by blender::tests::TEST().
|
inlinenodiscard |
Definition at line 1203 of file BLI_math_matrix.hh.
References to_euler().
|
inlinenodiscard |
Definition at line 1211 of file BLI_math_matrix.hh.
References to_euler().
|
extern |
| 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(), BLI_assert, cos(), is_unit_scale(), and sin().
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::math::QuaternionBase< T >::expmap(), blender::geometry::extend_curves_curved(), blender::bke::float3_to_quaternion(), blender::bke::float_to_quaternion(), from_vector(), blender::nodes::init_socket_cpp_value_from_property(), interpolate(), make_socket_type_rotation(), blender::bke::attribute_math::mix4(), blender::bke::attribute_math::float4x4Mixer::mix_in(), 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(), blender::math::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), to_axis_angle(), to_axis_angle(), to_dual_quaternion(), to_euler(), to_euler(), to_loc_rot_scale_safe(), to_quaternion(), to_quaternion(), and blender::math::detail::to_rotation().
|
extern |
| 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 393 of file BLI_math_rotation.hh.
References blender::math::QuaternionBase< T >::identity(), rcp(), blender::math::numbers::sqrt2, T, 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 |
| 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::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
extern |
| QuaternionBase< T > blender::math::to_quaternion | ( | const EulerXYZBase< T > & | eul | ) |
Definition at line 50 of file BLI_math_euler.hh.
References cos(), sin(), 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 1219 of file BLI_math_matrix.hh.
References blender::math::detail::normalized_to_quat_with_checks().
|
inlinenodiscard |
Definition at line 1225 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 434 of file math_matrix.cc.
References atan2(), conjugate(), cos(), nor, normalize(), q1, 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 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 1298 of file BLI_math_matrix.hh.
References is_negative(), normalize_and_get_size(), blender::math::detail::to_rotation(), and UNLIKELY.
Referenced by blender::tests::TEST(), to_loc_rot_scale(), and to_loc_rot_scale().
|
inline |
Definition at line 1323 of file BLI_math_matrix.hh.
References is_negative(), normalize_and_get_size(), blender::math::detail::to_rotation(), and UNLIKELY.
|
inlinenodiscard |
Definition at line 1257 of file BLI_math_matrix.hh.
References is_negative(), length(), result, and UNLIKELY.
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 1245 of file BLI_math_matrix.hh.
References is_negative(), length(), result, UNLIKELY, 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 boundbox_to_dimensions(), blender::nodes::node_fn_separate_transform_cc::SeparateTransformFunction::call(), blender::ed::greasepencil::create_curves_outline(), 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::bke::attribute_math::float4x4Mixer::mix_in(), blender::draw::overlay::Cameras::object_sync(), blender::draw::overlay::LightProbes::object_sync(), blender::workbench::VolumePass::object_sync_volume(), blender::io::grease_pencil::shape_attributes_to_curves(), blender::eevee::IrradianceBake::surfels_create(), blender::tests::TEST(), to_dual_quaternion(), 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 BLI_assert.
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(), 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(), BLI_assert, and blender::math::AxisSigned::from_int().
|
extern |
|
extern |
|
nodiscard |
Transform a 3d direction vector using a 3x3 matrix (rotation & scale).
Definition at line 1585 of file BLI_math_matrix.hh.
Referenced by blender::geometry::calc_position_with_interpolation(), blender::geometry::calc_position_without_interpolation(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), 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::geometry::boolean::mesh_bm_concat(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::modify_drawing(), nearest_world_tree(), blender::nodes::node_fn_transform_direction_cc::node_build_multi_function(), blender::ed::object::object_origin_set_exec(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), raycastMesh(), SnapData::register_result(), SnapData::register_result_raycast(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::tests::TEST(), transdata_elem_translate(), 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 1591 of file BLI_math_matrix.hh.
References view.
|
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(), result, v, blender::math::CartesianBasis::x(), blender::math::CartesianBasis::y(), and blender::math::CartesianBasis::z().
Referenced by 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(), applyTranslationValue(), BKE_armature_min_max(), BKE_grease_pencil_point_coords_apply(), BKE_grease_pencil_point_coords_apply_with_mat4(), BKE_grease_pencil_point_coords_get(), BKE_object_minmax(), BoneInstanceData::BoneInstanceData(), bounds_min_max_with_transform(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::calc_brush_cube_distances(), blender::ed::sculpt_paint::pose::calc_segment_translations(), 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::sculpt_paint::greasepencil::calculate_view_positions(), blender::ed::sculpt_paint::greasepencil::calculate_view_radii(), 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::io::grease_pencil::compute_drawing_bounds(), blender::draw::copy_transformed_positions(), blender::deform_drawing(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), 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::draw::DebugDraw::draw_polygon(), blender::ed::greasepencil::image_render::draw_polyline(), drw_shgroup_bone_relationship_lines_ex(), drw_shgroup_bone_stick(), DRW_text_edit_mesh_measure_stats(), blender::ed::sculpt_paint::ensure_valid_pivot(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::geometry::extend_curves_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::SmoothOperationExecutor::find_projected_smooth_factors(), 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_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_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(), imapaint_pick_face(), ViewOpsData::init_navigation(), 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(), MOD_lineart_gpencil_generate_v3(), motion_path_cache(), motionpaths_calc_bake_targets(), 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::object::object_convert_exec(), blender::ed::object::object_origin_set_exec(), blender::draw::overlay::Relations::object_sync(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), overlay_grease_pencil_draw_stroke_color_name(), 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::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical_with_symmetry(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), 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::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), raycastMesh(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical_with_symmetry(), SnapData::register_result(), SnapData::register_result_raycast(), blender::ed::greasepencil::DrawingPlacement::reproject(), 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::io::grease_pencil::shape_attributes_to_curves(), snapCamera(), blender::geometry::curve_constraints::solve_length_and_collision_constraints(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::math::tests::TEST(), blender::tests::TEST(), blender::ed::sculpt_paint::transform_brush_radius(), transform_point(), blender::ed::sculpt_paint::transform_positions(), blender::ed::sculpt_paint::transform_positions(), blender::bke::crazyspace::GeometryDeformation::translation_from_deformed_to_original(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), blender::draw::image_engine::OneTexture::update_bounds(), blender::draw::image_engine::ScreenTileTextures< Divisions >::update_bounds(), view3d_orbit_calc_center(), blender::eevee::VolumeObjectBounds::VolumeObjectBounds(), 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 486 of file BLI_math_quaternion.hh.
References BLI_assert, is_normalized(), is_unit_scale(), M, point, blender::math::DualQuaternionBase< T >::quat, result, blender::math::DualQuaternionBase< T >::scale, blender::math::DualQuaternionBase< T >::scale_weight, T, blender::math::DualQuaternionBase< T >::trans, transform_point(), and view.
|
extern |
|
extern |
|
nodiscard |
Transform a 3d point using a 3x3 matrix (rotation & scale).
Definition at line 1573 of file BLI_math_matrix.hh.
References point.
|
nodiscard |
Transform a 3d point using a 4x4 matrix (location & rotation & scale).
Definition at line 1579 of file BLI_math_matrix.hh.
References blender::MatBase< T, NumCol, NumRow, Alignment >::location(), and view.
|
inlinenodiscard |
Transform v by rotation using the quaternion q.
Definition at line 313 of file BLI_math_quaternion.hh.
References conjugate(), R, T, UNPACK3, V, v, blender::math::QuaternionBase< T >::w, blender::math::QuaternionBase< T >::x, blender::math::QuaternionBase< T >::y, and blender::math::QuaternionBase< T >::z.
|
nodiscard |
Equivalent to mat * from_location(translation) but with fewer operation.
Definition at line 625 of file BLI_math_matrix.hh.
References BLI_STATIC_ASSERT, result, and blender::unroll().
Referenced by blender::realtime_compositor::RealizeOnDomainOperation::execute(), blender::draw::overlay::Fluids::object_sync(), blender::draw::overlay::ForceFields::object_sync(), blender::realtime_compositor::realize_on_domain(), blender::eevee::CaptureView::render_probes(), and blender::tests::TEST().
|
nodiscard |
Flip the matrix across its diagonal. Also flips dimensions for non square matrices.
Definition at line 617 of file BLI_math_matrix.hh.
References result, and blender::unroll().
Referenced by blender::ed::greasepencil::calculate_texture_space(), SnapData::clip_planes_enable(), blender::geometry::copy_transformed_normals(), blender::ed::space_node::create_inspection_string_for_generic_value(), blender::nodes::node_geo_scale_elements_cc::create_single_axis_transform(), blender::bke::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float4x4(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::get_legacy_stroke_matrix(), blender::ed::greasepencil::grease_pencil_texture_gradient_exec(), blender::nodes::node_fn_transpose_matrix_cc::node_build_multi_function(), blender::draw::sculpt_batches_get_ex(), blender::eevee::VolumeProbeModule::set_view(), blender::eevee::ShadowTileMap::sync_cubeface(), blender::eevee::ShadowTileMap::sync_orthographic(), and blender::bke::transform_normals().
Definition at line 48 of file BLI_math_vector_types.hh.
References BLI_STATIC_ASSERT, and result.
Definition at line 933 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, and y.
Referenced by blender::nodes::node_composite_colorbalance_cc::ColorBalanceShaderNode::compile(), IMB_colormanagement_get_whitepoint(), and blender::compositor::ColorBalanceWhitepointOperation::init_execution().
| bool blender::math::whitepoint_to_temp_tint | ( | const float3 & | white, |
| float & | temperature, | ||
| float & | tint ) |
Definition at line 902 of file math_color.cc.
References blender::math::locus_entry_t::dist(), interpolate(), length(), blender::math::locus_entry_t::mired, planck_locus, sqrtf, blender::math::locus_entry_t::t, and blender::math::locus_entry_t::uv.
Referenced by IMB_colormanagement_set_whitepoint().
|
inlineconstexpr |
Definition at line 20 of file BLI_math_base.hh.
|
inlineconstexpr |
Definition at line 21 of file BLI_math_base.hh.
|
static |
Definition at line 883 of file math_color.cc.
Referenced by whitepoint_from_temp_tint(), and whitepoint_to_temp_tint().