Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-05-27 21:04:09 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-05-27 21:04:46 +0300
commitd7282537f0165b957efc6b0dc16208906f0202a8 (patch)
tree27fe0ef36f948ffe6a2fab2311b758eb8f62d412 /source/blender/blenlib/intern/math_vector.c
parent80d6421f28474eff0ac491d6a873cdaa9c34db5b (diff)
CD_PROP_COL datalayer
This implements a generic color datalayer and its functions. Based on D5975. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7838
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r--source/blender/blenlib/intern/math_vector.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 9009f73a62f..6ec7c960d6b 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -949,6 +949,35 @@ void print_vn(const char *str, const float v[], const int n)
printf("\n");
}
+void minmax_v4v4_v4(float min[4], float max[4], const float vec[4])
+{
+ if (min[0] > vec[0]) {
+ min[0] = vec[0];
+ }
+ if (min[1] > vec[1]) {
+ min[1] = vec[1];
+ }
+ if (min[2] > vec[2]) {
+ min[2] = vec[2];
+ }
+ if (min[3] > vec[3]) {
+ min[3] = vec[3];
+ }
+
+ if (max[0] < vec[0]) {
+ max[0] = vec[0];
+ }
+ if (max[1] < vec[1]) {
+ max[1] = vec[1];
+ }
+ if (max[2] < vec[2]) {
+ max[2] = vec[2];
+ }
+ if (max[3] < vec[3]) {
+ max[3] = vec[3];
+ }
+}
+
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
{
if (min[0] > vec[0]) {