Blender  V3.3
math_geom_inline.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #ifndef __MATH_GEOM_INLINE_C__
9 #define __MATH_GEOM_INLINE_C__
10 
11 #include "BLI_math.h"
12 #include "BLI_math_vector.h"
13 
14 #include <string.h>
15 
16 /* A few small defines. Keep'em local! */
17 #define SMALL_NUMBER 1.e-8f
18 
19 /********************************** Polygons *********************************/
20 
21 MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
22 {
23  return (v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]);
24 }
25 
26 MINLINE float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2])
27 {
28  return 0.5f * ((v1[0] - v2[0]) * (v2[1] - v3[1]) + (v1[1] - v2[1]) * (v3[0] - v2[0]));
29 }
30 
31 MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
32 {
33  return fabsf(area_tri_signed_v2(v1, v2, v3));
34 }
35 
36 MINLINE float area_squared_tri_v2(const float v1[2], const float v2[2], const float v3[2])
37 {
38  float area = area_tri_signed_v2(v1, v2, v3);
39  return area * area;
40 }
41 
42 /****************************** Spherical Harmonics **************************/
43 
44 MINLINE void zero_sh(float r[9])
45 {
46  memset(r, 0, sizeof(float[9]));
47 }
48 
49 MINLINE void copy_sh_sh(float r[9], const float a[9])
50 {
51  memcpy(r, a, sizeof(float[9]));
52 }
53 
54 MINLINE void mul_sh_fl(float r[9], const float f)
55 {
56  int i;
57 
58  for (i = 0; i < 9; i++) {
59  r[i] *= f;
60  }
61 }
62 
63 MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9])
64 {
65  int i;
66 
67  for (i = 0; i < 9; i++) {
68  r[i] = a[i] + b[i];
69  }
70 }
71 
72 MINLINE float dot_shsh(const float a[9], const float b[9])
73 {
74  float r = 0.0f;
75  int i;
76 
77  for (i = 0; i < 9; i++) {
78  r += a[i] * b[i];
79  }
80 
81  return r;
82 }
83 
84 MINLINE float diffuse_shv3(const float sh[9], const float v[3])
85 {
86  /* See formula (13) in:
87  * "An Efficient Representation for Irradiance Environment Maps" */
88  static const float c1 = 0.429043f, c2 = 0.511664f, c3 = 0.743125f;
89  static const float c4 = 0.886227f, c5 = 0.247708f;
90  float x, y, z, sum;
91 
92  x = v[0];
93  y = v[1];
94  z = v[2];
95 
96  sum = c1 * sh[8] * (x * x - y * y);
97  sum += c3 * sh[6] * z * z;
98  sum += c4 * sh[0];
99  sum += -c5 * sh[6];
100  sum += 2.0f * c1 * (sh[4] * x * y + sh[7] * x * z + sh[5] * y * z);
101  sum += 2.0f * c2 * (sh[3] * x + sh[1] * y + sh[2] * z);
102 
103  return sum;
104 }
105 
106 MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f)
107 {
108  /* See formula (3) in:
109  * "An Efficient Representation for Irradiance Environment Maps" */
110  float sh[9], x, y, z;
111 
112  x = v[0];
113  y = v[1];
114  z = v[2];
115 
116  sh[0] = 0.282095f;
117 
118  sh[1] = 0.488603f * y;
119  sh[2] = 0.488603f * z;
120  sh[3] = 0.488603f * x;
121 
122  sh[4] = 1.092548f * x * y;
123  sh[5] = 1.092548f * y * z;
124  sh[6] = 0.315392f * (3.0f * z * z - 1.0f);
125  sh[7] = 1.092548f * x * z;
126  sh[8] = 0.546274f * (x * x - y * y);
127 
128  mul_sh_fl(sh, f);
129  copy_sh_sh(r, sh);
130 }
131 
132 MINLINE float eval_shv3(float sh[9], const float v[3])
133 {
134  float tmp[9];
135 
136  vec_fac_to_sh(tmp, v, 1.0f);
137  return dot_shsh(tmp, sh);
138 }
139 
140 MINLINE void madd_sh_shfl(float r[9], const float sh[9], const float f)
141 {
142  float tmp[9];
143 
144  copy_sh_sh(tmp, sh);
145  mul_sh_fl(tmp, f);
146  add_sh_shsh(r, r, tmp);
147 }
148 
149 MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3])
150 {
151  const float xn = fabsf(axis[0]);
152  const float yn = fabsf(axis[1]);
153  const float zn = fabsf(axis[2]);
154 
155  if (zn >= xn && zn >= yn) {
156  *r_axis_a = 0;
157  *r_axis_b = 1;
158  }
159  else if (yn >= xn && yn >= zn) {
160  *r_axis_a = 0;
161  *r_axis_b = 2;
162  }
163  else {
164  *r_axis_a = 1;
165  *r_axis_b = 2;
166  }
167 }
168 
169 MINLINE float axis_dominant_v3_max(int *r_axis_a, int *r_axis_b, const float axis[3])
170 {
171  const float xn = fabsf(axis[0]);
172  const float yn = fabsf(axis[1]);
173  const float zn = fabsf(axis[2]);
174 
175  if (zn >= xn && zn >= yn) {
176  *r_axis_a = 0;
177  *r_axis_b = 1;
178  return zn;
179  }
180  else if (yn >= xn && yn >= zn) {
181  *r_axis_a = 0;
182  *r_axis_b = 2;
183  return yn;
184  }
185  else {
186  *r_axis_a = 1;
187  *r_axis_b = 2;
188  return xn;
189  }
190 }
191 
192 MINLINE int axis_dominant_v3_single(const float vec[3])
193 {
194  const float x = fabsf(vec[0]);
195  const float y = fabsf(vec[1]);
196  const float z = fabsf(vec[2]);
197  return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
198 }
199 
200 MINLINE int axis_dominant_v3_ortho_single(const float vec[3])
201 {
202  const float x = fabsf(vec[0]);
203  const float y = fabsf(vec[1]);
204  const float z = fabsf(vec[2]);
205  return ((x < y) ? ((x < z) ? 0 : 2) : ((y < z) ? 1 : 2));
206 }
207 
208 MINLINE int max_axis_v3(const float vec[3])
209 {
210  const float x = vec[0];
211  const float y = vec[1];
212  const float z = vec[2];
213  return ((x > y) ? ((x > z) ? 0 : 2) : ((y > z) ? 1 : 2));
214 }
215 
216 MINLINE int min_axis_v3(const float vec[3])
217 {
218  const float x = vec[0];
219  const float y = vec[1];
220  const float z = vec[2];
221  return ((x < y) ? ((x < z) ? 0 : 2) : ((y < z) ? 1 : 2));
222 }
223 
224 MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
225 {
226  BLI_assert(!poly_count || corner_count > poly_count * 2);
227  return corner_count - (poly_count * 2);
228 }
229 
230 MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
231 {
232  return dot_v3v3(co, plane) + plane[3];
233 }
234 
236 {
237  return (UNLIKELY(angle < SMALL_NUMBER)) ? 1.0f : fabsf(1.0f / cosf(angle));
238 }
239 MINLINE float shell_v3v3_normalized_to_dist(const float a[3], const float b[3])
240 {
241  const float angle_cos = fabsf(dot_v3v3(a, b));
244  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
245 }
246 MINLINE float shell_v2v2_normalized_to_dist(const float a[2], const float b[2])
247 {
248  const float angle_cos = fabsf(dot_v2v2(a, b));
251  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
252 }
253 
254 MINLINE float shell_v3v3_mid_normalized_to_dist(const float a[3], const float b[3])
255 {
256  float angle_cos;
257  float ab[3];
260  add_v3_v3v3(ab, a, b);
261  angle_cos = (normalize_v3(ab) != 0.0f) ? fabsf(dot_v3v3(a, ab)) : 0.0f;
262  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
263 }
264 
265 MINLINE float shell_v2v2_mid_normalized_to_dist(const float a[2], const float b[2])
266 {
267  float angle_cos;
268  float ab[2];
271  add_v2_v2v2(ab, a, b);
272  angle_cos = (normalize_v2(ab) != 0.0f) ? fabsf(dot_v2v2(a, ab)) : 0.0f;
273  return (UNLIKELY(angle_cos < SMALL_NUMBER)) ? 1.0f : (1.0f / angle_cos);
274 }
275 
276 #undef SMALL_NUMBER
277 
278 #endif /* __MATH_GEOM_INLINE_C__ */
#define BLI_assert(a)
Definition: BLI_assert.h:46
#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)
Definition: cuda/compat.h:101
ccl_gpu_kernel_postfix ccl_global float int int int int sh
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 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 diffuse_shv3(const float sh[9], const float v[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])
#define fabsf(x)
Definition: metal/compat.h:219
static unsigned a[3]
Definition: RandGen.cpp:78
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)