Blender  V2.93
util_transform.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 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_TRANSFORM_H__
18 #define __UTIL_TRANSFORM_H__
19 
20 #ifndef __KERNEL_GPU__
21 # include <string.h>
22 #endif
23 
24 #include "util/util_math.h"
25 #include "util/util_types.h"
26 
28 
29 /* Affine transformation, stored as 4x3 matrix. */
30 
31 typedef struct Transform {
32  float4 x, y, z;
33 
34 #ifndef __KERNEL_GPU__
35  float4 operator[](int i) const
36  {
37  return *(&x + i);
38  }
39  float4 &operator[](int i)
40  {
41  return *(&x + i);
42  }
43 #endif
44 } Transform;
45 
46 /* Transform decomposed in rotation/translation/scale. we use the same data
47  * structure as Transform, and tightly pack decomposition into it. first the
48  * rotation (4), then translation (3), then 3x3 scale matrix (9). */
49 
50 typedef struct DecomposedTransform {
51  float4 x, y, z, w;
53 
54 /* Functions */
55 
57 {
58  /* TODO(sergey): Disabled for now, causes crashes in certain cases. */
59 #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__)
60  ssef x, y, z, w, aa;
61  aa = a.m128;
62 
63  x = _mm_loadu_ps(&t->x.x);
64  y = _mm_loadu_ps(&t->y.x);
65  z = _mm_loadu_ps(&t->z.x);
66  w = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f);
67 
68  _MM_TRANSPOSE4_PS(x, y, z, w);
69 
70  ssef tmp = shuffle<0>(aa) * x;
71  tmp = madd(shuffle<1>(aa), y, tmp);
72  tmp = madd(shuffle<2>(aa), z, tmp);
73  tmp += w;
74 
75  return float3(tmp.m128);
76 #else
77  float3 c = make_float3(a.x * t->x.x + a.y * t->x.y + a.z * t->x.z + t->x.w,
78  a.x * t->y.x + a.y * t->y.y + a.z * t->y.z + t->y.w,
79  a.x * t->z.x + a.y * t->z.y + a.z * t->z.z + t->z.w);
80 
81  return c;
82 #endif
83 }
84 
86 {
87 #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__)
88  ssef x, y, z, w, aa;
89  aa = a.m128;
90  x = _mm_loadu_ps(&t->x.x);
91  y = _mm_loadu_ps(&t->y.x);
92  z = _mm_loadu_ps(&t->z.x);
93  w = _mm_setzero_ps();
94 
95  _MM_TRANSPOSE4_PS(x, y, z, w);
96 
97  ssef tmp = shuffle<0>(aa) * x;
98  tmp = madd(shuffle<1>(aa), y, tmp);
99  tmp = madd(shuffle<2>(aa), z, tmp);
100 
101  return float3(tmp.m128);
102 #else
103  float3 c = make_float3(a.x * t->x.x + a.y * t->x.y + a.z * t->x.z,
104  a.x * t->y.x + a.y * t->y.y + a.z * t->y.z,
105  a.x * t->z.x + a.y * t->z.y + a.z * t->z.z);
106 
107  return c;
108 #endif
109 }
110 
112 {
113  float3 x = make_float3(t->x.x, t->y.x, t->z.x);
114  float3 y = make_float3(t->x.y, t->y.y, t->z.y);
115  float3 z = make_float3(t->x.z, t->y.z, t->z.z);
116 
117  return make_float3(dot(x, a), dot(y, a), dot(z, a));
118 }
119 
121  float b,
122  float c,
123  float d,
124  float e,
125  float f,
126  float g,
127  float h,
128  float i,
129  float j,
130  float k,
131  float l)
132 {
133  Transform t;
134 
135  t.x.x = a;
136  t.x.y = b;
137  t.x.z = c;
138  t.x.w = d;
139  t.y.x = e;
140  t.y.y = f;
141  t.y.z = g;
142  t.y.w = h;
143  t.z.x = i;
144  t.z.y = j;
145  t.z.z = k;
146  t.z.w = l;
147 
148  return t;
149 }
150 
152 {
153  float cx = cosf(euler.x);
154  float cy = cosf(euler.y);
155  float cz = cosf(euler.z);
156  float sx = sinf(euler.x);
157  float sy = sinf(euler.y);
158  float sz = sinf(euler.z);
159 
160  Transform t;
161  t.x.x = cy * cz;
162  t.y.x = cy * sz;
163  t.z.x = -sy;
164 
165  t.x.y = sy * sx * cz - cx * sz;
166  t.y.y = sy * sx * sz + cx * cz;
167  t.z.y = cy * sx;
168 
169  t.x.z = sy * cx * cz + sx * sz;
170  t.y.z = sy * cx * sz - sx * cz;
171  t.z.z = cy * cx;
172 
173  t.x.w = t.y.w = t.z.w = 0.0f;
174  return t;
175 }
176 
177 /* Constructs a coordinate frame from a normalized normal. */
179 {
180  const float3 dx0 = cross(make_float3(1.0f, 0.0f, 0.0f), N);
181  const float3 dx1 = cross(make_float3(0.0f, 1.0f, 0.0f), N);
182  const float3 dx = normalize((dot(dx0, dx0) > dot(dx1, dx1)) ? dx0 : dx1);
183  const float3 dy = normalize(cross(N, dx));
184  return make_transform(dx.x, dx.y, dx.z, 0.0f, dy.x, dy.y, dy.z, 0.0f, N.x, N.y, N.z, 0.0f);
185 }
186 
187 #ifndef __KERNEL_GPU__
188 
190 {
191  Transform zero = {zero_float4(), zero_float4(), zero_float4()};
192  return zero;
193 }
194 
196 {
197  float4 c_x = make_float4(b.x.x, b.y.x, b.z.x, 0.0f);
198  float4 c_y = make_float4(b.x.y, b.y.y, b.z.y, 0.0f);
199  float4 c_z = make_float4(b.x.z, b.y.z, b.z.z, 0.0f);
200  float4 c_w = make_float4(b.x.w, b.y.w, b.z.w, 1.0f);
201 
202  Transform t;
203  t.x = make_float4(dot(a.x, c_x), dot(a.x, c_y), dot(a.x, c_z), dot(a.x, c_w));
204  t.y = make_float4(dot(a.y, c_x), dot(a.y, c_y), dot(a.y, c_z), dot(a.y, c_w));
205  t.z = make_float4(dot(a.z, c_x), dot(a.z, c_y), dot(a.z, c_z), dot(a.z, c_w));
206 
207  return t;
208 }
209 
211 {
212  print_float4(label, t.x);
213  print_float4(label, t.y);
214  print_float4(label, t.z);
215  printf("\n");
216 }
217 
219 {
220  return make_transform(1, 0, 0, t.x, 0, 1, 0, t.y, 0, 0, 1, t.z);
221 }
222 
224 {
225  return transform_translate(make_float3(x, y, z));
226 }
227 
229 {
230  return make_transform(s.x, 0, 0, 0, 0, s.y, 0, 0, 0, 0, s.z, 0);
231 }
232 
234 {
235  return transform_scale(make_float3(x, y, z));
236 }
237 
239 {
240  float s = sinf(angle);
241  float c = cosf(angle);
242  float t = 1.0f - c;
243 
244  axis = normalize(axis);
245 
246  return make_transform(axis.x * axis.x * t + c,
247  axis.x * axis.y * t - s * axis.z,
248  axis.x * axis.z * t + s * axis.y,
249  0.0f,
250 
251  axis.y * axis.x * t + s * axis.z,
252  axis.y * axis.y * t + c,
253  axis.y * axis.z * t - s * axis.x,
254  0.0f,
255 
256  axis.z * axis.x * t - s * axis.y,
257  axis.z * axis.y * t + s * axis.x,
258  axis.z * axis.z * t + c,
259  0.0f);
260 }
261 
262 /* Euler is assumed to be in XYZ order. */
264 {
265  return transform_rotate(euler.z, make_float3(0.0f, 0.0f, 1.0f)) *
266  transform_rotate(euler.y, make_float3(0.0f, 1.0f, 0.0f)) *
267  transform_rotate(euler.x, make_float3(1.0f, 0.0f, 0.0f));
268 }
269 
271 {
272  return transform_scale(1.0f, 1.0f, 1.0f);
273 }
274 
276 {
277  return memcmp(&A, &B, sizeof(Transform)) == 0;
278 }
279 
281 {
282  return !(A == B);
283 }
284 
286 {
287  return make_float3(t->x[column], t->y[column], t->z[column]);
288 }
289 
291 {
292  t->x[column] = value.x;
293  t->y[column] = value.y;
294  t->z[column] = value.z;
295 }
296 
299 
301 {
302  /* the epsilon here is quite arbitrary, but this function is only used for
303  * surface area and bump, where we expect it to not be so sensitive */
304  float eps = 1e-6f;
305 
306  float sx = len_squared(float4_to_float3(tfm.x));
307  float sy = len_squared(float4_to_float3(tfm.y));
308  float sz = len_squared(float4_to_float3(tfm.z));
309  float stx = len_squared(transform_get_column(&tfm, 0));
310  float sty = len_squared(transform_get_column(&tfm, 1));
311  float stz = len_squared(transform_get_column(&tfm, 2));
312 
313  if (fabsf(sx - sy) < eps && fabsf(sx - sz) < eps && fabsf(sx - stx) < eps &&
314  fabsf(sx - sty) < eps && fabsf(sx - stz) < eps) {
315  scale = sx;
316  return true;
317  }
318 
319  return false;
320 }
321 
323 {
324  float3 c0 = transform_get_column(&tfm, 0);
325  float3 c1 = transform_get_column(&tfm, 1);
326  float3 c2 = transform_get_column(&tfm, 2);
327 
328  return (dot(cross(c0, c1), c2) < 0.0f);
329 }
330 
332 {
333  Transform ntfm = tfm;
334 
338 
339  return ntfm;
340 }
341 
343 {
344  return make_transform(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
345 }
346 
347 #endif
348 
349 /* Motion Transform */
350 
351 ccl_device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
352 {
353  /* Optix is using lerp to interpolate motion transformations. */
354 #ifdef __KERNEL_OPTIX__
355  return normalize((1.0f - t) * q1 + t * q2);
356 #else /* __KERNEL_OPTIX__ */
357  /* note: this does not ensure rotation around shortest angle, q1 and q2
358  * are assumed to be matched already in transform_motion_decompose */
359  float costheta = dot(q1, q2);
360 
361  /* possible optimization: it might be possible to precompute theta/qperp */
362 
363  if (costheta > 0.9995f) {
364  /* linear interpolation in degenerate case */
365  return normalize((1.0f - t) * q1 + t * q2);
366  }
367  else {
368  /* slerp */
369  float theta = acosf(clamp(costheta, -1.0f, 1.0f));
370  float4 qperp = normalize(q2 - q1 * costheta);
371  float thetap = theta * t;
372  return q1 * cosf(thetap) + qperp * sinf(thetap);
373  }
374 #endif /* __KERNEL_OPTIX__ */
375 }
376 
378 {
379  /* possible optimization: can we avoid doing this altogether and construct
380  * the inverse matrix directly from negated translation, transposed rotation,
381  * scale can be inverted but what about shearing? */
382  Transform R;
383  float det = M.x.x * (M.z.z * M.y.y - M.z.y * M.y.z) - M.y.x * (M.z.z * M.x.y - M.z.y * M.x.z) +
384  M.z.x * (M.y.z * M.x.y - M.y.y * M.x.z);
385  if (det == 0.0f) {
386  M.x.x += 1e-8f;
387  M.y.y += 1e-8f;
388  M.z.z += 1e-8f;
389  det = M.x.x * (M.z.z * M.y.y - M.z.y * M.y.z) - M.y.x * (M.z.z * M.x.y - M.z.y * M.x.z) +
390  M.z.x * (M.y.z * M.x.y - M.y.y * M.x.z);
391  }
392  det = (det != 0.0f) ? 1.0f / det : 0.0f;
393 
394  float3 Rx = det * make_float3(M.z.z * M.y.y - M.z.y * M.y.z,
395  M.z.y * M.x.z - M.z.z * M.x.y,
396  M.y.z * M.x.y - M.y.y * M.x.z);
397  float3 Ry = det * make_float3(M.z.x * M.y.z - M.z.z * M.y.x,
398  M.z.z * M.x.x - M.z.x * M.x.z,
399  M.y.x * M.x.z - M.y.z * M.x.x);
400  float3 Rz = det * make_float3(M.z.y * M.y.x - M.z.x * M.y.y,
401  M.z.x * M.x.y - M.z.y * M.x.x,
402  M.y.y * M.x.x - M.y.x * M.x.y);
403  float3 T = -make_float3(M.x.w, M.y.w, M.z.w);
404 
405  R.x = make_float4(Rx.x, Rx.y, Rx.z, dot(Rx, T));
406  R.y = make_float4(Ry.x, Ry.y, Ry.z, dot(Ry, T));
407  R.z = make_float4(Rz.x, Rz.y, Rz.z, dot(Rz, T));
408 
409  return R;
410 }
411 
413 {
414  /* rotation */
415  float q0, q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc;
416 
417  q0 = M_SQRT2_F * decomp->x.w;
418  q1 = M_SQRT2_F * decomp->x.x;
419  q2 = M_SQRT2_F * decomp->x.y;
420  q3 = M_SQRT2_F * decomp->x.z;
421 
422  qda = q0 * q1;
423  qdb = q0 * q2;
424  qdc = q0 * q3;
425  qaa = q1 * q1;
426  qab = q1 * q2;
427  qac = q1 * q3;
428  qbb = q2 * q2;
429  qbc = q2 * q3;
430  qcc = q3 * q3;
431 
432  float3 rotation_x = make_float3(1.0f - qbb - qcc, -qdc + qab, qdb + qac);
433  float3 rotation_y = make_float3(qdc + qab, 1.0f - qaa - qcc, -qda + qbc);
434  float3 rotation_z = make_float3(-qdb + qac, qda + qbc, 1.0f - qaa - qbb);
435 
436  /* scale */
437  float3 scale_x = make_float3(decomp->y.w, decomp->z.z, decomp->w.y);
438  float3 scale_y = make_float3(decomp->z.x, decomp->z.w, decomp->w.z);
439  float3 scale_z = make_float3(decomp->z.y, decomp->w.x, decomp->w.w);
440 
441  /* compose with translation */
442  tfm->x = make_float4(
443  dot(rotation_x, scale_x), dot(rotation_x, scale_y), dot(rotation_x, scale_z), decomp->y.x);
444  tfm->y = make_float4(
445  dot(rotation_y, scale_x), dot(rotation_y, scale_y), dot(rotation_y, scale_z), decomp->y.y);
446  tfm->z = make_float4(
447  dot(rotation_z, scale_x), dot(rotation_z, scale_y), dot(rotation_z, scale_z), decomp->y.z);
448 }
449 
450 /* Interpolate from array of decomposed transforms. */
452  const ccl_global DecomposedTransform *motion,
453  uint numsteps,
454  float time)
455 {
456  /* Figure out which steps we need to interpolate. */
457  int maxstep = numsteps - 1;
458  int step = min((int)(time * maxstep), maxstep - 1);
459  float t = time * maxstep - step;
460 
461  const ccl_global DecomposedTransform *a = motion + step;
462  const ccl_global DecomposedTransform *b = motion + step + 1;
463 
464  /* Interpolate rotation, translation and scale. */
465  DecomposedTransform decomp;
466  decomp.x = quat_interpolate(a->x, b->x, t);
467  decomp.y = (1.0f - t) * a->y + t * b->y;
468  decomp.z = (1.0f - t) * a->z + t * b->z;
469  decomp.w = (1.0f - t) * a->w + t * b->w;
470 
471  /* Compose rotation, translation, scale into matrix. */
472  transform_compose(tfm, &decomp);
473 }
474 
476 {
477  return isfinite4_safe(tfm->x) && isfinite4_safe(tfm->y) && isfinite4_safe(tfm->z);
478 }
479 
481 {
482  return isfinite4_safe(decomp->x) && isfinite4_safe(decomp->y) && isfinite4_safe(decomp->z) &&
483  isfinite4_safe(decomp->w);
484 }
485 
486 #ifndef __KERNEL_GPU__
487 
488 class BoundBox2D;
489 
491 {
492  return memcmp(&A, &B, sizeof(DecomposedTransform)) == 0;
493 }
494 
495 float4 transform_to_quat(const Transform &tfm);
496 void transform_motion_decompose(DecomposedTransform *decomp, const Transform *motion, size_t size);
498 
499 #endif
500 
501 /* TODO(sergey): This is only for until we've got OpenCL 2.0
502  * on all devices we consider supported. It'll be replaced with
503  * generic address space.
504  */
505 
506 #ifdef __KERNEL_OPENCL__
507 
508 # define OPENCL_TRANSFORM_ADDRSPACE_GLUE(a, b) a##b
509 # define OPENCL_TRANSFORM_ADDRSPACE_DECLARE(function) \
510  ccl_device_inline float3 OPENCL_TRANSFORM_ADDRSPACE_GLUE(function, _addrspace)( \
511  ccl_addr_space const Transform *t, const float3 a) \
512  { \
513  Transform private_tfm = *t; \
514  return function(&private_tfm, a); \
515  }
516 
517 OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_point)
518 OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_direction)
519 OPENCL_TRANSFORM_ADDRSPACE_DECLARE(transform_direction_transposed)
520 
521 # undef OPENCL_TRANSFORM_ADDRSPACE_DECLARE
522 # undef OPENCL_TRANSFORM_ADDRSPACE_GLUE
523 # define transform_point_auto transform_point_addrspace
524 # define transform_direction_auto transform_direction_addrspace
525 # define transform_direction_transposed_auto transform_direction_transposed_addrspace
526 #else
527 # define transform_point_auto transform_point
528 # define transform_direction_auto transform_direction
529 # define transform_direction_transposed_auto transform_direction_transposed
530 #endif
531 
533 
534 #endif /* __UTIL_TRANSFORM_H__ */
unsigned int uint
Definition: BLI_sys_types.h:83
_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 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 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 BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
#define A
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
double time
const char * label
#define sinf(x)
#define cosf(x)
#define ccl_device
#define ccl_device_inline
#define ccl_global
#define CCL_NAMESPACE_END
#define acosf(x)
#define make_float4(x, y, z, w)
#define fabsf(x)
#define make_float3(x, y, z)
#define M
#define T
#define B
#define R
static unsigned c
Definition: RandGen.cpp:97
static unsigned a[3]
Definition: RandGen.cpp:92
params N
const btScalar eps
Definition: poly34.cpp:11
#define min(a, b)
Definition: sort.c:51
float4 operator[](int i) const
float4 & operator[](int i)
float z
Definition: sky_float3.h:35
float y
Definition: sky_float3.h:35
float x
Definition: sky_float3.h:35
__forceinline avxf cross(const avxf &a, const avxf &b)
Definition: util_avxf.h:119
__forceinline const avxf madd(const avxf &a, const avxf &b, const avxf &c)
Ternary Operators.
Definition: util_avxf.h:334
#define M_SQRT2_F
Definition: util_math.h:77
ccl_device_inline float3 float4_to_float3(const float4 a)
Definition: util_math.h:415
ccl_device_inline int clamp(int a, int mn, int mx)
Definition: util_math.h:283
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float len_squared(const float3 a)
ccl_device_inline bool isfinite4_safe(float4 v)
ccl_device_inline float4 zero_float4()
Transform transform_transposed_inverse(const Transform &a)
ccl_device_inline Transform make_transform_frame(float3 N)
ccl_device_inline Transform euler_to_transform(const float3 euler)
ccl_device_inline Transform transform_identity()
ccl_device_inline void print_transform(const char *label, const Transform &t)
Transform transform_inverse(const Transform &a)
ccl_device_inline float3 transform_direction(const Transform *t, const float3 a)
ccl_device_inline Transform transform_empty()
ccl_device_inline Transform transform_rotate(float angle, float3 axis)
ccl_device_inline void transform_set_column(Transform *t, int column, float3 value)
ccl_device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
ccl_device_inline Transform transform_euler(float3 euler)
ccl_device_inline float3 transform_get_column(const Transform *t, int column)
struct DecomposedTransform DecomposedTransform
ccl_device_inline bool transform_negative_scale(const Transform &tfm)
float4 transform_to_quat(const Transform &tfm)
ccl_device_inline bool transform_isfinite_safe(Transform *tfm)
ccl_device_inline Transform make_transform(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l)
CCL_NAMESPACE_BEGIN struct Transform Transform
ccl_device_inline Transform transform_translate(float3 t)
void transform_motion_decompose(DecomposedTransform *decomp, const Transform *motion, size_t size)
ccl_device_inline float3 transform_direction_transposed(const Transform *t, const float3 a)
ccl_device_inline Transform transform_zero()
ccl_device_inline float3 transform_point(const Transform *t, const float3 a)
ccl_device_inline Transform transform_quick_inverse(Transform M)
ccl_device_inline Transform transform_scale(float3 s)
ccl_device_inline bool transform_uniform_scale(const Transform &tfm, float &scale)
ccl_device_inline void transform_compose(Transform *tfm, const DecomposedTransform *decomp)
ccl_device void transform_motion_array_interpolate(Transform *tfm, const ccl_global DecomposedTransform *motion, uint numsteps, float time)
Transform transform_from_viewplane(BoundBox2D &viewplane)
ccl_device_inline bool operator!=(const Transform &A, const Transform &B)
ccl_device_inline bool operator==(const Transform &A, const Transform &B)
ccl_device_inline Transform transform_clear_scale(const Transform &tfm)
ccl_device_inline bool transform_decomposed_isfinite_safe(DecomposedTransform *decomp)
ccl_device_inline Transform operator*(const Transform a, const Transform b)
ccl_device_inline void print_float4(const char *label, const float4 &a)