106 r_dist_range[0] = v3d->
grid * 0.001f;
107 r_dist_range[1] = v3d->
clip_end * 10.0f;
115 const bool use_ortho_factor)
122 if (use_ortho_factor &&
params.is_ortho) {
123 const float fac = 2.0f / (
params.clip_end -
params.clip_start);
129 *r_clipsta =
params.clip_start;
132 *r_clipend =
params.clip_end;
155 *r_viewplane =
params.viewplane;
158 *r_clip_start =
params.clip_start;
161 *r_clip_end =
params.clip_end;
164 *r_pixsize =
params.viewdx;
188 printf(
"view3d_region_operator_needs_opengl error, wrong region\n");
205 float viewdist = rv3d->
dist;
234 if (region ==
NULL) {
255 for (
int val = 0; val < 4; val++) {
269 memset(bb->
vec, 0,
sizeof(bb->
vec));
273 for (
int val = 0; val < 4; val++) {
286 for (
int val = 0; val < 8; val++) {
320 float planes[6 + 6][4];
323 for (
int i = 0; i < 3; i++) {
324 float *plane_min = planes[(i * 2) + 0];
325 float *plane_max = planes[(i * 2) + 1];
328 plane_min[i] = -1.0f;
329 plane_min[3] = +
min[i];
330 plane_max[i] = +1.0f;
331 plane_max[3] = -
max[i];
337 for (
int i = 0; i < clip_len; i++) {
346 const float eps_coplanar = 1e-4f;
347 const float eps_isect = 1e-6f;
365 int a, flag = -1, fl;
367 for (
a = 0;
a < 8;
a++) {
408 float persmatob[4][4];
514 const float camzoom_init = rv3d->
camzoom;
518 zoomfac = zoomfac * scale;
522 return (rv3d->
camzoom != camzoom_init);
528 const float camdxy_init[2] = {rv3d->
camdx, rv3d->
camdy};
530 rv3d->
camdx += event_ofs[0] / (region->
winx * zoomfac);
531 rv3d->
camdy += event_ofs[1] / (region->
winy * zoomfac);
534 return (camdxy_init[0] != rv3d->
camdx) || (camdxy_init[1] != rv3d->
camdy);
554 const bool calc_dist)
583 float view_mat[4][4];
584 float diff_mat[4][4];
585 float parent_mat[4][4];
587 while (root_parent->
parent) {
588 root_parent = root_parent->
parent;
610 ob_update = ob_update->
parent;
633 const bool do_rotate,
634 const bool do_translate)
668 const bool do_rotate,
669 const bool do_translate)
678 while (root_parent->
parent) {
679 root_parent = root_parent->
parent;
681 id_key = &root_parent->
id;
751 float x1 = 0.0f,
y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
760 if (region->winx > region->winy) {
764 x1 = region->winx * rv3d->
dist / region->winy;
767 if (region->winx > region->winy) {
768 y1 = region->winy * rv3d->
dist / region->winx;
776 ofs[2] = rv3d->
ofs[2];
778 if (region->winx > region->winy) {
779 z1 = region->winy * rv3d->
dist / region->winx;
789 for (
int val = 0; val < 8; val++) {
790 if (
ELEM(val, 0, 3, 4, 7)) {
791 bb->
vec[val][0] = -x1 - ofs[0];
794 bb->
vec[val][0] = x1 - ofs[0];
797 if (
ELEM(val, 0, 1, 4, 5)) {
798 bb->
vec[val][1] = -
y1 - ofs[1];
801 bb->
vec[val][1] =
y1 - ofs[1];
805 bb->
vec[val][2] = -z1 - ofs[2];
808 bb->
vec[val][2] = z1 - ofs[2];
821 for (
int val = 0; val < 6; val++) {
822 clip[val][3] = -
dot_v3v3(clip[val], bb->
vec[val % 5]);
832 memcpy(rv3d->
clip, clip,
sizeof(clip));
850 const float axis_eps = 0.5f;
854 float view_axis_all[4][3] = {
855 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}};
857 float *view_src_x = &view_axis_all[0][0];
858 float *view_src_y = &view_axis_all[1][0];
860 float *view_dst_x = &view_axis_all[2][0];
861 float *view_dst_y = &view_axis_all[3][0];
882 for (i = 0; i < 3; i++) {
883 if (((
fabsf(view_src_x[i]) > axis_eps) || (
fabsf(view_src_y[i]) > axis_eps)) &&
884 ((
fabsf(view_dst_x[i]) > axis_eps) || (
fabsf(view_dst_y[i]) > axis_eps))) {
885 rv3d_dst->
ofs[i] = rv3d_src->
ofs[i];
956 for (; region; region = region->
prev) {
968 region_sync = region;
978 int index_qsplit = 0;
979 for (region =
area->regionbase.first; region; region = region->
next) {
1009 rect.
xmin = mval[0];
1010 rect.
ymin = mval[1];
1011 rect.
xmax = mval[0] + 1;
1012 rect.
ymax = mval[1] + 1;
1029 float mouse_worldloc[3],
1030 const bool UNUSED(alphaoverride),
1031 const float fallback_depth_pt[3])
1034 int margin_arr[] = {0, 2, 4};
1035 bool depth_ok =
false;
1044 depth_ok = (depth_close != FLT_MAX);
1045 }
while ((depth_ok ==
false) && (i <
ARRAY_SIZE(margin_arr)));
1048 float centx = (
float)mval[0] + 0.5f;
1049 float centy = (
float)mval[1] + 0.5f;
1056 if (fallback_depth_pt) {
1065 float mouse_worldloc[3],
1067 const float *force_depth)
1072 depth = *force_depth;
1078 if (depth == FLT_MAX) {
1082 float centx = (
float)mval[0] + 0.5f;
1083 float centy = (
float)mval[1] + 0.5f;
1101 data->depth = depth;
1108 const ViewDepths *vd,
const int mval_sta[2],
const int mval_end[2],
int margin,
float *depth)
1119 data.margin = margin;
1127 *depth =
data.depth;
1129 return (*depth != 1.0f);
1142 return radius * (1.0f /
tanf(
angle / 2.0f));
1154 const bool use_aspect,
1166 float lens, sensor_size, zoom;
1208 winx = region->
winx;
1209 winy = region->
winy;
1213 float aspect = winx / winy;
1214 if (aspect < 1.0f) {
1215 aspect = 1.0f / aspect;
1232 const float fallback_dist)
1234 float pos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1235 float dir[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1244 if ((dist < FLT_EPSILON) && (fallback_dist != 0.0f)) {
1245 dist = fallback_dist;
1272 const float dist_co[3],
1273 const float dist_min)
1278 float tvec[3] = {0.0f, 0.0f, -1.0f};
1281 float dist_co_local[3];
1283 sub_v3_v3v3(dist_co_local, dist_co, dist_co_local);
1284 const float delta =
dot_v3v3(tvec, dist_co_local);
1285 const float dist_new = rv3d->
dist + delta;
1286 if (dist_new >= dist_min) {
1288 rv3d->
dist = dist_new;
1307 {0.5f, -0.5f, -0.5f, 0.5f},
1309 {-0.5f, 0.5f, -0.5f, 0.5f},
1314 {0.5f, 0.5f, -0.5f, -0.5f},
1316 {0.5f, 0.5f, 0.5f, 0.5f},
1320 {0.5f, -0.5f, 0.5f, 0.5f},
1322 {-0.5f, -0.5f, -0.5f, 0.5f},
1328 {0.5f, -0.5f, -0.5f, -0.5f},
1330 {0.5f, 0.5f, -0.5f, 0.5f},
1335 {1.0f, 0.0f, 0.0f, 0.0f},
1342 {0.0f, -1.0f, 0.0f, 0.0f},
1363 char *r_view_axis_roll)
1378 *r_view_axis_roll = view_axis_roll;
1386 float delta_best = FLT_MAX;
1390 const float delta_test =
fabsf(
1392 if (delta_best > delta_test) {
1393 delta_best = delta_test;
1395 *r_view_axis_roll = view_axis_roll;
1410 char *r_view_axis_roll)
1418 return is_axis_view;
1492 void ED_view3d_to_m4(
float mat[4][4],
const float ofs[3],
const float quat[4],
const float dist)
1494 const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
1495 float dvec[3] = {0.0f, 0.0f, dist};
1518 const float quat[4],
1532 float *r_clip_start,
1540 depsgraph,
scene, camera_ob_eval, co, &scale, r_clip_start, r_clip_end)) {
1542 float obmat_new[4][4];
1543 bool is_ortho_camera =
false;
1547 ((
Camera *)camera_ob->
data)->ortho_scale = scale;
1548 is_ortho_camera =
true;
1561 if (is_ortho_camera) {
1589 ((
Camera *)camera_ob->
data)->clip_start = clip_start;
1590 ((
Camera *)camera_ob->
data)->clip_end = clip_end;
1594 ((
Camera *)camera_ob_eval->
data)->clip_start = clip_start;
1595 ((
Camera *)camera_ob_eval->
data)->clip_end = clip_end;
1618 float depth = *(
float *)value;
1620 data->r_depth = depth;
1623 if ((++
data->count) >=
data->count_max) {
1638 if (!vd || !vd->
depths) {
1644 if (
x < 0 || y < 0 || x >= vd->
w ||
y >= vd->
h) {
1650 int shape[2] = {vd->
w, vd->
h};
1651 int pixel_count = (
min_ii(
x + margin + 1, shape[1]) -
max_ii(
x - margin, 0)) *
1656 data.count_max = pixel_count;
1657 data.r_depth = 1.0f;
1661 depth =
data.r_depth;
1667 if (depth != 1.0f) {
1684 bool depths_valid[9] = {
false};
1685 float coords[9][3] = {{0}};
1687 for (
int x = 0, i = 0;
x < 2;
x++) {
1688 for (
int y = 0;
y < 2;
y++) {
1689 const int mval_ofs[2] = {mval[0] + (
x - 1), mval[1] + (
y - 1)};
1691 float depth_fl = 1.0f;
1693 const double depth = (
double)depth_fl;
1696 depths_valid[i] =
true;
1703 const int edges[2][6][2] = {
1705 {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}},
1707 {{0, 3}, {3, 6}, {1, 4}, {4, 7}, {2, 5}, {5, 8}},
1710 float cross[2][3] = {{0.0f}};
1712 for (
int i = 0; i < 6; i++) {
1713 for (
int axis = 0; axis < 2; axis++) {
1714 if (depths_valid[edges[axis][i][0]] && depths_valid[edges[axis][i][1]]) {
1716 sub_v3_v3v3(delta, coords[edges[axis][i][0]], coords[edges[axis][i][1]]);
1733 float r_location_world[3])
1735 float centx = (
float)mval[0] + 0.5f;
1736 float centy = (
float)mval[1] + 0.5f;
typedef float(TangentPoint)[2]
Camera data-block and utility functions.
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
bool BKE_camera_view_frame_fit_to_scene(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob, float r_co[3], float *r_scale, float *r_clip_start, float *r_clip_end)
#define CAMERA_PARAM_ZOOM_INIT_PERSP
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_params_from_view3d(CameraParams *params, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy)
#define CAMERA_PARAM_ZOOM_INIT_CAMOB
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
struct wmWindow * CTX_wm_window(const bContext *C)
General operations, lookup, etc. for blender objects.
void BKE_object_tfm_protected_restore(struct Object *ob, const ObjectTfmProtectedChannels *obtfm, short protectflag)
void BKE_object_apply_mat4_ex(struct Object *ob, const float mat[4][4], struct Object *parent, const float parentinv[4][4], bool use_compat)
void BKE_object_apply_mat4(struct Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
void BKE_object_tfm_protected_backup(const struct Object *ob, ObjectTfmProtectedChannels *obtfm)
float BKE_screen_view3d_zoom_from_fac(float zoomfac)
struct ARegion * BKE_area_find_region_active_win(struct ScrArea *area)
float BKE_screen_view3d_zoom_to_fac(float camzoom)
struct ARegion struct ARegion struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, int spacetype, short min)
Generic array manipulation API.
#define BLI_array_iter_spiral_square(arr, arr_shape, center, test_fn, user_data)
void BLI_bitmap_draw_2d_line_v2v2i(const int p1[2], const int p2[2], bool(*callback)(int, int, void *), void *user_data)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
bool isect_planes_v3_fn(const float planes[][4], int planes_len, float eps_coplanar, float eps_isect, void(*callback_fn)(const float co[3], int i, int j, int k, void *user_data), void *user_data)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mul_m4_v4(const float M[4][4], float r[4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void mul_m4_v3(const float M[4][4], float r[3])
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
void copy_m4_m4(float m1[4][4], const float m2[4][4])
bool is_negative_m4(const float mat[4][4])
void invert_qt_normalized(float q[4])
void mul_qt_v3(const float q[4], float r[3])
void invert_qt_qt_normalized(float q1[4], const float q2[4])
float focallength_to_fov(float focal_length, float sensor)
void copy_qt_qt(float q[4], const float a[4])
void mat3_normalized_to_quat(float q[4], const float mat[3][3])
float angle_signed_qtqt(const float q1[4], const float q2[4])
void quat_to_mat4(float mat[4][4], const float q[4])
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
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 copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v4_v4(float r[4], const float a[4])
MINLINE void negate_v3(float r[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size)
#define INIT_MINMAX(min, max)
typedef double(DMatrix)[4][4]
struct Depsgraph Depsgraph
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define ID_IS_LINKED(_id)
#define DEFAULT_SENSOR_WIDTH
Object is a sort of wrapper for general info.
@ OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK
@ V3D_SHADING_BACKGROUND_VIEWPORT
@ V3D_SHADING_BACKGROUND_WORLD
@ V3D_SHADING_TEXTURE_COLOR
#define RV3D_VIEW_IS_AXIS(view)
#define RV3D_CAMZOOM_MIN_FACTOR
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CAMZOOM_MAX_FACTOR
@ RV3D_VIEW_AXIS_ROLL_270
#define RV3D_ZOFFSET_DISABLED
@ RV3D_LOCK_ANY_TRANSFORM
#define ANIM_KS_LOCATION_ID
#define ANIM_KS_ROTATION_ID
void ED_area_tag_redraw(ScrArea *area)
void ED_region_tag_redraw(struct ARegion *region)
bool ED_undo_is_memfile_compatible(const struct bContext *C)
void ED_undo_grouped_push(struct bContext *C, const char *str)
void ED_undo_push(struct bContext *C, const char *str)
void ED_view3d_win_to_3d_int(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
bool ED_view3d_unproject_v3(const struct ARegion *region, float regionx, float regiony, float regionz, float world[3])
#define VIEW3D_DIST_FALLBACK
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, struct ViewDepths **r_depths)
_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 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
#define GPU_matrix_set(x)
#define GPU_matrix_projection_set(x)
void GPU_polygon_offset(float viewdist, float dist)
Read Guarded memory(de)allocation.
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
void UI_GetThemeColor3fv(int colorid, float col[3])
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra)
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
const char * RE_engine_id_BLENDER_WORKBENCH
struct SceneDisplay display
float background_color[3]
struct Object * ob_center
void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
float view3d_depth_near(ViewDepths *d)
bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const BoundBox *bb)
float ED_view3d_radius_to_dist_ortho(const float lens, const float radius)
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const bool calc_dist)
Camera * ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], const double depth, float r_location_world[3])
static bool depth_read_test_fn(const void *value, void *userdata)
char ED_view3d_axis_view_opposite(char view)
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
static bool view3d_camera_lock_undo_ex(const char *str, View3D *v3d, RegionView3D *rv3d, struct bContext *C, bool undo_group)
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
static bool view3d_boundbox_clip_m4(const BoundBox *bb, const float persmatob[4][4])
bool ED_view3d_camera_to_view_selected(struct Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
bool ED_view3d_lock(RegionView3D *rv3d)
char ED_view3d_lock_view_from_index(int index)
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3])
bool ED_view3d_depth_read_cached_seg(const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *depth)
void ED_view3d_lastview_store(RegionView3D *rv3d)
bool ED_view3d_camera_lock_autokey(View3D *v3d, RegionView3D *rv3d, struct bContext *C, const bool do_rotate, const bool do_translate)
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d, const float dist_co[3], const float dist_min)
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, View3D *v3d, RegionView3D *rv3d, bContext *C)
bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale)
bool ED_view3d_quat_from_axis_view(const char view, const char view_axis_roll, float r_quat[4])
bool ED_view3d_camera_autokey(const Scene *scene, ID *id_key, struct bContext *C, const bool do_rotate, const bool do_translate)
static bool view3d_camera_to_view_selected_impl(struct Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob, float *r_clip_start, float *r_clip_end)
float ED_view3d_radius_to_dist_persp(const float angle, const float radius)
void ED_view3d_to_object(const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], const float dist)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
static void points_in_planes_minmax_fn(const float co[3], int UNUSED(i), int UNUSED(j), int UNUSED(k), void *user_data_p)
void ED_view3d_dist_range_get(const View3D *v3d, float r_dist_range[2])
static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_src)
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, const bool is_flip)
bool ED_view3d_clip_range_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, float *r_clipsta, float *r_clipend, const bool use_ortho_factor)
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], const float fallback_dist)
static float view_autodist_depth_margin(ARegion *region, const int mval[2], int margin)
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
bool ED_view3d_context_activate(bContext *C)
void ED_view3d_lock_clear(View3D *v3d)
void view3d_operator_needs_opengl(const bContext *C)
void view3d_region_operator_needs_opengl(wmWindow *UNUSED(win), ARegion *region)
bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2])
bool ED_view3d_camera_lock_undo_push(const char *str, View3D *v3d, RegionView3D *rv3d, bContext *C)
void view3d_boxview_copy(ScrArea *area, ARegion *region)
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, struct bContext *C)
void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist)
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], float *dist, float *lens)
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const struct Depsgraph *depsgraph, const char persp, const bool use_aspect, const float radius)
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const char persp)
bool ED_view3d_viewplane_get(Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, int winx, int winy, rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize)
bool ED_view3d_boundbox_clip_ex(const RegionView3D *rv3d, const BoundBox *bb, float obmat[4][4])
void view3d_boxview_sync(ScrArea *area, ARegion *region)
static bool depth_segment_cb(int x, int y, void *userData)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
static void view3d_boxview_clip(ScrArea *area)
void ED_view3d_distance_set(RegionView3D *rv3d, const float dist)
bool ED_view3d_camera_to_view_selected_with_set_clipping(struct Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
bool ED_view3d_autodist(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const bool UNUSED(alphaoverride), const float fallback_depth_pt[3])
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist)
bool ED_view3d_quat_to_axis_view(const float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll)
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
static float view3d_quat_axis[6][4][4]
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll)
bool ED_view3d_has_workbench_in_texture_color(const Scene *scene, const Object *ob, const View3D *v3d)
void WM_main_add_notifier(unsigned int type, void *reference)
void wmViewport(const rcti *winrct)