Differential D16893 Diff 59975 source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_pos.cc
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static void extract_fdots_pos_iter_poly_mesh(const MeshRenderData *mr, | ||||
| const MPoly *mp, | const MPoly *mp, | ||||
| const int mp_index, | const int mp_index, | ||||
| void *data) | void *data) | ||||
| { | { | ||||
| float(*center)[3] = *static_cast<float(**)[3]>(data); | float(*center)[3] = *static_cast<float(**)[3]>(data); | ||||
| float *co = center[mp_index]; | float *co = center[mp_index]; | ||||
| zero_v3(co); | zero_v3(co); | ||||
| const MLoop *mloop = mr->mloop; | |||||
| const BLI_bitmap *facedot_tags = mr->me->runtime->subsurf_face_dot_tags; | const BLI_bitmap *facedot_tags = mr->me->runtime->subsurf_face_dot_tags; | ||||
| const int ml_index_end = mp->loopstart + mp->totloop; | const int ml_index_end = mp->loopstart + mp->totloop; | ||||
| for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | ||||
| const MLoop *ml = &mloop[ml_index]; | const int vert = mr->corner_verts[ml_index]; | ||||
| if (mr->use_subsurf_fdots) { | if (mr->use_subsurf_fdots) { | ||||
| if (BLI_BITMAP_TEST(facedot_tags, ml->v)) { | if (BLI_BITMAP_TEST(facedot_tags, vert)) { | ||||
| copy_v3_v3(center[mp_index], mr->vert_positions[ml->v]); | copy_v3_v3(center[mp_index], mr->vert_positions[vert]); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| add_v3_v3(center[mp_index], mr->vert_positions[ml->v]); | add_v3_v3(center[mp_index], mr->vert_positions[vert]); | ||||
| } | } | ||||
| } | } | ||||
| if (!mr->use_subsurf_fdots) { | if (!mr->use_subsurf_fdots) { | ||||
| mul_v3_fl(co, 1.0f / float(mp->totloop)); | mul_v3_fl(co, 1.0f / float(mp->totloop)); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||