diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-07-18 21:33:51 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-07-18 21:33:51 +0400 |
commit | 06c7653be1c894d0eb3dd985f4e389543a64f5b3 (patch) | |
tree | 9a054dddfae023824fa4fb9b588ade1aace1fd28 /source/blender/blenkernel/intern/mball.c | |
parent | 02ab203c984678e5d70ec4bdf0412b58515bed45 (diff) |
- added boundbox_set_from_min_max function
- fix DerivedMesh.getMinMax implementations to set min & max when
there are no vertices
- mesh boundbox calc was wrong in some cases, messed up HOMEKEY
and localview zooming
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 35dfe5d2dfd..44eb4b38051 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -217,29 +217,20 @@ void tex_space_mball(Object *ob) dl= dl->next; } - if(doit) { - loc[0]= (min[0]+max[0])/2.0f; - loc[1]= (min[1]+max[1])/2.0f; - loc[2]= (min[2]+max[2])/2.0f; - - size[0]= (max[0]-min[0])/2.0f; - size[1]= (max[1]-min[1])/2.0f; - size[2]= (max[2]-min[2])/2.0f; - } - else { - loc[0]= loc[1]= loc[2]= 0.0f; - size[0]= size[1]= size[2]= 1.0f; + if(!doit) { + min[0] = min[1] = min[2] = -1.0f; + max[0] = max[1] = max[2] = 1.0f; } - bb->vec[0][0]=bb->vec[1][0]=bb->vec[2][0]=bb->vec[3][0]= loc[0]-size[0]; - bb->vec[4][0]=bb->vec[5][0]=bb->vec[6][0]=bb->vec[7][0]= loc[0]+size[0]; + loc[0]= (min[0]+max[0])/2.0f; + loc[1]= (min[1]+max[1])/2.0f; + loc[2]= (min[2]+max[2])/2.0f; - bb->vec[0][1]=bb->vec[1][1]=bb->vec[4][1]=bb->vec[5][1]= loc[1]-size[1]; - bb->vec[2][1]=bb->vec[3][1]=bb->vec[6][1]=bb->vec[7][1]= loc[1]+size[1]; + size[0]= (max[0]-min[0])/2.0f; + size[1]= (max[1]-min[1])/2.0f; + size[2]= (max[2]-min[2])/2.0f; - bb->vec[0][2]=bb->vec[3][2]=bb->vec[4][2]=bb->vec[7][2]= loc[2]-size[2]; - bb->vec[1][2]=bb->vec[2][2]=bb->vec[5][2]=bb->vec[6][2]= loc[2]+size[2]; - + boundbox_set_from_min_max(bb, min, max); } void make_orco_mball(Object *ob) |