Armature: Cleanup: Remove unused function and use less silly wire drawing.
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user