diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-16 19:01:32 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-16 19:46:35 +0300 |
commit | 1b4916054e0c95f24949dc5c0bf6dbcd4bce4f2f (patch) | |
tree | f34f6eee0876cfced986ae277489fa2b5b21bb1c /source/blender/draw/intern/draw_cache.c | |
parent | f785fb299a058b1dec333657b77bdad5daf6a32e (diff) |
Armature: Cleanup: Remove unused function and use less silly wire drawing.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 639e4edb32f..7fa21cb209b 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -1650,37 +1650,6 @@ Gwn_Batch *DRW_cache_bone_octahedral_get(void) return SHC.drw_bone_octahedral; } -Gwn_Batch *DRW_cache_bone_octahedral_wire_outline_get(void) -{ - if (!SHC.drw_bone_octahedral_wire) { - uint v_idx = 0; - - static Gwn_VertFormat format = { 0 }; - static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { - attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - } - - /* Vertices */ - Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(vbo, 12 * 2); - - for (int i = 0; i < 12; i++) { - const float *co1 = bone_octahedral_verts[bone_octahedral_wire[i * 2]]; - const float *co2 = bone_octahedral_verts[bone_octahedral_wire[i * 2 + 1]]; - const float *n1 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i * 2]]; - const float *n2 = bone_octahedral_solid_normals[bone_octahedral_wire_adjacent_face[i * 2 + 1]]; - add_fancy_edge(vbo, attr_id.pos, attr_id.n1, attr_id.n2, &v_idx, co1, co2, n1, n2); - } - - SHC.drw_bone_octahedral_wire = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO); - } - return SHC.drw_bone_octahedral_wire; -} - - /* XXX TODO move that 1 unit cube to more common/generic place? */ static const float bone_box_verts[8][3] = { { 1.0f, 0.0f, 1.0f}, @@ -1820,64 +1789,6 @@ Gwn_Batch *DRW_cache_bone_box_get(void) return SHC.drw_bone_box; } -Gwn_Batch *DRW_cache_bone_box_wire_outline_get(void) -{ - if (!SHC.drw_bone_box_wire) { - uint v_idx = 0; - - static Gwn_VertFormat format = { 0 }; - static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { - attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - } - - /* Vertices */ - Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(vbo, 12 * 2); - - for (int i = 0; i < 12; i++) { - const float *co1 = bone_box_verts[bone_box_wire[i * 2]]; - const float *co2 = bone_box_verts[bone_box_wire[i * 2 + 1]]; - const float *n1 = bone_box_solid_normals[bone_box_wire_adjacent_face[i * 2]]; - const float *n2 = bone_box_solid_normals[bone_box_wire_adjacent_face[i * 2 + 1]]; - add_fancy_edge(vbo, attr_id.pos, attr_id.n1, attr_id.n2, &v_idx, co1, co2, n1, n2); - } - - SHC.drw_bone_box_wire = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO); - } - return SHC.drw_bone_box_wire; -} - - -Gwn_Batch *DRW_cache_bone_wire_wire_outline_get(void) -{ - if (!SHC.drw_bone_wire_wire) { - uint v_idx = 0; - - static Gwn_VertFormat format = { 0 }; - static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { - attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - } - - /* Vertices */ - Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(vbo, 2); - - const float co1[3] = {0.0f, 0.0f, 0.0f}; - const float co2[3] = {0.0f, 1.0f, 0.0f}; - const float n[3] = {1.0f, 0.0f, 0.0f}; - add_fancy_edge(vbo, attr_id.pos, attr_id.n1, attr_id.n2, &v_idx, co1, co2, n, n); - - SHC.drw_bone_wire_wire = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO); - } - return SHC.drw_bone_wire_wire; -} - /* Helpers for envelope bone's solid sphere-with-hidden-equatorial-cylinder. * Note that here we only encode head/tail in forth component of the vector. */ static void benv_lat_lon_to_co(const float lat, const float lon, float r_nor[3]) |