86 uint pos,
uint col,
float x1,
float y1,
float x2,
float y2,
const float color[4])
104 uint pos,
uint col,
int x1,
int y1,
int x2,
int y2,
const float color[4])
122void immRecti_complete(
int x1,
int y1,
int x2,
int y2,
const float color[4])
151 for (
int i = 1; i < nsegments; i++) {
161 for (
int i = 0; i < nsegments; i++) {
180 uint shdr_pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
186 uint shdr_pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
202 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
205 for (
int i = 0; i < nsegments; i++) {
206 const float angle =
interpf(angle_start, angle_end, (
float(i) /
float(nsegments - 1)));
207 const float angle_sin =
sinf(angle);
208 const float angle_cos =
cosf(angle);
226 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
229 for (
int i = 0; i < nsegments; i++) {
230 const float angle =
interpf(angle_start, angle_end, (
float(i) /
float(nsegments - 1)));
231 const float angle_sin =
sinf(angle);
232 const float angle_cos =
cosf(angle);
239 uint pos,
float x,
float y,
float radius,
int nsegments,
float start,
float sweep)
245 uint pos,
float x,
float y,
float z,
float radius,
int nsegments,
float start,
float sweep)
261 const float max_angle = 3 * 360;
262 CLAMP(sweep, -max_angle, max_angle);
266 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
269 for (
int i = 0; i < nsegments; i++) {
270 const float angle =
interpf(angle_start, angle_end, (
float(i) /
float(nsegments - 1)));
271 const float angle_sin =
sinf(angle);
272 const float angle_cos =
cosf(angle);
273 immVertex2f(
pos, x + rad_inner * angle_cos, y + rad_inner * angle_sin);
274 immVertex2f(
pos, x + rad_outer * angle_cos, y + rad_outer * angle_sin);
291 const float max_angle = 3 * 360;
292 CLAMP(sweep, -max_angle, max_angle);
296 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
299 for (
int i = 0; i < nsegments; i++) {
300 const float angle =
interpf(angle_start, angle_end, (
float(i) /
float(nsegments - 1)));
301 const float angle_sin =
sinf(angle);
302 const float angle_cos =
cosf(angle);
303 immVertex3f(
pos, x + rad_inner * angle_cos, y + rad_inner * angle_sin,
z);
304 immVertex3f(
pos, x + rad_outer * angle_cos, y + rad_outer * angle_sin,
z);
348 float xprev =
cosf(-angle) * radius_x;
349 float yprev =
sinf(-angle) * radius_y;
350 const float alpha = 2.0f *
cosf(angle);
355 for (
int i = 0; i < nsegments; i++) {
361 const float xnext = alpha * xr - xprev;
363 const float ynext = alpha * yr - yprev;
374 for (
int i = 0; i < nsegments; i++) {
388 uint pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
404 uint pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
450 const float color_primary[4],
451 const float color_secondary[4],
468 float checker_primary[4];
469 float checker_secondary[4];
514 const float center[3],
515 const float aspect[3],
544 uint pos,
uint nor,
float base,
float top,
float height,
int slices,
int stacks)
547 for (
int i = 0; i < slices; i++) {
550 const float cos1 =
cosf(angle1);
551 const float sin1 =
sinf(angle1);
552 const float cos2 =
cosf(angle2);
553 const float sin2 =
sinf(angle2);
555 for (
int j = 0; j < stacks; j++) {
558 float r1 = base * (1.0f - fac1) + top * fac1;
559 float r2 = base * (1.0f - fac2) + top * fac2;
560 float h1 = height * (
float(j) /
float(stacks));
561 float h2 = height * (
float(j + 1) /
float(stacks));
563 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
564 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
565 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
566 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
600 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
603 for (
int i = 0; i < slices; i++) {
606 const float cos1 =
cosf(angle1);
607 const float sin1 =
sinf(angle1);
608 const float cos2 =
cosf(angle2);
609 const float sin2 =
sinf(angle2);
611 for (
int j = 0; j < stacks; j++) {
614 float r1 = base * (1.0f - fac1) + top * fac1;
615 float r2 = base * (1.0f - fac2) + top * fac2;
616 float h1 = height * (
float(j) /
float(stacks));
617 float h2 = height * (
float(j + 1) /
float(stacks));
619 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
620 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
621 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
622 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
638 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
641 for (
int i = 0; i < slices; i++) {
644 const float cos1 =
cosf(angle1);
645 const float sin1 =
sinf(angle1);
646 const float cos2 =
cosf(angle2);
647 const float sin2 =
sinf(angle2);
649 for (
int j = 0; j < stacks; j++) {
652 float r1 = base * (1.0f - fac1) + top * fac1;
653 float r2 = base * (1.0f - fac2) + top * fac2;
654 float h1 = height * (
float(j) /
float(stacks));
655 float h2 = height * (
float(j + 1) /
float(stacks));
657 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
658 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
659 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
660 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
677#define CIRCLE_RESOL 32
682 const float tmat[4][4])
686 0.00000000, 0.20129852, 0.39435585, 0.57126821, 0.72479278, 0.84864425, 0.93775213,
687 0.98846832, 0.99871650, 0.96807711, 0.89780453, 0.79077573, 0.65137248, 0.48530196,
688 0.29936312, 0.10116832, -0.10116832, -0.29936312, -0.48530196, -0.65137248, -0.79077573,
689 -0.89780453, -0.96807711, -0.99871650, -0.98846832, -0.93775213, -0.84864425, -0.72479278,
690 -0.57126821, -0.39435585, -0.20129852, 0.00000000,
695 1.00000000, 0.97952994, 0.91895781, 0.82076344, 0.68896691, 0.52896401, 0.34730525,
696 0.15142777, -0.05064916, -0.25065253, -0.44039415, -0.61210598, -0.75875812, -0.87434661,
697 -0.95413925, -0.99486932, -0.99486932, -0.95413925, -0.87434661, -0.75875812, -0.61210598,
698 -0.44039415, -0.25065253, -0.05064916, 0.15142777, 0.34730525, 0.52896401, 0.68896691,
699 0.82076344, 0.91895781, 0.97952994, 1.00000000,
703 float *viter = (
float *)
verts;
709 viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
710 viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
711 viter[2] = cent[2] + sinval[a] * vx[2] + cosval[a] * vy[2];
MINLINE float interpf(float target, float origin, float t)
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[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])
MINLINE float normalize_v3(float n[3])
@ GPU_SHADER_3D_UNIFORM_COLOR
@ TH_TRANSPARENT_CHECKER_PRIMARY
@ TH_TRANSPARENT_CHECKER_SECONDARY
@ TH_TRANSPARENT_CHECKER_SIZE
void UI_GetThemeColor4fv(int colorid, float col[4])
int UI_GetThemeValue(int colorid)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
draw_view in_light_buf[] float
Frequency::GEOMETRY nor[]