Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 10 Apr 2017 15:34:31 +0000 (17:34 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 10 Apr 2017 15:34:31 +0000 (17:34 +0200)
Conflicts:
source/blender/editors/space_view3d/drawobject.c

1  2 
source/blender/editors/space_view3d/drawobject.c

index c9f697b1cc1354e09d2981263f394e12d7910efa,3226601be466f89b01e5c5ba020e3a384f5b489a..f4498b1592ef927808730a3c3d6f1bc9cf57f251
@@@ -1874,58 -1849,16 +1874,58 @@@ static void drawcamera_frame(float vec[
  }
  
  /* center point to camera frame */
 -static void drawcamera_framelines(float vec[4][3], float origin[3])
 -{
 -      glBegin(GL_LINE_STRIP);
 -      glVertex3fv(vec[1]);
 -      glVertex3fv(origin);
 -      glVertex3fv(vec[0]);
 -      glVertex3fv(vec[3]);
 -      glVertex3fv(origin);
 -      glVertex3fv(vec[2]);
 -      glEnd();
 +static void drawcamera_framelines(float vec[4][3], float origin[3], unsigned pos)
 +{
 +      immBegin(PRIM_LINES, 8);
 +      immVertex3fv(pos, origin);
 +      immVertex3fv(pos, vec[0]);
 +      immVertex3fv(pos, origin);
 +      immVertex3fv(pos, vec[1]);
 +      immVertex3fv(pos, origin);
 +      immVertex3fv(pos, vec[2]);
 +      immVertex3fv(pos, origin);
 +      immVertex3fv(pos, vec[3]);
 +      immEnd();
 +}
 +
 +static void drawcamera_volume(float near_plane[4][3], float far_plane[4][3], bool filled, unsigned pos)
 +{
 +      drawcamera_frame(near_plane, filled, pos);
 +      drawcamera_frame(far_plane, filled, pos);
 +
 +      if (filled) {
 +#ifdef WITH_GL_PROFILE_COMPAT
 +              immBegin(PRIM_QUADS_XXX, 16); /* TODO(merwin): use PRIM_TRIANGLE_STRIP here */
 +              immVertex3fv(pos, near_plane[0]);
 +              immVertex3fv(pos, far_plane[0]);
 +              immVertex3fv(pos, far_plane[1]);
 +              immVertex3fv(pos, near_plane[1]);
 +
 +              immVertex3fv(pos, near_plane[1]);
 +              immVertex3fv(pos, far_plane[1]);
 +              immVertex3fv(pos, far_plane[2]);
 +              immVertex3fv(pos, near_plane[2]);
 +
 +              immVertex3fv(pos, near_plane[2]);
-               immVertex3fv(pos, near_plane[1]);
-               immVertex3fv(pos, far_plane[1]);
 +              immVertex3fv(pos, far_plane[2]);
-               immVertex3fv(pos, far_plane[0]);
-               immVertex3fv(pos, near_plane[0]);
++              immVertex3fv(pos, far_plane[3]);
 +              immVertex3fv(pos, near_plane[3]);
++
 +              immVertex3fv(pos, far_plane[3]);
++              immVertex3fv(pos, near_plane[3]);
++              immVertex3fv(pos, near_plane[0]);
++              immVertex3fv(pos, far_plane[0]);
 +              immEnd();
 +#endif
 +      }
 +      else {
 +              immBegin(PRIM_LINES, 8);
 +              for (int i = 0; i < 4; ++i) {
 +                      immVertex3fv(pos, near_plane[i]);
 +                      immVertex3fv(pos, far_plane[i]);
 +              }
 +              immEnd();
 +      }
  }
  
  static bool drawcamera_is_stereo3d(Scene *scene, View3D *v3d, Object *ob)