Blender  V2.93
util_math_float3.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __UTIL_MATH_FLOAT3_H__
18 #define __UTIL_MATH_FLOAT3_H__
19 
20 #ifndef __UTIL_MATH_H__
21 # error "Do not include this file directly, include util_types.h instead."
22 #endif
23 
25 
26 /*******************************************************************************
27  * Declaration.
28  */
29 
30 #ifndef __KERNEL_OPENCL__
33 ccl_device_inline float3 operator*(const float3 &a, const float f);
34 ccl_device_inline float3 operator*(const float f, const float3 &a);
35 ccl_device_inline float3 operator/(const float f, const float3 &a);
36 ccl_device_inline float3 operator/(const float3 &a, const float f);
38 ccl_device_inline float3 operator+(const float3 &a, const float f);
40 ccl_device_inline float3 operator-(const float3 &a, const float f);
48 
49 ccl_device_inline bool operator==(const float3 &a, const float3 &b);
50 ccl_device_inline bool operator!=(const float3 &a, const float3 &b);
51 
52 ccl_device_inline float distance(const float3 &a, const float3 &b);
53 ccl_device_inline float dot(const float3 &a, const float3 &b);
54 ccl_device_inline float dot_xy(const float3 &a, const float3 &b);
55 ccl_device_inline float3 cross(const float3 &a, const float3 &b);
57 ccl_device_inline float3 min(const float3 &a, const float3 &b);
58 ccl_device_inline float3 max(const float3 &a, const float3 &b);
59 ccl_device_inline float3 clamp(const float3 &a, const float3 &mn, const float3 &mx);
61 ccl_device_inline float3 mix(const float3 &a, const float3 &b, float t);
66 #endif /* !__KERNEL_OPENCL__ */
67 
70 ccl_device_inline float len(const float3 a);
72 
73 ccl_device_inline float3 reflect(const float3 incident, const float3 normal);
74 ccl_device_inline float3 project(const float3 v, const float3 v_proj);
75 
84 
85 ccl_device_inline bool is_zero(const float3 a);
87 ccl_device_inline float average(const float3 a);
88 ccl_device_inline bool isequal_float3(const float3 a, const float3 b);
89 
90 /*******************************************************************************
91  * Definition.
92  */
93 
95 {
96 #ifdef __KERNEL_SSE__
97  return float3(_mm_setzero_ps());
98 #else
99  return make_float3(0.0f, 0.0f, 0.0f);
100 #endif
101 }
102 
104 {
105  return make_float3(1.0f, 1.0f, 1.0f);
106 }
107 
108 #ifndef __KERNEL_OPENCL__
110 {
111 # ifdef __KERNEL_SSE__
112  return float3(_mm_xor_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))));
113 # else
114  return make_float3(-a.x, -a.y, -a.z);
115 # endif
116 }
117 
119 {
120 # ifdef __KERNEL_SSE__
121  return float3(_mm_mul_ps(a.m128, b.m128));
122 # else
123  return make_float3(a.x * b.x, a.y * b.y, a.z * b.z);
124 # endif
125 }
126 
127 ccl_device_inline float3 operator*(const float3 &a, const float f)
128 {
129 # ifdef __KERNEL_SSE__
130  return float3(_mm_mul_ps(a.m128, _mm_set1_ps(f)));
131 # else
132  return make_float3(a.x * f, a.y * f, a.z * f);
133 # endif
134 }
135 
136 ccl_device_inline float3 operator*(const float f, const float3 &a)
137 {
138 # if defined(__KERNEL_SSE__)
139  return float3(_mm_mul_ps(_mm_set1_ps(f), a.m128));
140 # else
141  return make_float3(a.x * f, a.y * f, a.z * f);
142 # endif
143 }
144 
145 ccl_device_inline float3 operator/(const float f, const float3 &a)
146 {
147 # if defined(__KERNEL_SSE__)
148  return float3(_mm_div_ps(_mm_set1_ps(f), a.m128));
149 # else
150  return make_float3(f / a.x, f / a.y, f / a.z);
151 # endif
152 }
153 
154 ccl_device_inline float3 operator/(const float3 &a, const float f)
155 {
156  float invf = 1.0f / f;
157  return a * invf;
158 }
159 
161 {
162 # if defined(__KERNEL_SSE__)
163  return float3(_mm_div_ps(a.m128, b.m128));
164 # else
165  return make_float3(a.x / b.x, a.y / b.y, a.z / b.z);
166 # endif
167 }
168 
169 ccl_device_inline float3 operator+(const float3 &a, const float f)
170 {
171  return a + make_float3(f, f, f);
172 }
173 
175 {
176 # ifdef __KERNEL_SSE__
177  return float3(_mm_add_ps(a.m128, b.m128));
178 # else
179  return make_float3(a.x + b.x, a.y + b.y, a.z + b.z);
180 # endif
181 }
182 
183 ccl_device_inline float3 operator-(const float3 &a, const float f)
184 {
185  return a - make_float3(f, f, f);
186 }
187 
189 {
190 # ifdef __KERNEL_SSE__
191  return float3(_mm_sub_ps(a.m128, b.m128));
192 # else
193  return make_float3(a.x - b.x, a.y - b.y, a.z - b.z);
194 # endif
195 }
196 
198 {
199  return a = a + b;
200 }
201 
203 {
204  return a = a - b;
205 }
206 
208 {
209  return a = a * b;
210 }
211 
213 {
214  return a = a * f;
215 }
216 
218 {
219  return a = a / b;
220 }
221 
223 {
224  float invf = 1.0f / f;
225  return a = a * invf;
226 }
227 
229 {
230 # ifdef __KERNEL_SSE__
231  return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 7) == 7;
232 # else
233  return (a.x == b.x && a.y == b.y && a.z == b.z);
234 # endif
235 }
236 
238 {
239  return !(a == b);
240 }
241 
242 ccl_device_inline float distance(const float3 &a, const float3 &b)
243 {
244  return len(a - b);
245 }
246 
247 ccl_device_inline float dot(const float3 &a, const float3 &b)
248 {
249 # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
250  return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F));
251 # else
252  return a.x * b.x + a.y * b.y + a.z * b.z;
253 # endif
254 }
255 
256 ccl_device_inline float dot_xy(const float3 &a, const float3 &b)
257 {
258 # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
259  return _mm_cvtss_f32(_mm_hadd_ps(_mm_mul_ps(a, b), b));
260 # else
261  return a.x * b.x + a.y * b.y;
262 # endif
263 }
264 
266 {
267  float3 r = make_float3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
268  return r;
269 }
270 
272 {
273 # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
274  __m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F));
275  return float3(_mm_div_ps(a.m128, norm));
276 # else
277  return a / len(a);
278 # endif
279 }
280 
282 {
283 # ifdef __KERNEL_SSE__
284  return float3(_mm_min_ps(a.m128, b.m128));
285 # else
286  return make_float3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z));
287 # endif
288 }
289 
291 {
292 # ifdef __KERNEL_SSE__
293  return float3(_mm_max_ps(a.m128, b.m128));
294 # else
295  return make_float3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z));
296 # endif
297 }
298 
299 ccl_device_inline float3 clamp(const float3 &a, const float3 &mn, const float3 &mx)
300 {
301  return min(max(a, mn), mx);
302 }
303 
305 {
306 # ifdef __KERNEL_SSE__
307 # ifdef __KERNEL_NEON__
308  return float3(vabsq_f32(a.m128));
309 # else
310  __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
311  return float3(_mm_and_ps(a.m128, mask));
312 # endif
313 # else
314  return make_float3(fabsf(a.x), fabsf(a.y), fabsf(a.z));
315 # endif
316 }
317 
319 {
320 # ifdef __KERNEL_SSE__
321  return float3(_mm_sqrt_ps(a));
322 # else
323  return make_float3(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z));
324 # endif
325 }
326 
328 {
329 # ifdef __KERNEL_SSE__
330  return float3(_mm_floor_ps(a));
331 # else
332  return make_float3(floorf(a.x), floorf(a.y), floorf(a.z));
333 # endif
334 }
335 
337 {
338 # ifdef __KERNEL_SSE__
339  return float3(_mm_ceil_ps(a));
340 # else
341  return make_float3(ceilf(a.x), ceilf(a.y), ceilf(a.z));
342 # endif
343 }
344 
345 ccl_device_inline float3 mix(const float3 &a, const float3 &b, float t)
346 {
347  return a + t * (b - a);
348 }
349 
351 {
352 # ifdef __KERNEL_SSE__
353  /* Don't use _mm_rcp_ps due to poor precision. */
354  return float3(_mm_div_ps(_mm_set_ps1(1.0f), a.m128));
355 # else
356  return make_float3(1.0f / a.x, 1.0f / a.y, 1.0f / a.z);
357 # endif
358 }
359 #endif /* !__KERNEL_OPENCL__ */
360 
362 {
363  return min(min(a.x, a.y), a.z);
364 }
365 
367 {
368  return max(max(a.x, a.y), a.z);
369 }
370 
372 {
373 #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
374  return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(a.m128, a.m128, 0x7F)));
375 #else
376  return sqrtf(dot(a, a));
377 #endif
378 }
379 
381 {
382  return dot(a, a);
383 }
384 
386 {
387  float3 unit_normal = normalize(normal);
388  return incident - 2.0f * unit_normal * dot(incident, unit_normal);
389 }
390 
391 ccl_device_inline float3 refract(const float3 incident, const float3 normal, const float eta)
392 {
393  float k = 1.0f - eta * eta * (1.0f - dot(normal, incident) * dot(normal, incident));
394  if (k < 0.0f)
395  return zero_float3();
396  else
397  return eta * incident - (eta * dot(normal, incident) + sqrt(k)) * normal;
398 }
399 
401  const float3 incident,
402  const float3 reference)
403 {
404  return (dot(reference, incident) < 0.0f) ? vector : -vector;
405 }
406 
408 {
409  float len_squared = dot(v_proj, v_proj);
410  return (len_squared != 0.0f) ? (dot(v, v_proj) / len_squared) * v_proj : zero_float3();
411 }
412 
414 {
415  return make_float3(saturate(a.x), saturate(a.y), saturate(a.z));
416 }
417 
419 {
420  *t = len(a);
421  float x = 1.0f / *t;
422  return a * x;
423 }
424 
426 {
427  float t = len(a);
428  return (t != 0.0f) ? a * (1.0f / t) : a;
429 }
430 
432 {
433  *t = len(a);
434  return (*t != 0.0f) ? a / (*t) : a;
435 }
436 
438 {
439  return make_float3((b.x != 0.0f) ? a.x / b.x : 0.0f,
440  (b.y != 0.0f) ? a.y / b.y : 0.0f,
441  (b.z != 0.0f) ? a.z / b.z : 0.0f);
442 }
443 
445 {
446  return (b != 0.0f) ? a / b : zero_float3();
447 }
448 
450 {
451  return a + t * (b - a);
452 }
453 
455 {
456  return a * a;
457 }
458 
460 {
461 #ifdef __KERNEL_SSE__
462  return a == make_float3(0.0f);
463 #else
464  return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f);
465 #endif
466 }
467 
469 {
470 #if defined(__KERNEL_SSE__) && defined(__KERNEL_NEON__)
471  __m128 t = a.m128;
472  t[3] = 0.0f;
473  return vaddvq_f32(t);
474 #else
475  return (a.x + a.y + a.z);
476 #endif
477 }
478 
480 {
481  return reduce_add(a) * (1.0f / 3.0f);
482 }
483 
485 {
486 #ifdef __KERNEL_OPENCL__
487  return all(a == b);
488 #else
489  return a == b;
490 #endif
491 }
492 
494 {
495  return make_float3(powf(v.x, e), powf(v.y, e), powf(v.z, e));
496 }
497 
499 {
500  return make_float3(expf(v.x), expf(v.y), expf(v.z));
501 }
502 
504 {
505  return make_float3(logf(v.x), logf(v.y), logf(v.z));
506 }
507 
509 {
510 #ifdef __KERNEL_SSE__
511  int3 b = int3(_mm_cvttps_epi32(a.m128));
512  int3 isneg = int3(_mm_castps_si128(_mm_cmplt_ps(a.m128, _mm_set_ps1(0.0f))));
513  /* Unsaturated add 0xffffffff is the same as subtract -1. */
514  return b + isneg;
515 #else
517 #endif
518 }
519 
521 {
522  return isfinite_safe(v.x) && isfinite_safe(v.y) && isfinite_safe(v.z);
523 }
524 
526 {
527  if (!isfinite_safe(v.x))
528  v.x = 0.0f;
529  if (!isfinite_safe(v.y))
530  v.y = 0.0f;
531  if (!isfinite_safe(v.z))
532  v.z = 0.0f;
533  return v;
534 }
535 
537 
538 #endif /* __UTIL_MATH_FLOAT3_H__ */
_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 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 t
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Definition: btVector3.h:263
IconTextureDrawCall normal
#define logf(x)
#define expf(x)
#define ccl_device_inline
#define powf(x, y)
#define CCL_NAMESPACE_END
#define ceilf(x)
#define floorf(x)
#define fabsf(x)
#define make_int3(x, y, z)
#define sqrtf(x)
#define make_float3(x, y, z)
static unsigned a[3]
Definition: RandGen.cpp:92
std::vector< ElementType, Eigen::aligned_allocator< ElementType > > vector
Definition: vector.h:39
float z
Definition: sky_float3.h:35
float y
Definition: sky_float3.h:35
float x
Definition: sky_float3.h:35
__forceinline bool all(const avxb &b)
Definition: util_avxb.h:214
ccl_device_inline int quick_floor_to_int(float x)
Definition: util_math.h:331
ccl_device_inline float saturate(float a)
Definition: util_math.h:315
ccl_device_inline bool isfinite_safe(float f)
Definition: util_math.h:270
ccl_device_inline float dot(const float3 &a, const float3 &b)
ccl_device_inline float3 operator+(const float3 &a, const float f)
ccl_device_inline float3 safe_normalize(const float3 a)
ccl_device_inline bool is_zero(const float3 a)
ccl_device_inline float3 operator*(const float3 &a, const float3 &b)
ccl_device_inline float3 normalize(const float3 &a)
ccl_device_inline float distance(const float3 &a, const float3 &b)
ccl_device_inline float3 safe_divide_float3_float3(const float3 a, const float3 b)
ccl_device_inline float3 saturate3(float3 a)
ccl_device_inline float3 refract(const float3 incident, const float3 normal, const float eta)
ccl_device_inline float3 normalize_len(const float3 a, float *t)
ccl_device_inline float3 one_float3()
ccl_device_inline float3 sqr3(float3 a)
ccl_device_inline float3 faceforward(const float3 vector, const float3 incident, const float3 reference)
ccl_device_inline float3 exp3(float3 v)
ccl_device_inline float3 operator*=(float3 &a, const float3 &b)
ccl_device_inline float3 ceil(const float3 &a)
ccl_device_inline float min3(float3 a)
ccl_device_inline float3 safe_divide_float3_float(const float3 a, const float b)
ccl_device_inline bool operator!=(const float3 &a, const float3 &b)
ccl_device_inline float3 log3(float3 v)
ccl_device_inline float3 project(const float3 v, const float3 v_proj)
ccl_device_inline float3 max(const float3 &a, const float3 &b)
ccl_device_inline int3 quick_floor_to_int3(const float3 a)
ccl_device_inline float3 mix(const float3 &a, const float3 &b, float t)
ccl_device_inline float3 safe_normalize_len(const float3 a, float *t)
ccl_device_inline float3 rcp(const float3 &a)
ccl_device_inline float3 operator+=(float3 &a, const float3 &b)
ccl_device_inline float reduce_add(const float3 a)
ccl_device_inline float3 zero_float3()
ccl_device_inline bool operator==(const float3 &a, const float3 &b)
ccl_device_inline float3 fabs(const float3 &a)
ccl_device_inline float dot_xy(const float3 &a, const float3 &b)
ccl_device_inline float max3(float3 a)
ccl_device_inline float average(const float3 a)
ccl_device_inline float3 min(const float3 &a, const float3 &b)
ccl_device_inline float3 operator/(const float f, const float3 &a)
ccl_device_inline float3 floor(const float3 &a)
ccl_device_inline float3 ensure_finite3(float3 v)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 operator-(const float3 &a)
ccl_device_inline float3 sqrt(const float3 &a)
ccl_device_inline bool isfinite3_safe(float3 v)
ccl_device_inline float3 operator/=(float3 &a, const float3 &b)
ccl_device_inline float3 cross(const float3 &a, const float3 &b)
ccl_device_inline float3 interp(float3 a, float3 b, float t)
ccl_device_inline float3 operator-=(float3 &a, const float3 &b)
ccl_device_inline float3 clamp(const float3 &a, const float3 &mn, const float3 &mx)
ccl_device_inline float3 pow3(float3 v, float e)
ccl_device_inline float len_squared(const float3 a)
ccl_device_inline float len(const float3 a)
ccl_device_inline float3 reflect(const float3 incident, const float3 normal)
ccl_device_inline bool isequal_float3(const float3 a, const float3 b)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)