Refactor: Use new math API for ED_view3d_ob_project_mat_get_from_obmat
#117938
|
@ -708,9 +708,8 @@ bool ED_view3d_win_to_segment_clipped(const Depsgraph *depsgraph,
|
|||
float r_ray_end[3],
|
||||
bool do_clip_planes);
|
||||
blender::float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob);
|
||||
void ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
|
||||
const float obmat[4][4],
|
||||
float r_pmat[4][4]);
|
||||
blender::float4x4 ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
|
||||
const blender::float4x4 &obmat);
|
||||
|
||||
/**
|
||||
* Convert between region relative coordinates (x,y) and depth component z and
|
||||
|
|
|
@ -3712,7 +3712,9 @@ static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmet
|
|||
copy_m4_m4(viewmat, ps->rv3d->viewmat);
|
||||
copy_m4_m4(viewinv, ps->rv3d->viewinv);
|
||||
|
||||
ED_view3d_ob_project_mat_get_from_obmat(ps->rv3d, ps->obmat, ps->projectMat);
|
||||
blender::float4x4 projection = ED_view3d_ob_project_mat_get_from_obmat(
|
||||
ps->rv3d, blender::float4x4(ps->obmat));
|
||||
copy_m4_m4(ps->projectMat, projection.ptr());
|
||||
|
||||
ps->is_ortho = ED_view3d_clip_range_get(
|
||||
ps->depsgraph, ps->v3d, ps->rv3d, &ps->clip_start, &ps->clip_end, true);
|
||||
|
|
|
@ -710,14 +710,10 @@ blender::float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const O
|
|||
return r_pmat;
|
||||
}
|
||||
|
||||
void ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
|
||||
const float obmat[4][4],
|
||||
float r_pmat[4][4])
|
||||
blender::float4x4 ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d,
|
||||
|
||||
const blender::float4x4 &obmat)
|
||||
{
|
||||
float vmat[4][4];
|
||||
|
||||
mul_m4_m4m4(vmat, rv3d->viewmat, obmat);
|
||||
mul_m4_m4m4(r_pmat, rv3d->winmat, vmat);
|
||||
return blender::float4x4_view(rv3d->winmat) * blender::float4x4_view(rv3d->viewmat) * obmat;
|
||||
}
|
||||
|
||||
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
|
||||
|
|
Loading…
Reference in New Issue
Might be nice to change the code inside of
ED_view3d_ob_project_mat_get
at the same time? Not a big deal though.