Blender  V3.3
gpu_immediate_util.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #include <stdio.h>
10 #include <string.h>
11 
12 #include "BLI_math.h"
13 #include "BLI_utildefines.h"
14 
15 #include "GPU_immediate.h"
16 
17 #include "UI_resources.h"
18 
19 static const float cube_coords[8][3] = {
20  {-1, -1, -1},
21  {-1, -1, +1},
22  {-1, +1, -1},
23  {-1, +1, +1},
24  {+1, -1, -1},
25  {+1, -1, +1},
26  {+1, +1, -1},
27  {+1, +1, +1},
28 };
29 static const int cube_quad_index[6][4] = {
30  {0, 1, 3, 2},
31  {0, 2, 6, 4},
32  {0, 4, 5, 1},
33  {1, 5, 7, 3},
34  {2, 3, 7, 6},
35  {4, 6, 7, 5},
36 };
37 static const int cube_line_index[12][2] = {
38  {0, 1},
39  {0, 2},
40  {0, 4},
41  {1, 3},
42  {1, 5},
43  {2, 3},
44  {2, 6},
45  {3, 7},
46  {4, 5},
47  {4, 6},
48  {5, 7},
49  {6, 7},
50 };
51 
52 void immRectf(uint pos, float x1, float y1, float x2, float y2)
53 {
55  immVertex2f(pos, x1, y1);
56  immVertex2f(pos, x2, y1);
57  immVertex2f(pos, x2, y2);
58  immVertex2f(pos, x1, y2);
59  immEnd();
60 }
61 
62 void immRecti(uint pos, int x1, int y1, int x2, int y2)
63 {
65  immVertex2i(pos, x1, y1);
66  immVertex2i(pos, x2, y1);
67  immVertex2i(pos, x2, y2);
68  immVertex2i(pos, x1, y2);
69  immEnd();
70 }
71 
72 void immRectf_fast(uint pos, float x1, float y1, float x2, float y2)
73 {
74  immVertex2f(pos, x1, y1);
75  immVertex2f(pos, x2, y1);
76  immVertex2f(pos, x2, y2);
77 
78  immVertex2f(pos, x1, y1);
79  immVertex2f(pos, x2, y2);
80  immVertex2f(pos, x1, y2);
81 }
82 
84  uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
85 {
87  immVertex2f(pos, x1, y1);
89  immVertex2f(pos, x2, y1);
91  immVertex2f(pos, x2, y2);
92 
94  immVertex2f(pos, x1, y1);
96  immVertex2f(pos, x2, y2);
98  immVertex2f(pos, x1, y2);
99 }
100 
102  uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
103 {
104  immAttr4fv(col, color);
105  immVertex2i(pos, x1, y1);
106  immAttr4fv(col, color);
107  immVertex2i(pos, x2, y1);
108  immAttr4fv(col, color);
109  immVertex2i(pos, x2, y2);
110 
111  immAttr4fv(col, color);
112  immVertex2i(pos, x1, y1);
113  immAttr4fv(col, color);
114  immVertex2i(pos, x2, y2);
115  immAttr4fv(col, color);
116  immVertex2i(pos, x1, y2);
117 }
118 
119 #if 0 /* more complete version in case we want that */
120 void immRecti_complete(int x1, int y1, int x2, int y2, const float color[4])
121 {
123  uint pos = add_attr(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
126  immRecti(pos, x1, y1, x2, y2);
128 }
129 #endif
130 
132 {
133  immUniformColor3ub(((x)&0xFF), (((x) >> 8) & 0xFF), (((x) >> 16) & 0xFF));
134 }
135 
136 static void imm_draw_circle(GPUPrimType prim_type,
137  const uint shdr_pos,
138  float x,
139  float y,
140  float radius_x,
141  float radius_y,
142  int nsegments)
143 {
144  if (prim_type == GPU_PRIM_LINE_LOOP) {
145  /* NOTE(Metal/AMD): For small primitives, line list more efficient than line strip.. */
146  immBegin(GPU_PRIM_LINES, nsegments * 2);
147 
148  immVertex2f(shdr_pos, x + (radius_x * cosf(0.0f)), y + (radius_y * sinf(0.0f)));
149  for (int i = 1; i < nsegments; i++) {
150  const float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
151  immVertex2f(shdr_pos, x + (radius_x * cosf(angle)), y + (radius_y * sinf(angle)));
152  immVertex2f(shdr_pos, x + (radius_x * cosf(angle)), y + (radius_y * sinf(angle)));
153  }
154  immVertex2f(shdr_pos, x + (radius_x * cosf(0.0f)), y + (radius_y * sinf(0.0f)));
155  immEnd();
156  }
157  else {
158  immBegin(prim_type, nsegments);
159  for (int i = 0; i < nsegments; i++) {
160  const float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
161  immVertex2f(shdr_pos, x + (radius_x * cosf(angle)), y + (radius_y * sinf(angle)));
162  }
163  immEnd();
164  }
165 }
166 
167 void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
168 {
169  imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, radius, radius, nsegments);
170 }
171 
172 void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
173 {
174  imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, radius, radius, nsegments);
175 }
176 
178  uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments)
179 {
180  imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, radius_x, radius_y, nsegments);
181 }
183  uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments)
184 {
185  imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, radius_x, radius_y, nsegments);
186 }
187 
188 static void imm_draw_circle_partial(GPUPrimType prim_type,
189  uint pos,
190  float x,
191  float y,
192  float radius,
193  int nsegments,
194  float start,
195  float sweep)
196 {
197  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
198  const float angle_start = -(DEG2RADF(start)) + (float)M_PI_2;
199  const float angle_end = -(DEG2RADF(sweep) - angle_start);
200  nsegments += 1;
201  immBegin(prim_type, nsegments);
202  for (int i = 0; i < nsegments; i++) {
203  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
204  const float angle_sin = sinf(angle);
205  const float angle_cos = cosf(angle);
206  immVertex2f(pos, x + radius * angle_cos, y + radius * angle_sin);
207  }
208  immEnd();
209 }
210 
212  uint pos,
213  float x,
214  float y,
215  float z,
216  float rad,
217  int nsegments,
218  float start,
219  float sweep)
220 {
221  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
222  const float angle_start = -(DEG2RADF(start)) + (float)(M_PI / 2);
223  const float angle_end = -(DEG2RADF(sweep) - angle_start);
224  nsegments += 1;
225  immBegin(prim_type, nsegments);
226  for (int i = 0; i < nsegments; i++) {
227  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
228  const float angle_sin = sinf(angle);
229  const float angle_cos = cosf(angle);
230  immVertex3f(pos, x + rad * angle_cos, y + rad * angle_sin, z);
231  }
232  immEnd();
233 }
234 
236  uint pos, float x, float y, float radius, int nsegments, float start, float sweep)
237 {
238  imm_draw_circle_partial(GPU_PRIM_LINE_STRIP, pos, x, y, radius, nsegments, start, sweep);
239 }
240 
242  uint pos, float x, float y, float z, float rad, int nsegments, float start, float sweep)
243 {
244  imm_draw_circle_partial_3d(GPU_PRIM_LINE_STRIP, pos, x, y, z, rad, nsegments, start, sweep);
245 }
246 
247 static void imm_draw_disk_partial(GPUPrimType prim_type,
248  uint pos,
249  float x,
250  float y,
251  float rad_inner,
252  float rad_outer,
253  int nsegments,
254  float start,
255  float sweep)
256 {
257  /* to avoid artifacts */
258  const float max_angle = 3 * 360;
259  CLAMP(sweep, -max_angle, max_angle);
260 
261  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
262  const float angle_start = -(DEG2RADF(start)) + (float)M_PI_2;
263  const float angle_end = -(DEG2RADF(sweep) - angle_start);
264  nsegments += 1;
265  immBegin(prim_type, nsegments * 2);
266  for (int i = 0; i < nsegments; i++) {
267  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
268  const float angle_sin = sinf(angle);
269  const float angle_cos = cosf(angle);
270  immVertex2f(pos, x + rad_inner * angle_cos, y + rad_inner * angle_sin);
271  immVertex2f(pos, x + rad_outer * angle_cos, y + rad_outer * angle_sin);
272  }
273  immEnd();
274 }
275 
276 static void imm_draw_disk_partial_3d(GPUPrimType prim_type,
277  uint pos,
278  float x,
279  float y,
280  float z,
281  float rad_inner,
282  float rad_outer,
283  int nsegments,
284  float start,
285  float sweep)
286 {
287  /* to avoid artifacts */
288  const float max_angle = 3 * 360;
289  CLAMP(sweep, -max_angle, max_angle);
290 
291  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
292  const float angle_start = -(DEG2RADF(start)) + (float)M_PI_2;
293  const float angle_end = -(DEG2RADF(sweep) - angle_start);
294  nsegments += 1;
295  immBegin(prim_type, nsegments * 2);
296  for (int i = 0; i < nsegments; i++) {
297  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
298  const float angle_sin = sinf(angle);
299  const float angle_cos = cosf(angle);
300  immVertex3f(pos, x + rad_inner * angle_cos, y + rad_inner * angle_sin, z);
301  immVertex3f(pos, x + rad_outer * angle_cos, y + rad_outer * angle_sin, z);
302  }
303  immEnd();
304 }
305 
307  float x,
308  float y,
309  float rad_inner,
310  float rad_outer,
311  int nsegments,
312  float start,
313  float sweep)
314 {
316  GPU_PRIM_TRI_STRIP, pos, x, y, rad_inner, rad_outer, nsegments, start, sweep);
317 }
319  float x,
320  float y,
321  float z,
322  float rad_inner,
323  float rad_outer,
324  int nsegments,
325  float start,
326  float sweep)
327 {
329  GPU_PRIM_TRI_STRIP, pos, x, y, z, rad_inner, rad_outer, nsegments, start, sweep);
330 }
331 
332 static void imm_draw_circle_3D(
333  GPUPrimType prim_type, uint pos, float x, float y, float radius, int nsegments)
334 {
335  if (prim_type == GPU_PRIM_LINE_LOOP) {
336  /* NOTE(Metal/AMD): For small primitives, line list more efficient than line strip. */
337  immBegin(GPU_PRIM_LINES, nsegments * 2);
338 
339  const float angle = (float)(2 * M_PI) / (float)nsegments;
340  float xprev = cosf(-angle) * radius;
341  float yprev = sinf(-angle) * radius;
342  const float alpha = 2.0f * cosf(angle);
343 
344  float xr = radius;
345  float yr = 0;
346 
347  for (int i = 0; i < nsegments; i++) {
348  immVertex3f(pos, x + xr, y + yr, 0.0f);
349  if (i) {
350  immVertex3f(pos, x + xr, y + yr, 0.0f);
351  }
352  const float xnext = alpha * xr - xprev;
353  const float ynext = alpha * yr - yprev;
354  xprev = xr;
355  yprev = yr;
356  xr = xnext;
357  yr = ynext;
358  }
359  immVertex3f(pos, x + radius, y, 0.0f);
360  immEnd();
361  }
362  else {
363  immBegin(prim_type, nsegments);
364  for (int i = 0; i < nsegments; i++) {
365  float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
366  immVertex3f(pos, x + radius * cosf(angle), y + radius * sinf(angle), 0.0f);
367  }
368  immEnd();
369  }
370 }
371 
372 void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments)
373 {
374  imm_draw_circle_3D(GPU_PRIM_LINE_LOOP, pos, x, y, radius, nsegments);
375 }
376 
377 void imm_draw_circle_dashed_3d(uint pos, float x, float y, float radius, int nsegments)
378 {
379  imm_draw_circle_3D(GPU_PRIM_LINES, pos, x, y, radius, nsegments / 2);
380 }
381 
382 void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments)
383 {
384  imm_draw_circle_3D(GPU_PRIM_TRI_FAN, pos, x, y, radius, nsegments);
385 }
386 
387 void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
388 {
389  /* NOTE(Metal/AMD): For small primitives, line list more efficient than line-strip. */
391  immVertex2f(pos, x1, y1);
392  immVertex2f(pos, x1, y2);
393 
394  immVertex2f(pos, x1, y2);
395  immVertex2f(pos, x2, y2);
396 
397  immVertex2f(pos, x2, y2);
398  immVertex2f(pos, x2, y1);
399 
400  immVertex2f(pos, x2, y1);
401  immVertex2f(pos, x1, y1);
402  immEnd();
403 }
404 
405 void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2)
406 {
407  /* use this version when GPUVertFormat has a vec3 position */
408  /* NOTE(Metal/AMD): For small primitives, line list more efficient than line-strip. */
410  immVertex3f(pos, x1, y1, 0.0f);
411  immVertex3f(pos, x1, y2, 0.0f);
412 
413  immVertex3f(pos, x1, y2, 0.0f);
414  immVertex3f(pos, x2, y2, 0.0f);
415 
416  immVertex3f(pos, x2, y2, 0.0f);
417  immVertex3f(pos, x2, y1, 0.0f);
418 
419  immVertex3f(pos, x2, y1, 0.0f);
420  immVertex3f(pos, x1, y1, 0.0f);
421  immEnd();
422 }
423 
425  float y1,
426  float x2,
427  float y2,
428  const float color_primary[4],
429  const float color_secondary[4],
430  int checker_size)
431 {
433 
435 
436  immUniform4fv("color1", color_primary);
437  immUniform4fv("color2", color_secondary);
438  immUniform1i("size", checker_size);
439 
440  immRectf(pos, x1, y1, x2, y2);
441 
443 }
444 void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2)
445 {
446  float checker_primary[4];
447  float checker_secondary[4];
450  int checker_size = UI_GetThemeValue(TH_TRANSPARENT_CHECKER_SIZE);
451  imm_draw_box_checker_2d_ex(x1, y1, x2, y2, checker_primary, checker_secondary, checker_size);
452 }
453 
454 void imm_draw_cube_fill_3d(uint pos, const float center[3], const float aspect[3])
455 {
456  float coords[ARRAY_SIZE(cube_coords)][3];
457 
458  for (int i = 0; i < ARRAY_SIZE(cube_coords); i++) {
459  madd_v3_v3v3v3(coords[i], center, cube_coords[i], aspect);
460  }
461 
463  for (int i = 0; i < ARRAY_SIZE(cube_quad_index); i++) {
464  immVertex3fv(pos, coords[cube_quad_index[i][0]]);
465  immVertex3fv(pos, coords[cube_quad_index[i][1]]);
466  immVertex3fv(pos, coords[cube_quad_index[i][2]]);
467 
468  immVertex3fv(pos, coords[cube_quad_index[i][0]]);
469  immVertex3fv(pos, coords[cube_quad_index[i][2]]);
470  immVertex3fv(pos, coords[cube_quad_index[i][3]]);
471  }
472  immEnd();
473 }
474 
475 void imm_draw_cube_wire_3d(uint pos, const float center[3], const float aspect[3])
476 {
477  float coords[ARRAY_SIZE(cube_coords)][3];
478 
479  for (int i = 0; i < ARRAY_SIZE(cube_coords); i++) {
480  madd_v3_v3v3v3(coords[i], center, cube_coords[i], aspect);
481  }
482 
484  for (int i = 0; i < ARRAY_SIZE(cube_line_index); i++) {
485  immVertex3fv(pos, coords[cube_line_index[i][0]]);
486  immVertex3fv(pos, coords[cube_line_index[i][1]]);
487  }
488  immEnd();
489 }
490 
492  const float center[3],
493  const float aspect[3],
494  const float factor)
495 {
496  float coords[ARRAY_SIZE(cube_coords)][3];
497 
498  for (int i = 0; i < ARRAY_SIZE(cube_coords); i++) {
499  madd_v3_v3v3v3(coords[i], center, cube_coords[i], aspect);
500  }
501 
503  for (int i = 0; i < ARRAY_SIZE(cube_line_index); i++) {
504  float vec[3], co[3];
505  sub_v3_v3v3(vec, coords[cube_line_index[i][1]], coords[cube_line_index[i][0]]);
506  mul_v3_fl(vec, factor);
507 
508  copy_v3_v3(co, coords[cube_line_index[i][0]]);
509  immVertex3fv(pos, co);
510  add_v3_v3(co, vec);
511  immVertex3fv(pos, co);
512 
513  copy_v3_v3(co, coords[cube_line_index[i][1]]);
514  immVertex3fv(pos, co);
515  sub_v3_v3(co, vec);
516  immVertex3fv(pos, co);
517  }
518  immEnd();
519 }
520 
522  uint pos, uint nor, float base, float top, float height, int slices, int stacks)
523 {
524  immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
525  for (int i = 0; i < slices; i++) {
526  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
527  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
528  const float cos1 = cosf(angle1);
529  const float sin1 = sinf(angle1);
530  const float cos2 = cosf(angle2);
531  const float sin2 = sinf(angle2);
532 
533  for (int j = 0; j < stacks; j++) {
534  float fac1 = (float)j / (float)stacks;
535  float fac2 = (float)(j + 1) / (float)stacks;
536  float r1 = base * (1.0f - fac1) + top * fac1;
537  float r2 = base * (1.0f - fac2) + top * fac2;
538  float h1 = height * ((float)j / (float)stacks);
539  float h2 = height * ((float)(j + 1) / (float)stacks);
540 
541  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
542  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
543  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
544  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
545  float n1[3], n2[3];
546 
547  /* calc normals */
548  sub_v3_v3v3(n1, v2, v1);
549  normalize_v3(n1);
550  n1[0] = cos1;
551  n1[1] = sin1;
552  n1[2] = 1 - n1[2];
553 
554  sub_v3_v3v3(n2, v3, v4);
555  normalize_v3(n2);
556  n2[0] = cos2;
557  n2[1] = sin2;
558  n2[2] = 1 - n2[2];
559 
560  /* first tri */
561  immAttr3fv(nor, n2);
562  immVertex3fv(pos, v1);
563  immVertex3fv(pos, v2);
564  immAttr3fv(nor, n1);
565  immVertex3fv(pos, v3);
566 
567  /* second tri */
568  immVertex3fv(pos, v3);
569  immVertex3fv(pos, v4);
570  immAttr3fv(nor, n2);
571  immVertex3fv(pos, v1);
572  }
573  }
574  immEnd();
575 }
576 
578  uint pos, float base, float top, float height, int slices, int stacks)
579 {
580  immBegin(GPU_PRIM_LINES, 6 * slices * stacks);
581  for (int i = 0; i < slices; i++) {
582  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
583  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
584  const float cos1 = cosf(angle1);
585  const float sin1 = sinf(angle1);
586  const float cos2 = cosf(angle2);
587  const float sin2 = sinf(angle2);
588 
589  for (int j = 0; j < stacks; j++) {
590  float fac1 = (float)j / (float)stacks;
591  float fac2 = (float)(j + 1) / (float)stacks;
592  float r1 = base * (1.0f - fac1) + top * fac1;
593  float r2 = base * (1.0f - fac2) + top * fac2;
594  float h1 = height * ((float)j / (float)stacks);
595  float h2 = height * ((float)(j + 1) / (float)stacks);
596 
597  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
598  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
599  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
600  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
601 
602  immVertex3fv(pos, v1);
603  immVertex3fv(pos, v2);
604 
605  immVertex3fv(pos, v2);
606  immVertex3fv(pos, v3);
607 
608  immVertex3fv(pos, v1);
609  immVertex3fv(pos, v4);
610  }
611  }
612  immEnd();
613 }
614 
616  uint pos, float base, float top, float height, int slices, int stacks)
617 {
618  immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
619  for (int i = 0; i < slices; i++) {
620  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
621  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
622  const float cos1 = cosf(angle1);
623  const float sin1 = sinf(angle1);
624  const float cos2 = cosf(angle2);
625  const float sin2 = sinf(angle2);
626 
627  for (int j = 0; j < stacks; j++) {
628  float fac1 = (float)j / (float)stacks;
629  float fac2 = (float)(j + 1) / (float)stacks;
630  float r1 = base * (1.0f - fac1) + top * fac1;
631  float r2 = base * (1.0f - fac2) + top * fac2;
632  float h1 = height * ((float)j / (float)stacks);
633  float h2 = height * ((float)(j + 1) / (float)stacks);
634 
635  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
636  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
637  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
638  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
639 
640  /* first tri */
641  immVertex3fv(pos, v1);
642  immVertex3fv(pos, v2);
643  immVertex3fv(pos, v3);
644 
645  /* second tri */
646  immVertex3fv(pos, v3);
647  immVertex3fv(pos, v4);
648  immVertex3fv(pos, v1);
649  }
650  }
651  immEnd();
652 }
653 
654 /* Circle Drawing - Tables for Optimized Drawing Speed */
655 #define CIRCLE_RESOL 32
656 
657 static void circball_array_fill(const float verts[CIRCLE_RESOL][3],
658  const float cent[3],
659  const float radius,
660  const float tmat[4][4])
661 {
662  /* 32 values of sin function (still same result!) */
663  const float sinval[CIRCLE_RESOL] = {
664  0.00000000, 0.20129852, 0.39435585, 0.57126821, 0.72479278, 0.84864425, 0.93775213,
665  0.98846832, 0.99871650, 0.96807711, 0.89780453, 0.79077573, 0.65137248, 0.48530196,
666  0.29936312, 0.10116832, -0.10116832, -0.29936312, -0.48530196, -0.65137248, -0.79077573,
667  -0.89780453, -0.96807711, -0.99871650, -0.98846832, -0.93775213, -0.84864425, -0.72479278,
668  -0.57126821, -0.39435585, -0.20129852, 0.00000000,
669  };
670 
671  /* 32 values of cos function (still same result!) */
672  const float cosval[CIRCLE_RESOL] = {
673  1.00000000, 0.97952994, 0.91895781, 0.82076344, 0.68896691, 0.52896401, 0.34730525,
674  0.15142777, -0.05064916, -0.25065253, -0.44039415, -0.61210598, -0.75875812, -0.87434661,
675  -0.95413925, -0.99486932, -0.99486932, -0.95413925, -0.87434661, -0.75875812, -0.61210598,
676  -0.44039415, -0.25065253, -0.05064916, 0.15142777, 0.34730525, 0.52896401, 0.68896691,
677  0.82076344, 0.91895781, 0.97952994, 1.00000000,
678  };
679 
680  float vx[3], vy[3];
681  float *viter = (float *)verts;
682 
683  mul_v3_v3fl(vx, tmat[0], radius);
684  mul_v3_v3fl(vy, tmat[1], radius);
685 
686  for (uint a = 0; a < CIRCLE_RESOL; a++, viter += 3) {
687  viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
688  viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
689  viter[2] = cent[2] + sinval[a] * vx[2] + cosval[a] * vy[2];
690  }
691 }
692 
693 void imm_drawcircball(const float cent[3], float radius, const float tmat[4][4], uint pos)
694 {
695  float verts[CIRCLE_RESOL][3];
696 
697  circball_array_fill(verts, cent, radius, tmat);
698 
700  for (int i = 0; i < CIRCLE_RESOL; i++) {
701  immVertex3fv(pos, verts[i]);
702  }
703  immEnd();
704 }
typedef float(TangentPoint)[2]
#define M_PI_2
Definition: BLI_math_base.h:23
MINLINE float interpf(float a, float b, float t)
#define M_PI
Definition: BLI_math_base.h:20
#define DEG2RADF(_deg)
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
unsigned int uint
Definition: BLI_sys_types.h:67
#define ARRAY_SIZE(arr)
NSNotificationCenter * center
void immAttr4fv(uint attr_id, const float data[4])
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immVertex3f(uint attr_id, float x, float y, float z)
void immUniform1i(const char *name, int x)
void immVertex2i(uint attr_id, int x, int y)
void immUniformColor4fv(const float rgba[4])
GPUVertFormat * immVertexFormat(void)
void immUniform4fv(const char *name, const float data[4])
void immAttr3fv(uint attr_id, const float data[3])
void immVertex3fv(uint attr_id, const float data[3])
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
_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 y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 x2
_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 top
_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
GPUPrimType
Definition: GPU_primitive.h:18
@ GPU_PRIM_TRI_FAN
Definition: GPU_primitive.h:25
@ GPU_PRIM_LINE_LOOP
Definition: GPU_primitive.h:23
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_PRIM_LINE_STRIP
Definition: GPU_primitive.h:22
@ GPU_PRIM_TRI_STRIP
Definition: GPU_primitive.h:24
@ GPU_PRIM_TRIS
Definition: GPU_primitive.h:21
@ GPU_SHADER_2D_CHECKER
Definition: GPU_shader.h:221
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_I32
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ TH_TRANSPARENT_CHECKER_PRIMARY
Definition: UI_resources.h:296
@ TH_TRANSPARENT_CHECKER_SECONDARY
Definition: UI_resources.h:297
@ TH_TRANSPARENT_CHECKER_SIZE
Definition: UI_resources.h:298
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1173
int UI_GetThemeValue(int colorid)
Definition: resources.c:1147
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define sinf(x)
Definition: cuda/compat.h:102
#define cosf(x)
Definition: cuda/compat.h:101
static float verts[][3]
uint pos
uint nor
uint col
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2)
void imm_draw_cylinder_wire_3d(uint pos, float base, float top, float height, int slices, int stacks)
static void circball_array_fill(const float verts[CIRCLE_RESOL][3], const float cent[3], const float radius, const float tmat[4][4])
void imm_draw_disk_partial_fill_3d(uint pos, float x, float y, float z, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
static void imm_draw_disk_partial_3d(GPUPrimType prim_type, uint pos, float x, float y, float z, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void imm_draw_cylinder_fill_3d(uint pos, float base, float top, float height, int slices, int stacks)
void imm_draw_circle_partial_wire_2d(uint pos, float x, float y, float radius, int nsegments, float start, float sweep)
void imm_draw_cylinder_fill_normal_3d(uint pos, uint nor, float base, float top, float height, int slices, int stacks)
void imm_draw_box_checker_2d_ex(float x1, float y1, float x2, float y2, const float color_primary[4], const float color_secondary[4], int checker_size)
static void imm_draw_disk_partial(GPUPrimType prim_type, uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
void imm_draw_circle_fill_aspect_2d(uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments)
void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments)
void imm_draw_circle_dashed_3d(uint pos, float x, float y, float radius, int nsegments)
void imm_drawcircball(const float cent[3], float radius, const float tmat[4][4], uint pos)
void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments)
void immRectf_fast(uint pos, float x1, float y1, float x2, float y2)
void immRecti(uint pos, int x1, int y1, int x2, int y2)
static const int cube_quad_index[6][4]
void imm_draw_circle_wire_aspect_2d(uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments)
void immRectf_fast_with_color(uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
static void imm_draw_circle_partial(GPUPrimType prim_type, uint pos, float x, float y, float radius, int nsegments, float start, float sweep)
void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2)
#define CIRCLE_RESOL
void immRectf(uint pos, float x1, float y1, float x2, float y2)
static void imm_draw_circle_partial_3d(GPUPrimType prim_type, uint pos, float x, float y, float z, float rad, int nsegments, float start, float sweep)
static const float cube_coords[8][3]
static const int cube_line_index[12][2]
void imm_draw_cube_corners_3d(uint pos, const float center[3], const float aspect[3], const float factor)
void imm_draw_cube_wire_3d(uint pos, const float center[3], const float aspect[3])
void imm_draw_cube_fill_3d(uint pos, const float center[3], const float aspect[3])
void imm_cpack(uint x)
void imm_draw_disk_partial_fill_2d(uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
static void imm_draw_circle_3D(GPUPrimType prim_type, uint pos, float x, float y, float radius, int nsegments)
void immRecti_fast_with_color(uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
static void imm_draw_circle(GPUPrimType prim_type, const uint shdr_pos, float x, float y, float radius_x, float radius_y, int nsegments)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void imm_draw_circle_partial_wire_3d(uint pos, float x, float y, float z, float rad, int nsegments, float start, float sweep)
format
Definition: logImageCore.h:38
static unsigned a[3]
Definition: RandGen.cpp:78