* deal with the camera border, otherwise map the coords to the camera border. */
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &rectf, -1); /* negative shift */
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, -1); /* negative shift */
BLI_copy_rcti_rctf(&rect, &rectf);
}
else {
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- view3d_calc_camera_border(scene, ar, NULL, v3d, subrect, -1); /* negative shift */
+ ED_view3d_calc_camera_border(scene, ar, v3d, NULL, subrect, -1); /* negative shift */
return 1;
}
}
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- view3d_calc_camera_border(p->scene, p->ar, NULL, v3d, &p->subrect_data, -1); /* negative shift */
+ ED_view3d_calc_camera_border(p->scene, p->ar, v3d, NULL, &p->subrect_data, -1); /* negative shift */
p->subrect= &p->subrect_data;
}
}
*/
void ED_view3d_global_to_vector(struct RegionView3D *rv3d, const float coord[3], float vec[3]);
+#if 0 /* UNUSED */
void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z);
+#endif
/* Depth buffer */
-void view3d_update_depths(struct ARegion *ar);
-float read_cached_depth(struct ViewContext *vc, int x, int y);
-void request_depth_update(struct RegionView3D *rv3d);
+void ED_view3d_depth_update(struct ARegion *ar);
+float ED_view3d_depth_read_cached(struct ViewContext *vc, int x, int y);
+void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
/* Projection */
#define IS_CLIPPED 12000
-void view3d_calculate_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
+void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
void project_short(struct ARegion *ar, const float vec[3], short adr[2]);
void project_short_noclip(struct ARegion *ar, const float vec[3], short adr[2]);
void project_float(struct ARegion *ar, const float vec[3], float adr[2]);
void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
-void get_object_clip_range(struct Object *ob, float *lens, float *clipsta, float *clipend);
-int get_view3d_cliprange(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
-int get_view3d_viewplane(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
-void view3d_get_object_project_mat(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
-void view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
-void view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct RegionView3D *rv3d, struct View3D *v3d, struct rctf *viewborder_r, short do_shift);
+void ED_view3d_ob_clip_range_get(struct Object *ob, float *lens, float *clipsta, float *clipend);
+int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
+int ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
+void ED_view3d_ob_project_mat_get(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
+void ED_view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
+void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short do_shift);
/* drawobject.c iterators */
void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
void ED_view3d_local_clipping(struct RegionView3D *rv3d, float mat[][4]);
-int view3d_test_clipping(struct RegionView3D *rv3d, const float vec[3], const int local);
-void view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]);
-float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]);
+int ED_view3d_test_clipping(struct RegionView3D *rv3d, const float vec[3], const int local);
+void ED_view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]);
+float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]);
void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]);
vec[1]= eed->v1->co[1] + labda*(eed->v2->co[1] - eed->v1->co[1]);
vec[2]= eed->v1->co[2] + labda*(eed->v2->co[2] - eed->v1->co[2]);
- if(view3d_test_clipping(data->vc.rv3d, vec, 1)==0) {
+ if(ED_view3d_test_clipping(data->vc.rv3d, vec, 1)==0) {
data->dist = distance;
data->closest = eed;
}
{
float vec1[3], vec2[3], mvalf[2];
- view3d_project_float(ar, co1, vec1, mat);
- view3d_project_float(ar, co2, vec2, mat);
+ ED_view3d_project_float(ar, co1, vec1, mat);
+ ED_view3d_project_float(ar, co2, vec2, mat);
mvalf[0]= (float)mval[0];
mvalf[1]= (float)mval[1];
/* select flush... vertices are important */
EM_selectmode_set(em);
- view3d_get_object_project_mat(rv3d, obedit, projectMat);
+ ED_view3d_ob_project_mat_get(rv3d, obedit, projectMat);
/* find best face, exclude triangles and break on face select or faces with 2 edges select */
mindist= 1000000.0f;
if(totsel>1)
break;
- view3d_project_float(ar, efa->cent, vec, projectMat);
+ ED_view3d_project_float(ar, efa->cent, vec, projectMat);
dist= sqrt( (vec[0]-mval[0])*(vec[0]-mval[0]) + (vec[1]-mval[1])*(vec[1]-mval[1]) );
if(dist<mindist) {
mindist= dist;
/* we may need to force an update here by setting the rv3d as dirty
* for now it seems ok, but take care!:
* rv3d->depths->dirty = 1; */
- view3d_update_depths(data->vc.ar);
+ ED_view3d_depth_update(data->vc.ar);
}
}
}
rctf viewplane;
float clipsta, clipend;
- int is_ortho= get_view3d_viewplane(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
+ int is_ortho= ED_view3d_viewplane_get(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
if(is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
}
if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
- if(!view3d_test_clipping(ps->rv3d, wco, 1)) {
+ if(!ED_view3d_test_clipping(ps->rv3d, wco, 1)) {
return 1;
}
/* a pitty we need to get the worldspace pixel location here */
if(do_clip) {
interp_v3_v3v3v3(wco, ps->dm_mvert[ (*(&mf->v1 + i1)) ].co, ps->dm_mvert[ (*(&mf->v1 + i2)) ].co, ps->dm_mvert[ (*(&mf->v1 + i3)) ].co, w);
- if(view3d_test_clipping(ps->rv3d, wco, 1)) {
+ if(ED_view3d_test_clipping(ps->rv3d, wco, 1)) {
continue; /* Watch out that no code below this needs to run */
}
}
if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w);
else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w);
- if(view3d_test_clipping(ps->rv3d, wco, 1)) {
+ if(ED_view3d_test_clipping(ps->rv3d, wco, 1)) {
continue; /* Watch out that no code below this needs to run */
}
}
static int project_paint_view_clip(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
{
- int orth= get_view3d_cliprange(v3d, rv3d, clipsta, clipend);
+ int orth= ED_view3d_clip_range_get(v3d, rv3d, clipsta, clipend);
if (orth) { /* only needed for ortho */
float fac = 2.0f / ((*clipend) - (*clipsta));
copy_m4_m4(viewmat, ps->rv3d->viewmat);
copy_m4_m4(viewinv, ps->rv3d->viewinv);
- view3d_get_object_project_mat(ps->rv3d, ps->ob, ps->projectMat);
+ ED_view3d_ob_project_mat_get(ps->rv3d, ps->ob, ps->projectMat);
ps->is_ortho= project_paint_view_clip(ps->v3d, ps->rv3d, &ps->clipsta, &ps->clipend);
}
float bb_min[3], bb_max[3], pmat[4][4];
int i, j, k;
- view3d_get_object_project_mat(rv3d, ob, pmat);
+ ED_view3d_ob_project_mat_get(rv3d, ob, pmat);
if(!pbvh)
return 0;
vec[0] = i ? bb_min[0] : bb_max[0];
vec[1] = j ? bb_min[1] : bb_max[1];
vec[2] = k ? bb_min[2] : bb_max[2];
- view3d_project_float(ar, vec, proj, pmat);
+ ED_view3d_project_float(ar, vec, proj, pmat);
rect->xmin = MIN2(rect->xmin, proj[0]);
rect->xmax = MAX2(rect->xmax, proj[0]);
rect->ymin = MIN2(rect->ymin, proj[1]);
rect.ymax -= 2;
#endif
- view3d_calculate_clipping(&bb, planes, &mats, &rect);
+ ED_view3d_calc_clipping(&bb, planes, &mats, &rect);
mul_m4_fl(planes, -1.0f);
/* clear redraw flag from nodes */
/* clipplanes in eye space */
if(rv3d->rflag & RV3D_CLIPPING) {
- if(view3d_test_clipping(rv3d, vec, local))
+ if(ED_view3d_test_clipping(rv3d, vec, local))
return;
}
/* circle for object centers, special_color is for library or ob users */
static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3], int selstate, int special_color)
{
- const float size= view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
+ const float size= ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
/* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */
if(v3d->zbuf) glDepthFunc(GL_ALWAYS);
static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt, int flag)
{
Object *ob= base->object;
- const float pixsize= view3d_pixel_size(rv3d, ob->obmat[3]);
+ const float pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
Lamp *la= ob->data;
float vec[3], lvec[3], vvec[3], circrad, x,y,z;
float lampsize;
}
else {
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
- if(me->totface<=4 || boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
+ if(me->totface<=4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
check_alpha = check_material_alpha(base, me, glsl);
case PART_DRAW_CROSS:
case PART_DRAW_AXIS:
/* lets calculate the scale: */
- pixsize= view3d_pixel_size(rv3d, ob->obmat[3]);
+ pixsize= ED_view3d_pixel_size(rv3d, ob->obmat[3]);
if(part->draw_size==0.0)
pixsize *= 2.0f;
hasfaces= displist_has_faces(&ob->disp);
}
- if (hasfaces && boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ if (hasfaces && ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
draw_index_wire= 0;
if (dm) {
draw_mesh_object_outline(v3d, ob, dm);
if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) {
Curve *cu = ob->data;
- if (boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ if (ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
if (ob->type==OB_CURVE)
draw_index_wire= 0;
if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
draw_bounding_volume(scene, ob);
}
- else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb))
+ else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb))
empty_object= drawDispList(scene, v3d, rv3d, base, dt);
break;
if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
draw_bounding_volume(scene, ob);
}
- else if(boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
+ else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
empty_object= drawDispList(scene, v3d, rv3d, base, dt);
//XXX old animsys if(cu->path)
/* for 'local' ED_view3d_local_clipping must run first
* then all comparisons can be done in localspace */
-int view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int local)
+int ED_view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int local)
{
return test_clipping(vec, local ? rv3d->clip_local : rv3d->clip);
}
}
}
-void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, View3D *v3d, rctf *viewborder_r, short do_shift)
+void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short do_shift)
{
const float zoomfac= BKE_screen_view3d_zoom_to_fac((float)rv3d->camzoom);
float size[2];
if(v3d->camera->type==OB_CAMERA)
ca = v3d->camera->data;
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &viewborder, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &viewborder, FALSE);
/* the offsets */
x1= viewborder.xmin;
y1= viewborder.ymin;
if(rv3d->persp==RV3D_CAMOB) {
rctf vb;
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &vb, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
x1= vb.xmin;
y1= vb.ymin;
asp= ( (float)ibuf->y)/(float)ibuf->x;
vec[0] = vec[1] = vec[2] = 0.0;
- view3d_project_float(ar, vec, sco, rv3d->persmat);
+ ED_view3d_project_float(ar, vec, sco, rv3d->persmat);
cx = sco[0];
cy = sco[1];
}
if(use_displist) {
glMultMatrixf(dob->mat);
- if(boundbox_clip(rv3d, dob->mat, &bb))
+ if(ED_view3d_boundbox_clip(rv3d, dob->mat, &bb))
glCallList(displist);
glLoadMatrixf(rv3d->viewmat);
}
}
/* note, with nouveau drivers the glReadPixels() is very slow. [#24339] */
-void view3d_update_depths(ARegion *ar)
+void ED_view3d_depth_update(ARegion *ar)
{
RegionView3D *rv3d= ar->regiondata;
viewrotate_apply(vod, event->x, event->y);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
if (event->type == MOUSEPAN) {
viewrotate_apply(vod, event->prevx, event->prevy);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
viewops_data_free(C, op);
else if (event->type == MOUSEROTATE) {
/* MOUSEROTATE performs orbital rotation, so y axis delta is set to 0 */
viewrotate_apply(vod, event->prevx, event->y);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
viewops_data_free(C, op);
viewmove_apply(vod, event->x, event->y);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
if (event->type == MOUSEPAN) {
viewmove_apply(vod, event->prevx, event->prevy);
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
viewzoom_apply(vod, event->x, event->y, U.viewzoom, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
if(rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(sa, ar);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
ED_view3d_camera_lock_sync(v3d, rv3d);
vod->origy = vod->oldy = vod->origy + event->x - event->prevx;
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, FALSE);
}
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
viewdolly_apply(vod, event->x, event->y, (U.uiflag & USER_ZOOM_INVERT) != 0);
}
else if (event_code==VIEW_CONFIRM) {
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
if(rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(sa, ar);
- request_depth_update(rv3d);
+ ED_view3d_depth_tag_update(rv3d);
ED_region_tag_redraw(ar);
viewops_data_free(C, op);
vod->origy = vod->oldy = vod->origy + event->x - event->prevx;
viewdolly_apply(vod, event->prevx, event->prevy, FALSE);
}
- request_depth_update(vod->rv3d);
+ ED_view3d_depth_tag_update(vod->rv3d);
viewops_data_free(C, op);
return OPERATOR_FINISHED;
rect.ymax= RNA_int_get(op->ptr, "ymax");
/* calculate range */
- view3d_calc_camera_border(scene, ar, rv3d, v3d, &vb, FALSE);
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
view3d_set_viewcontext(C, &vc);
view3d_get_transformation(vc.ar, vc.rv3d, NULL, &mats); /* NULL because we don't want it in object space */
- view3d_calculate_clipping(rv3d->clipbb, rv3d->clip, &mats, &rect);
+ ED_view3d_calc_clipping(rv3d->clipbb, rv3d->clip, &mats, &rect);
return OPERATOR_FINISHED;
}
ED_view3d_from_m4(ob->obmat, ofs, quat, dist);
if (lens) {
- get_object_clip_range(ob, lens, NULL, NULL);
+ ED_view3d_ob_clip_range_get(ob, lens, NULL, NULL);
}
}
void VIEW3D_OT_game_start(struct wmOperatorType *ot);
-int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
-
-void centerview(struct ARegion *ar, View3D *v3d);
+int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb);
void smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *, float *ofs, float *quat, float *dist, float *lens);
/* Gets the lens and clipping values from a camera of lamp type object */
-void get_object_clip_range(Object *ob, float *lens, float *clipsta, float *clipend)
+void ED_view3d_ob_clip_range_get(Object *ob, float *lens, float *clipsta, float *clipend)
{
if(ob->type==OB_LAMP ) {
Lamp *la = ob->data;
/* ********************************** */
-void view3d_calculate_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, rcti *rect)
+void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, rcti *rect)
{
double xs, ys, p[3];
short val;
normalize_v3(out);
}
-float read_cached_depth(ViewContext *vc, int x, int y)
+float ED_view3d_depth_read_cached(ViewContext *vc, int x, int y)
{
ViewDepths *vd = vc->rv3d->depths;
return 1;
}
-void request_depth_update(RegionView3D *rv3d)
+void ED_view3d_depth_tag_update(RegionView3D *rv3d)
{
if(rv3d->depths)
rv3d->depths->damaged= 1;
}
-void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4][4])
+void ED_view3d_ob_project_mat_get(RegionView3D *rv3d, Object *ob, float pmat[4][4])
{
float vmat[4][4];
mul_m4_m4m4(pmat, vmat, rv3d->winmat);
}
+#if 0
/* Uses window coordinates (x,y) and depth component z to find a point in
modelspace */
void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, const float z)
out[1] = uy;
out[2] = uz;
}
+#endif
/* use above call to get projecting mat */
-void view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
+void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
{
float vec4[4];
}
}
-int boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
+int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
{
/* return 1: draw */
adr[0]= IS_CLIPPED;
if(rv3d->rflag & RV3D_CLIPPING) {
- if(view3d_test_clipping(rv3d, vec, 0))
+ if(ED_view3d_test_clipping(rv3d, vec, 0))
return;
}
}
/* copies logic of get_view3d_viewplane(), keep in sync */
-int get_view3d_cliprange(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
+int ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend)
{
int orth= 0;
}
/* also exposed in previewrender.c */
-int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
+int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
{
Camera *cam=NULL;
float lens, fac, x1, y1, x2, y2;
float clipsta, clipend, x1, y1, x2, y2;
int orth;
- orth= get_view3d_viewplane(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
+ orth= ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, &viewplane, &clipsta, &clipend, NULL);
rv3d->is_persp= !orth;
// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend);
if(rv3d->persp==RV3D_CAMOB && startscene->gm.framing.type == SCE_GAMEFRAMING_BARS && startscene->gm.stereoflag != STEREO_DOME) { /* Letterbox */
rctf cam_framef;
- view3d_calc_camera_border(startscene, ar, rv3d, CTX_wm_view3d(C), &cam_framef, FALSE);
+ ED_view3d_calc_camera_border(startscene, ar, CTX_wm_view3d(C), rv3d, &cam_framef, FALSE);
cam_frame.xmin = cam_framef.xmin + ar->winrct.xmin;
cam_frame.xmax = cam_framef.xmax + ar->winrct.xmin;
cam_frame.ymin = cam_framef.ymin + ar->winrct.ymin;
}
}
-float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
+float ED_view3d_pixel_size(struct RegionView3D *rv3d, const float co[3])
{
return (rv3d->persmat[3][3] + (
rv3d->persmat[0][3]*co[0] +
/*ok, let's try to survive this*/
unit_m4(projectMat);
} else {
- view3d_get_object_project_mat(v3d, t->obedit, projectMat);
+ ED_view3d_ob_project_mat_get(v3d, t->obedit, projectMat);
}
numsel =0;
}
if (v3d) {
- view3d_project_float(t->ar, tempsv->up->v1->co, co, projectMat);
- view3d_project_float(t->ar, tempsv->up->v2->co, co2, projectMat);
+ ED_view3d_project_float(t->ar, tempsv->up->v1->co, co, projectMat);
+ ED_view3d_project_float(t->ar, tempsv->up->v2->co, co2, projectMat);
}
if (ev == tempsv->up->v1) {
add_v3_v3(start, tvec);
if (v3d) {
- view3d_project_float(t->ar, tempsv->down->v1->co, co, projectMat);
- view3d_project_float(t->ar, tempsv->down->v2->co, co2, projectMat);
+ ED_view3d_project_float(t->ar, tempsv->down->v1->co, co, projectMat);
+ ED_view3d_project_float(t->ar, tempsv->down->v2->co, co2, projectMat);
}
if (ev == tempsv->down->v1) {
break;
}
- mul_mat3_m4_fl(rv3d->twmat, view3d_pixel_size(rv3d, rv3d->twmat[3]) * U.tw_size * 5.0f);
+ mul_mat3_m4_fl(rv3d->twmat, ED_view3d_pixel_size(rv3d, rv3d->twmat[3]) * U.tw_size * 5.0f);
}
test_manipulator_axis(C);
invert_m4_m4(imat, rv3d->viewmat);
for (p = t->tsnap.points.first; p; p = p->next) {
- drawcircball(GL_LINE_LOOP, p->co, view3d_pixel_size(rv3d, p->co) * size, imat);
+ drawcircball(GL_LINE_LOOP, p->co, ED_view3d_pixel_size(rv3d, p->co) * size, imat);
}
if (t->tsnap.status & POINT_INIT) {
- drawcircball(GL_LINE_LOOP, t->tsnap.snapPoint, view3d_pixel_size(rv3d, t->tsnap.snapPoint) * size, imat);
+ drawcircball(GL_LINE_LOOP, t->tsnap.snapPoint, ED_view3d_pixel_size(rv3d, t->tsnap.snapPoint) * size, imat);
}
/* draw normal if needed */