diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-04 20:46:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-04 20:46:15 +0400 |
commit | 709903c6bba4dca12a6f367000f99a83da2af034 (patch) | |
tree | d6b84b215f9b84eb4b6ac4a828af59683c03588e /source/blender/editors/physics/particle_edit.c | |
parent | 794520a86a83a9eea230563e805480016c0479f0 (diff) |
refactor ED_view3d_project_short & ED_view3d_project_short_noclip,
This is apart of a code cleanup to make ED_view3d_project_short/ED_view3d_project_int/ED_view3d_project_float interchangeable. Currently they work very differently in a way thats quite confusing (and cause of bugs in blender that remain uncorrected) - fixes coming.
There are also cases where ED_view3d_project_short is used, then the values are converted from shorts into int's after because ED_view3d_project_int() behaves differently, will unify behavior of these functions after this commit.
- rather then clip/noclip versions, pass flags (for bound-box clip, window clip).
- rather then store the invalid clip-value, return success (or error value clip_near, clip_bb, clip_win, overflow).
- remove local copies of project functions from drawobject.c: view3d_project_short_clip, view3d_project_short_noclip, view3d_project_short_clip_persmat.
add functions:
- ED_view3d_project_short_global() global space projection
- ED_view3d_project_short_object() object space projection.
- ED_view3d_project_short_ex() take perspective matrix and local space option as args.
- ED_view3d_project_base() - special function to set the Object 'Base' screen coords (sx, sy), since this is a common enough operation.
Diffstat (limited to 'source/blender/editors/physics/particle_edit.c')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index ea6f9d4cebb..6d3f4b38583 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -408,11 +408,12 @@ static int key_test_depth(PEData *data, const float co[3]) /* nothing to do */ if ((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0) return 1; - - ED_view3d_project_short(data->vc.ar, co, wco); - if (wco[0] == IS_CLIPPED) + if (ED_view3d_project_short_global(data->vc.ar, co, wco, + V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN) != V3D_PROJ_RET_SUCCESS) + { return 0; + } gluProject(co[0], co[1], co[2], data->mats.modelview, data->mats.projection, (GLint *)data->mats.viewport, &ux, &uy, &uz); |