Blender  V2.93
math_geom_inline.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  *
19  * The Original Code is: some of this file.
20  */
21 
26 #ifndef __MATH_GEOM_INLINE_C__
27 #define __MATH_GEOM_INLINE_C__
28 
29 #include "BLI_math.h"
30 #include "BLI_math_vector.h"
31 
32 #include <string.h>
33 
34 /* A few small defines. Keep'em local! */
35 #define SMALL_NUMBER 1.e-8f
36 
37 /********************************** Polygons *********************************/
38 
39 MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
40 {
41  return (v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]);
42 }
43 
44 MINLINE float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
45 {
46  return 0.5f * ((v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]));
47 }
48 
49 MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
50 {
51  return fabsf(area_tri_signed_v2(v1, v2, v3));
52 }
53 
54 MINLINE float area_squared_tri_v2(const float v1[2], const float v2[2], const float v3[2])
55 {
56  float area = area_tri_signed_v2(v1, v2, v3);
57  return area * area;
58 }
59 
60 /****************************** Spherical Harmonics **************************/
61 
62 MINLINE void zero_sh(float r[9])
63 {
64  memset(r, 0, sizeof(float[9]));
65 }
66 
67 MINLINE void copy_sh_sh(float r[9], const float a[9])
68 {
69  memcpy(r, a, sizeof(float[9]));
70 }
71 
72 MINLINE void mul_sh_fl(float r[9], const float f)
73 {
74  int i;
75 
76  for (i = 0; i < 9; i++) {
77  r[i] *= f;
78  }
79 }
80 
81 MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9])
82 {
83  int i;
84 
85  for (i = 0; i < 9; i++) {
86  r[i] = a[i] + b[i];
87  }
88 }
89 
90 MINLINE float dot_shsh(const float a[9], const float b[9])
91 {
92  float r = 0.0f;
93  int i;
94 
95  for (i = 0; i < 9; i++) {
96  r += a[i] * b[i];
97  }
98 
99  return r;
100 }
101 
102 MINLINE float diffuse_shv3(float sh[9], const float v[3])
103 {
104  /* See formula (13) in:
105  * "An Efficient Representation for Irradiance Environment Maps" */
106  static const float c1 = 0.429043f, c2 = 0.511664f, c3 = 0.743125f;
107  static const float c4 = 0.886227f, c5 = 0.247708f;
108  float x, y, z, sum;
109 
110  x = v[0];
111  y = v[1];
112  z = v[2];
113 
114  sum = c1 * sh[8] * (x * x - y * y);
115  sum += c3 * sh[6] * z * z;
116  sum += c4 * sh[0];
117  sum += -c5 * sh[6];
118  sum += 2.0f * c1 * (sh[4] * x * y + sh[7] * x * z + sh[5] * y * z);
119  sum += 2.0f * c2 * (sh[3] * x + sh[1] * y + sh[2] * z);
120 
121  return sum;
122 }
123 
124 MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f)
125 {
126  /* See formula (3) in:
127  * "An Efficient Representation for Irradiance Environment Maps" */
128  float sh[9], x, y, z;
129 
130  x = v[0];
131  y = v[1];
132  z = v[2];
133 
134  sh[0] = 0.282095f;
135 
136  sh[1] = 0.488603f * y;
137  sh[2] = 0.488603f * z;
138  sh[3] = 0.488603f * x;
139 
140  sh[4] = 1.092548f * x * y;
141  sh[5] = 1.092548f * y * z;
142  sh[6] = 0.315392f * (3.0f * z * z - 1.0f);
143  sh[7] = 1.092548f * x * z;
144  sh[8] = 0.546274f * (x * x - y * y);
145 
146  mul_sh_fl(sh, f);
147  copy_sh_sh(r, sh);
148 }
149 
150 MINLINE float eval_shv3(float sh[9], const float v[3])
151 {
152  float tmp[9];
153 
154  vec_fac_to_sh(tmp, v, 1.0f);
155  return dot_shsh(tmp, sh);
156 }
157 
158 MINLINE void madd_sh_shfl(float r[9], const float sh[9], const float f)
159 {
160  float tmp[9];
161 
162  copy_sh_sh(tmp, sh);
163  mul_sh_fl(tmp, f);
164  add_sh_shsh(r, r, tmp);
165 }
166 
167 /* get the 2 dominant axis values, 0==X, 1==Y, 2==Z */
168 MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3])
169 {
170  const float xn = fabsf(axis[0]);
171  const float yn = fabsf(axis[1]);
172  const float zn = fabsf(axis[2]);
173 
174  if (zn >= xn && zn >= yn) {
175  *r_axis_a = 0;
176  *r_axis_b = 1;
177  }
178  else if (yn >= xn && yn >= zn) {
179  *r_axis_a = 0;
180  *r_axis_b = 2;
181  }
182  else {
183  *r_axis_a = 1;
184  *r_axis_b = 2;
185  }
186 }
187 
188 /* same as axis_dominant_v3 but return the max value */
189 MINLINE float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float axis[3])
190 {
191  const float xn = fabsf(axis[0]);
192  const float yn = fabsf(axis[1]);
193  const float zn = fabsf(axis[2]);
194 
195  if (zn >= xn && zn >= yn) {
196  *r_axis_a = 0;
197  *r_axis_b = 1;
198  return zn;
199  }
200  else if (yn >= xn && yn >= zn) {
201  *r_axis_a = 0;
202  *r_axis_b = 2;
203  return yn;
204  }
205  else {
206  *r_axis_a = 1;
207  *r_axis_b = 2;
208  return xn;
209  }
210 }
211 
212 /* get the single dominant axis value, 0==X, 1==Y, 2==Z */
213 MINLINE int axis_dominant_v3_single(const float vec[3])
214 {
215  const float x = fabsf(vec[0]);
216  const float y = fabsf(vec[1]);
217  const float z = fabsf(vec[2]);
218  return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
219 }
220 
221 /* the dominant axis of an orthogonal vector */
222 MINLINE int axis_dominant_v3_ortho_single(const float vec[3])
223 {
224  const float x = fabsf(vec[0]);
225  const float y = fabsf(vec[1]);
226  const float z = fabsf(vec[2]);
227  return ((x < y) ? ((x < z) ? 0 : 2) : ((y < z) ? 1 : 2));
228 }
229 
230 MINLINE int max_axis_v3(const float vec[3])
231 {
232  const float x = vec[0];
233  const float y = vec[1];
234  const float z = vec[2];
235  return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
236 }
237 
238 MINLINE int min_axis_v3(const float vec[3])
239 {
240  const float x = vec[0];
241  const float y = vec[1];
242  const float z = vec[2];
243  return ((x < y) ? ((x < z) ? 0 : 2) : ((y < z) ? 1 : 2));
244 }
245 
252 MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
253 {
254  BLI_assert(!poly_count || corner_count > poly_count * 2);
255  return corner_count - (poly_count * 2);
256 }
257 
258 MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
259 {
260  return dot_v3v3(co, plane) + plane[3];
261 }
262 
263 /* useful to calculate an even width shell, by taking the angle between 2 planes.
264  * The return value is a scale on the offset.
265  * no angle between planes is 1.0, as the angle between the 2 planes approaches 180d
266  * the distance gets very high, 180d would be inf, but this case isn't valid */
268 {
269  return (UNLIKELY(angle < SMALL_NUMBER)) ? 1.0f : fabsf(1.0f / cosf(angle));
270 }
274 MINLINE float shell_v3v3_normalized_to_dist(const float a[3], const float b[3])
275 {
276  const float angle_cos = fabsf(dot_v3v3(a, b));
279  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
280 }
284 MINLINE float shell_v2v2_normalized_to_dist(const float a[2], const float b[2])
285 {
286  const float angle_cos = fabsf(dot_v2v2(a, b));
289  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
290 }
291 
295 MINLINE float shell_v3v3_mid_normalized_to_dist(const float a[3], const float b[3])
296 {
297  float angle_cos;
298  float ab[3];
301  add_v3_v3v3(ab, a, b);
302  angle_cos = (normalize_v3(ab) != 0.0f) ? fabsf(dot_v3v3(a, ab)) : 0.0f;
303  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
304 }
305 
309 MINLINE float shell_v2v2_mid_normalized_to_dist(const float a[2], const float b[2])
310 {
311  float angle_cos;
312  float ab[2];
315  add_v2_v2v2(ab, a, b);
316  angle_cos = (normalize_v2(ab) != 0.0f) ? fabsf(dot_v2v2(a, ab)) : 0.0f;
317  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
318 }
319 
320 #undef SMALL_NUMBER
321 
322 #endif /* __MATH_GEOM_INLINE_C__ */
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define BLI_ASSERT_UNIT_V2(v)
#define BLI_ASSERT_UNIT_V3(v)
#define MINLINE
MINLINE float normalize_v3(float r[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2(float r[2])
#define UNLIKELY(x)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static T sum(const btAlignedObjectArray< T > &items)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define cosf(x)
#define fabsf(x)
MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
MINLINE float shell_v2v2_normalized_to_dist(const float a[2], const float b[2])
MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
MINLINE float diffuse_shv3(float sh[9], const float v[3])
MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f)
MINLINE float area_squared_tri_v2(const float v1[2], const float v2[2], const float v3[2])
MINLINE int axis_dominant_v3_single(const float vec[3])
MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
MINLINE int axis_dominant_v3_ortho_single(const float vec[3])
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
#define SMALL_NUMBER
MINLINE float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float axis[3])
MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9])
MINLINE void mul_sh_fl(float r[9], const float f)
MINLINE float shell_v3v3_normalized_to_dist(const float a[3], const float b[3])
MINLINE float shell_v3v3_mid_normalized_to_dist(const float a[3], const float b[3])
MINLINE float dot_shsh(const float a[9], const float b[9])
MINLINE float eval_shv3(float sh[9], const float v[3])
MINLINE float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
MINLINE float shell_v2v2_mid_normalized_to_dist(const float a[2], const float b[2])
MINLINE int min_axis_v3(const float vec[3])
MINLINE float shell_angle_to_dist(const float angle)
MINLINE void copy_sh_sh(float r[9], const float a[9])
MINLINE void zero_sh(float r[9])
MINLINE void madd_sh_shfl(float r[9], const float sh[9], const float f)
MINLINE int max_axis_v3(const float vec[3])
MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3])
static unsigned a[3]
Definition: RandGen.cpp:92
static void area(int d1, int d2, int e1, int e2, float weights[2])