121 r_dist_range[0] = v3d->
grid * 0.001f;
122 r_dist_range[1] = v3d->
clip_end * 10.0f;
133 const bool use_ortho_factor)
140 if (use_ortho_factor &&
params.is_ortho) {
141 const float fac = 2.0f / (
params.clip_end -
params.clip_start);
147 *r_clipsta =
params.clip_start;
150 *r_clipend =
params.clip_end;
173 *r_viewplane =
params.viewplane;
176 *r_clip_start =
params.clip_start;
179 *r_clip_end =
params.clip_end;
182 *r_pixsize =
params.viewdx;
210 printf(
"view3d_region_operator_needs_opengl error, wrong region\n");
230 float viewdist = rv3d->
dist;
259 if (region ==
NULL) {
280 for (
int val = 0; val < 4; val++) {
294 memset(bb->
vec, 0,
sizeof(bb->
vec));
298 for (
int val = 0; val < 4; val++) {
311 for (
int val = 0; val < 8; val++) {
357 float planes[6 + 6][4];
360 for (
int i = 0; i < 3; i++) {
361 float *plane_min = planes[(i * 2) + 0];
362 float *plane_max = planes[(i * 2) + 1];
365 plane_min[i] = -1.0f;
366 plane_min[3] = +
min[i];
367 plane_max[i] = +1.0f;
368 plane_max[3] = -
max[i];
374 for (
int i = 0; i < clip_len; i++) {
383 const float eps_coplanar = 1e-4f;
384 const float eps_isect = 1e-6f;
402 int a, flag = -1, fl;
404 for (
a = 0;
a < 8;
a++) {
445 float persmatob[4][4];
588 const bool calc_dist)
622 float view_mat[4][4];
623 float diff_mat[4][4];
624 float parent_mat[4][4];
626 while (root_parent->
parent) {
627 root_parent = root_parent->
parent;
649 ob_update = ob_update->
parent;
672 const bool do_rotate,
673 const bool do_translate)
713 const bool do_rotate,
714 const bool do_translate)
723 while (root_parent->
parent) {
724 root_parent = root_parent->
parent;
726 id_key = &root_parent->
id;
749 float x1 = 0.0f,
y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
758 if (region->winx > region->winy) {
762 x1 = region->winx * rv3d->
dist / region->winy;
765 if (region->winx > region->winy) {
766 y1 = region->winy * rv3d->
dist / region->winx;
774 ofs[2] = rv3d->
ofs[2];
776 if (region->winx > region->winy) {
777 z1 = region->winy * rv3d->
dist / region->winx;
787 for (
int val = 0; val < 8; val++) {
788 if (
ELEM(val, 0, 3, 4, 7)) {
789 bb->
vec[val][0] = -x1 - ofs[0];
792 bb->
vec[val][0] = x1 - ofs[0];
795 if (
ELEM(val, 0, 1, 4, 5)) {
796 bb->
vec[val][1] = -
y1 - ofs[1];
799 bb->
vec[val][1] =
y1 - ofs[1];
803 bb->
vec[val][2] = -z1 - ofs[2];
806 bb->
vec[val][2] = z1 - ofs[2];
819 for (
int val = 0; val < 6; val++) {
820 clip[val][3] = -
dot_v3v3(clip[val], bb->
vec[val % 5]);
830 memcpy(rv3d->
clip, clip,
sizeof(clip));
848 const float axis_eps = 0.5f;
852 float view_axis_all[4][3] = {
853 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}};
855 float *view_src_x = &view_axis_all[0][0];
856 float *view_src_y = &view_axis_all[1][0];
858 float *view_dst_x = &view_axis_all[2][0];
859 float *view_dst_y = &view_axis_all[3][0];
880 for (i = 0; i < 3; i++) {
881 if (((
fabsf(view_src_x[i]) > axis_eps) || (
fabsf(view_src_y[i]) > axis_eps)) &&
882 ((
fabsf(view_dst_x[i]) > axis_eps) || (
fabsf(view_dst_y[i]) > axis_eps))) {
883 rv3d_dst->
ofs[i] = rv3d_src->
ofs[i];
957 for (; region; region = region->
prev) {
969 region_sync = region;
979 int index_qsplit = 0;
980 for (region =
area->regionbase.first; region; region = region->
next) {
1010 rect.
xmin = mval[0];
1011 rect.
ymin = mval[1];
1012 rect.
xmax = mval[0] + 1;
1013 rect.
ymax = mval[1] + 1;
1038 float mouse_worldloc[3],
1039 const bool UNUSED(alphaoverride),
1040 const float fallback_depth_pt[3])
1043 int margin_arr[] = {0, 2, 4};
1044 bool depth_ok =
false;
1053 depth_ok = (depth_close != FLT_MAX);
1054 }
while ((depth_ok ==
false) && (i <
ARRAY_SIZE(margin_arr)));
1057 float centx = (
float)mval[0] + 0.5f;
1058 float centy = (
float)mval[1] + 0.5f;
1065 if (fallback_depth_pt) {
1075 float mouse_worldloc[3],
1077 const float *force_depth)
1082 depth = *force_depth;
1088 if (depth == FLT_MAX) {
1092 float centx = (
float)mval[0] + 0.5f;
1093 float centy = (
float)mval[1] + 0.5f;
1101 return (*depth != FLT_MAX);
1119 if (depth != FLT_MAX) {
1120 data->depth = depth;
1127 ARegion *region,
const int mval_sta[2],
const int mval_end[2],
int margin,
float *depth)
1137 data.region = region;
1138 data.margin = margin;
1139 data.depth = FLT_MAX;
1146 *depth =
data.depth;
1148 return (*depth != FLT_MAX);
1161 return radius * (1.0f /
tanf(
angle / 2.0f));
1198 const bool use_aspect,
1210 float lens, sensor_size, zoom;
1252 winx = region->
winx;
1253 winy = region->
winy;
1257 float aspect = winx / winy;
1258 if (aspect < 1.0f) {
1259 aspect = 1.0f / aspect;
1288 const float fallback_dist)
1290 float pos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1291 float dir[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1300 if ((dist < FLT_EPSILON) && (fallback_dist != 0.0f)) {
1301 dist = fallback_dist;
1340 const float dist_co[3],
1341 const float dist_min)
1346 float tvec[3] = {0.0f, 0.0f, -1.0f};
1349 float dist_co_local[3];
1351 sub_v3_v3v3(dist_co_local, dist_co, dist_co_local);
1352 const float delta =
dot_v3v3(tvec, dist_co_local);
1353 const float dist_new = rv3d->
dist + delta;
1354 if (dist_new >= dist_min) {
1356 rv3d->
dist = dist_new;
1375 {0.5f, -0.5f, -0.5f, 0.5f},
1377 {-0.5f, 0.5f, -0.5f, 0.5f},
1382 {0.5f, 0.5f, -0.5f, -0.5f},
1384 {0.5f, 0.5f, 0.5f, 0.5f},
1388 {0.5f, -0.5f, 0.5f, 0.5f},
1390 {-0.5f, -0.5f, -0.5f, 0.5f},
1396 {0.5f, -0.5f, -0.5f, -0.5f},
1398 {0.5f, 0.5f, -0.5f, 0.5f},
1403 {1.0f, 0.0f, 0.0f, 0.0f},
1410 {0.0f, -1.0f, 0.0f, 0.0f},
1431 char *r_view_axis_roll)
1443 *r_view_axis_roll = view_axis_roll;
1539 void ED_view3d_to_m4(
float mat[4][4],
const float ofs[3],
const float quat[4],
const float dist)
1541 const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
1542 float dvec[3] = {0.0f, 0.0f, dist};
1582 const float quat[4],
1603 float obmat_new[4][4];
1607 ((
Camera *)camera_ob->
data)->ortho_scale = scale;
1642 float depth = *(
float *)value;
1644 data->r_depth = depth;
1647 if ((++
data->count) >=
data->count_max) {
1659 if (!vd || !vd->
depths) {
1665 if (
x < 0 || y < 0 || x >= vd->
w ||
y >= vd->
h) {
1671 int shape[2] = {vd->
w, vd->
h};
1672 int pixel_count = (
min_ii(
x + margin + 1, shape[1]) -
max_ii(
x - margin, 0)) *
1677 data.count_max = pixel_count;
1678 data.r_depth = 1.0f;
1682 depth =
data.r_depth;
1689 if (depth != 1.0f) {
1705 bool depths_valid[9] = {
false};
1706 float coords[9][3] = {{0}};
1711 for (
int x = 0, i = 0;
x < 2;
x++) {
1712 for (
int y = 0;
y < 2;
y++) {
1713 const int mval_ofs[2] = {mval[0] + (
x - 1), mval[1] + (
y - 1)};
1715 float depth_fl = 1.0f;
1717 const double depth = (
double)depth_fl;
1720 depths_valid[i] =
true;
1727 const int edges[2][6][2] = {
1729 {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}},
1731 {{0, 3}, {3, 6}, {1, 4}, {4, 7}, {2, 5}, {5, 8}},
1734 float cross[2][3] = {{0.0f}};
1736 for (
int i = 0; i < 6; i++) {
1737 for (
int axis = 0; axis < 2; axis++) {
1738 if (depths_valid[edges[axis][i][0]] && depths_valid[edges[axis][i][1]]) {
1740 sub_v3_v3v3(delta, coords[edges[axis][i][0]], coords[edges[axis][i][1]]);
1757 float r_location_world[3])
1759 float centx = (
float)mval[0] + 0.5f;
1760 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)
#define CAMERA_PARAM_ZOOM_INIT_PERSP
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_params_from_view3d(CameraParams *params, struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d)
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)
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_apply_mat4_ex(struct Object *ob, const float mat[4][4], struct Object *parent, const float parentinv[4][4], const bool use_compat)
void BKE_object_tfm_protected_backup(const struct Object *ob, ObjectTfmProtectedChannels *obtfm)
void BKE_object_apply_mat4(struct Object *ob, const float mat[4][4], const bool use_compat, const bool use_parent)
void BKE_object_tfm_protected_restore(struct Object *ob, const ObjectTfmProtectedChannels *obtfm, const short protectflag)
struct ARegion * BKE_area_find_region_active_win(struct ScrArea *area)
struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, const int spacetype, const 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)
bool isect_planes_v3_fn(const float planes[][4], const int planes_len, const float eps_coplanar, const float eps_isect, void(*callback_fn)(const float co[3], int i, int j, int k, void *user_data), void *user_data)
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
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_v3(float r[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void negate_v4_v4(float r[4], 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_LOCK_FLAGS(rv3d)
#define RV3D_ZOFFSET_DISABLED
@ RV3D_LOCK_ANY_TRANSFORM
@ RV3D_VIEW_AXIS_ROLL_270
#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)
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])
#define VIEW3D_DIST_FALLBACK
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, bool update_cache)
bool ED_view3d_unproject(const struct ARegion *region, float regionx, float regiony, float regionz, float world[3])
_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.
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])
const char * RE_engine_id_BLENDER_WORKBENCH
struct ViewDepths * depths
struct SceneDisplay display
float background_color[3]
struct Object * ob_center
struct RegionView3D * rv3d
__forceinline avxf cross(const avxf &a, const avxf &b)
void view3d_update_depths_rect(ARegion *region, ViewDepths *d, rcti *rect)
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_autodist_depth_seg(ARegion *region, const int mval_sta[2], const int mval_end[2], int margin, float *depth)
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)
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
void ED_view3d_depth_tag_update(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])
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_autodist_depth(ARegion *region, const int mval[2], int margin, float *depth)
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d, const float dist_co[3], const float dist_min)
bool ED_view3d_depth_read_cached_normal(const ViewContext *vc, const int mval[2], float r_normal[3])
bool ED_view3d_clip_range_get(Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, float *r_clipsta, float *r_clipend, const bool use_ortho_factor)
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)
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_depth_unproject(const ARegion *region, const int mval[2], const double depth, float r_location_world[3])
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_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)
void view3d_boxview_copy(ScrArea *area, ARegion *region)
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)
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_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)