Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2022-04-12 09:42:16 +0300
committerJeroen Bakker <jeroen@blender.org>2022-04-12 09:42:16 +0300
commit10509846db8a7288d3dfeb293ffc24d7217502af (patch)
tree1fb6b705a7ca2f4894831dc15c12d8e189d9f49f
parentca7d7e02c3f58ad9d7ac742c5bef04df18f7f31c (diff)
Remove Triangle struct.
-rw-r--r--source/blender/blenkernel/BKE_pbvh_pixels.hh19
-rw-r--r--source/blender/blenkernel/intern/pbvh_pixels.cc8
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_paint_image.cc4
3 files changed, 10 insertions, 21 deletions
diff --git a/source/blender/blenkernel/BKE_pbvh_pixels.hh b/source/blender/blenkernel/BKE_pbvh_pixels.hh
index e04724e909b..9b953dbee58 100644
--- a/source/blender/blenkernel/BKE_pbvh_pixels.hh
+++ b/source/blender/blenkernel/BKE_pbvh_pixels.hh
@@ -34,21 +34,12 @@ struct EncodedLoopIndices {
}
};
-struct Triangle {
- int3 loop_indices;
- int3 vert_indices;
- int poly_index;
- float3 add_barycentric_coord_x;
-};
-
struct TrianglePaintInput {
int3 vert_indices;
float3 add_barycentric_coord_x;
float3 add_barycentric_coord_y;
- TrianglePaintInput(const Triangle &triangle)
- : vert_indices(triangle.vert_indices),
- add_barycentric_coord_x(triangle.add_barycentric_coord_x)
+ TrianglePaintInput(const int3 vert_indices) : vert_indices(vert_indices)
{
}
};
@@ -73,11 +64,11 @@ struct Triangles {
Vector<EncodedLoopIndices> loop_indices;
public:
- void append(const Triangle &triangle)
+ void append(const int3 vert_indices, const EncodedLoopIndices loop_indices, const int poly_index)
{
- paint_input.append(TrianglePaintInput(triangle));
- loop_indices.append(triangle.loop_indices);
- poly_indices.append(triangle.poly_index);
+ this->paint_input.append(TrianglePaintInput(vert_indices));
+ this->loop_indices.append(loop_indices);
+ this->poly_indices.append(poly_index);
}
int3 get_loop_indices(const int index) const
diff --git a/source/blender/blenkernel/intern/pbvh_pixels.cc b/source/blender/blenkernel/intern/pbvh_pixels.cc
index 1443d30240a..ad8b810fdbc 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels.cc
@@ -147,11 +147,9 @@ static void init_triangles(PBVH *pbvh,
const MPoly *p = &mpoly[poly_index];
const MLoop *loopstart = &mloop[p->loopstart];
for (int l = 0; l < p->totloop - 2; l++) {
- Triangle triangle;
- triangle.loop_indices = int3(p->loopstart, p->loopstart + l + 1, p->loopstart + l + 2);
- triangle.vert_indices = int3(loopstart[0].v, loopstart[l + 1].v, loopstart[l + 2].v);
- triangle.poly_index = poly_index;
- node_data->triangles.append(triangle);
+ node_data->triangles.append(int3(loopstart[0].v, loopstart[l + 1].v, loopstart[l + 2].v),
+ int3(p->loopstart, p->loopstart + l + 1, p->loopstart + l + 2),
+ poly_index);
}
}
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index 1530501b628..9414da42c58 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -261,7 +261,7 @@ template<typename ImagePixelAccessor> class PaintingKernel {
return result - start_pixel;
}
- Pixel init_pixel(const TrianglePaintInput &triangle, const BarycentricWeights &weights) const
+ Pixel init_pixel(const TrianglePaintInput &triangle, const float3 &barycentric_weights) const
{
const int3 &vert_indices = triangle.vert_indices;
Pixel result;
@@ -269,7 +269,7 @@ template<typename ImagePixelAccessor> class PaintingKernel {
mvert[vert_indices[0]].co,
mvert[vert_indices[1]].co,
mvert[vert_indices[2]].co,
- weights);
+ barycentric_weights);
return result;
}
};