Math Lib: add mid_v3_v3v3v3v3

This commit is contained in:
2015-03-09 20:20:39 +11:00
parent d4c1e98dd4
commit 9ffc66b1c0
2 changed files with 8 additions and 0 deletions

View File

@@ -208,6 +208,7 @@ void interp_v4_v4v4_uchar(unsigned char target[4], const unsigned char a[4], con
void mid_v3_v3v3(float r[3], const float a[3], const float b[3]);
void mid_v2_v2v2(float r[2], const float a[2], const float b[2]);
void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3]);
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
void mid_v3_v3v3_angle_weighted(float r[3], const float a[3], const float b[3]);
void mid_v3_angle_weighted(float r[3]);

View File

@@ -252,6 +252,13 @@ void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float
v[2] = (v1[2] + v2[2] + v3[2]) / 3.0f;
}
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
v[0] = (v1[0] + v2[0] + v3[0] + v4[0]) / 4.0f;
v[1] = (v1[1] + v2[1] + v3[1] + v4[1]) / 4.0f;
v[2] = (v1[2] + v2[2] + v3[2] + v4[2]) / 4.0f;
}
/**
* Specialized function for calculating normals.
* fastpath for: