89 uint pos,
uint col,
float x1,
float y1,
float x2,
float y2,
const float color[4])
107 uint pos,
uint col,
int x1,
int y1,
int x2,
int y2,
const float color[4])
142void immRecti_complete(
int x1,
int y1,
int x2,
int y2,
const float color[4])
145 uint pos = add_attr(
format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
171 for (
int i = 1;
i < nsegments;
i++) {
181 for (
int i = 0;
i < nsegments;
i++) {
200 uint shdr_pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
206 uint shdr_pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
222 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
225 for (
int i = 0;
i < nsegments;
i++) {
226 const float angle =
interpf(angle_start, angle_end, (
float(
i) /
float(nsegments - 1)));
246 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
249 for (
int i = 0;
i < nsegments;
i++) {
250 const float angle =
interpf(angle_start, angle_end, (
float(
i) /
float(nsegments - 1)));
259 uint pos,
float x,
float y,
float radius,
int nsegments,
float start,
float sweep)
265 uint pos,
float x,
float y,
float z,
float radius,
int nsegments,
float start,
float sweep)
281 const float max_angle = 3 * 360;
282 CLAMP(sweep, -max_angle, max_angle);
286 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
289 for (
int i = 0;
i < nsegments;
i++) {
290 const float angle =
interpf(angle_start, angle_end, (
float(
i) /
float(nsegments - 1)));
311 const float max_angle = 3 * 360;
312 CLAMP(sweep, -max_angle, max_angle);
316 const float angle_end = -(
DEG2RADF(sweep) - angle_start);
319 for (
int i = 0;
i < nsegments;
i++) {
320 const float angle =
interpf(angle_start, angle_end, (
float(
i) /
float(nsegments - 1)));
375 for (
int i = 0;
i < nsegments;
i++) {
381 const float xnext = alpha * xr - xprev;
383 const float ynext = alpha * yr - yprev;
394 for (
int i = 0;
i < nsegments;
i++) {
408 uint pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
424 uint pos,
float x,
float y,
float radius_x,
float radius_y,
int nsegments)
470 const float color_primary[4],
471 const float color_secondary[4],
489 float checker_primary[4];
490 float checker_secondary[4];
493 checker_primary[3] = clear_alpha ? 0.0 : checker_primary[3];
494 checker_secondary[3] = clear_alpha ? 0.0 : checker_secondary[3];
537 const float center[3],
538 const float aspect[3],
570 for (
int i = 0;
i < slices;
i++) {
573 const float cos1 =
cosf(angle1);
574 const float sin1 =
sinf(angle1);
575 const float cos2 =
cosf(angle2);
576 const float sin2 =
sinf(angle2);
578 for (
int j = 0; j < stacks; j++) {
581 float r1 = base * (1.0f - fac1) +
top * fac1;
582 float r2 = base * (1.0f - fac2) +
top * fac2;
583 float h1 = height * (
float(j) /
float(stacks));
584 float h2 = height * (
float(j + 1) /
float(stacks));
586 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
587 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
588 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
589 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
623 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
626 for (
int i = 0;
i < slices;
i++) {
629 const float cos1 =
cosf(angle1);
630 const float sin1 =
sinf(angle1);
631 const float cos2 =
cosf(angle2);
632 const float sin2 =
sinf(angle2);
634 for (
int j = 0; j < stacks; j++) {
637 float r1 = base * (1.0f - fac1) +
top * fac1;
638 float r2 = base * (1.0f - fac2) +
top * fac2;
639 float h1 = height * (
float(j) /
float(stacks));
640 float h2 = height * (
float(j + 1) /
float(stacks));
642 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
643 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
644 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
645 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
661 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
664 for (
int i = 0;
i < slices;
i++) {
667 const float cos1 =
cosf(angle1);
668 const float sin1 =
sinf(angle1);
669 const float cos2 =
cosf(angle2);
670 const float sin2 =
sinf(angle2);
672 for (
int j = 0; j < stacks; j++) {
675 float r1 = base * (1.0f - fac1) +
top * fac1;
676 float r2 = base * (1.0f - fac2) +
top * fac2;
677 float h1 = height * (
float(j) /
float(stacks));
678 float h2 = height * (
float(j + 1) /
float(stacks));
680 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
681 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
682 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
683 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
705 const float tmat[4][4])
709 0.00000000, 0.20129852, 0.39435585, 0.57126821, 0.72479278, 0.84864425, 0.93775213,
710 0.98846832, 0.99871650, 0.96807711, 0.89780453, 0.79077573, 0.65137248, 0.48530196,
711 0.29936312, 0.10116832, -0.10116832, -0.29936312, -0.48530196, -0.65137248, -0.79077573,
712 -0.89780453, -0.96807711, -0.99871650, -0.98846832, -0.93775213, -0.84864425, -0.72479278,
713 -0.57126821, -0.39435585, -0.20129852, 0.00000000,
718 1.00000000, 0.97952994, 0.91895781, 0.82076344, 0.68896691, 0.52896401, 0.34730525,
719 0.15142777, -0.05064916, -0.25065253, -0.44039415, -0.61210598, -0.75875812, -0.87434661,
720 -0.95413925, -0.99486932, -0.99486932, -0.95413925, -0.87434661, -0.75875812, -0.61210598,
721 -0.44039415, -0.25065253, -0.05064916, 0.15142777, 0.34730525, 0.52896401, 0.68896691,
722 0.82076344, 0.91895781, 0.97952994, 1.00000000,
726 float *viter = (
float *)
verts;
732 viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
733 viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
734 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
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
@ 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.