BLI_math vectors: add minmax_v3v3_v3_array to get min and max values on each components of an array of 3D vectors.
This commit is contained in:
@@ -290,6 +290,8 @@ MINLINE void normal_float_to_short_v3(short r[3], const float n[3]);
|
|||||||
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]);
|
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]);
|
||||||
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2]);
|
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2]);
|
||||||
|
|
||||||
|
void minmax_v3v3_v3_array(float r_min[3], float r_max[3], float (*vec_arr)[3], int nbr);
|
||||||
|
|
||||||
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist);
|
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist);
|
||||||
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist);
|
void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist);
|
||||||
|
|
||||||
|
|||||||
@@ -757,6 +757,13 @@ void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
|
|||||||
if (max[1] < vec[1]) max[1] = vec[1];
|
if (max[1] < vec[1]) max[1] = vec[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void minmax_v3v3_v3_array(float r_min[3], float r_max[3], float (*vec_arr)[3], int nbr)
|
||||||
|
{
|
||||||
|
while (nbr--) {
|
||||||
|
minmax_v3v3_v3(r_min, r_max, *vec_arr++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** ensure \a v1 is \a dist from \a v2 */
|
/** ensure \a v1 is \a dist from \a v2 */
|
||||||
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist)
|
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user