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])
171 for (
int i = 1;
i < nsegments;
i++) {
172 const float angle = float(2 *
M_PI) * (float(
i) / float(nsegments));
181 for (
int i = 0;
i < nsegments;
i++) {
182 const float angle = float(2 *
M_PI) * (float(
i) / float(nsegments));
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)));
245 const float angle_start = -
DEG2RADF(start) + float(
M_PI / 2);
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)));
367 const float angle = float(2 *
M_PI) / float(nsegments);
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++) {
395 float angle = float(2 *
M_PI) * (float(
i) / float(nsegments));
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],
488 float checker_primary[4];
489 float checker_secondary[4];
534 const float center[3],
535 const float aspect[3],
567 for (
int i = 0;
i < slices;
i++) {
568 const float angle1 = float(2 *
M_PI) * (float(
i) / float(slices));
569 const float angle2 = float(2 *
M_PI) * (float(
i + 1) / float(slices));
570 const float cos1 =
cosf(angle1);
571 const float sin1 =
sinf(angle1);
572 const float cos2 =
cosf(angle2);
573 const float sin2 =
sinf(angle2);
575 for (
int j = 0; j < stacks; j++) {
576 float fac1 = float(j) / float(stacks);
577 float fac2 = float(j + 1) / float(stacks);
578 float r1 = base * (1.0f - fac1) +
top * fac1;
579 float r2 = base * (1.0f - fac2) +
top * fac2;
580 float h1 = height * (float(j) / float(stacks));
581 float h2 = height * (float(j + 1) / float(stacks));
583 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
584 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
585 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
586 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
620 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
623 for (
int i = 0;
i < slices;
i++) {
624 const float angle1 = float(2 *
M_PI) * (float(
i) / float(slices));
625 const float angle2 = float(2 *
M_PI) * (float(
i + 1) / float(slices));
626 const float cos1 =
cosf(angle1);
627 const float sin1 =
sinf(angle1);
628 const float cos2 =
cosf(angle2);
629 const float sin2 =
sinf(angle2);
631 for (
int j = 0; j < stacks; j++) {
632 float fac1 = float(j) / float(stacks);
633 float fac2 = float(j + 1) / float(stacks);
634 float r1 = base * (1.0f - fac1) +
top * fac1;
635 float r2 = base * (1.0f - fac2) +
top * fac2;
636 float h1 = height * (float(j) / float(stacks));
637 float h2 = height * (float(j + 1) / float(stacks));
639 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
640 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
641 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
642 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
658 uint pos,
float base,
float top,
float height,
int slices,
int stacks)
661 for (
int i = 0;
i < slices;
i++) {
662 const float angle1 = float(2 *
M_PI) * (float(
i) / float(slices));
663 const float angle2 = float(2 *
M_PI) * (float(
i + 1) / float(slices));
664 const float cos1 =
cosf(angle1);
665 const float sin1 =
sinf(angle1);
666 const float cos2 =
cosf(angle2);
667 const float sin2 =
sinf(angle2);
669 for (
int j = 0; j < stacks; j++) {
670 float fac1 = float(j) / float(stacks);
671 float fac2 = float(j + 1) / float(stacks);
672 float r1 = base * (1.0f - fac1) +
top * fac1;
673 float r2 = base * (1.0f - fac2) +
top * fac2;
674 float h1 = height * (float(j) / float(stacks));
675 float h2 = height * (float(j + 1) / float(stacks));
677 const float v1[3] = {r1 * cos2, r1 * sin2, h1};
678 const float v2[3] = {r2 * cos2, r2 * sin2, h2};
679 const float v3[3] = {r2 * cos1, r2 * sin1, h2};
680 const float v4[3] = {r1 * cos1, r1 * sin1, h1};
702 const float tmat[4][4])
706 0.00000000, 0.20129852, 0.39435585, 0.57126821, 0.72479278, 0.84864425, 0.93775213,
707 0.98846832, 0.99871650, 0.96807711, 0.89780453, 0.79077573, 0.65137248, 0.48530196,
708 0.29936312, 0.10116832, -0.10116832, -0.29936312, -0.48530196, -0.65137248, -0.79077573,
709 -0.89780453, -0.96807711, -0.99871650, -0.98846832, -0.93775213, -0.84864425, -0.72479278,
710 -0.57126821, -0.39435585, -0.20129852, 0.00000000,
715 1.00000000, 0.97952994, 0.91895781, 0.82076344, 0.68896691, 0.52896401, 0.34730525,
716 0.15142777, -0.05064916, -0.25065253, -0.44039415, -0.61210598, -0.75875812, -0.87434661,
717 -0.95413925, -0.99486932, -0.99486932, -0.95413925, -0.87434661, -0.75875812, -0.61210598,
718 -0.44039415, -0.25065253, -0.05064916, 0.15142777, 0.34730525, 0.52896401, 0.68896691,
719 0.82076344, 0.91895781, 0.97952994, 1.00000000,
723 float *viter = (
float *)
verts;
729 viter[0] = cent[0] + sinval[a] * vx[0] + cosval[a] * vy[0];
730 viter[1] = cent[1] + sinval[a] * vx[1] + cosval[a] * vy[1];
731 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.