[Bf-blender-cvs] [680f95ab4d6] temp-T96710-pbvh-pixels: Rename to EncodedBarycentricWeights.

Jeroen Bakker noreply at git.blender.org
Mon Apr 4 13:22:58 CEST 2022


Commit: 680f95ab4d67ff5f73da4ddfe4c29e0c66c852ea
Author: Jeroen Bakker
Date:   Mon Apr 4 13:22:54 2022 +0200
Branches: temp-T96710-pbvh-pixels
https://developer.blender.org/rB680f95ab4d67ff5f73da4ddfe4c29e0c66c852ea

Rename to EncodedBarycentricWeights.

===================================================================

M	source/blender/blenkernel/BKE_pbvh.hh

===================================================================

diff --git a/source/blender/blenkernel/BKE_pbvh.hh b/source/blender/blenkernel/BKE_pbvh.hh
index 85980b9cba4..7927a057604 100644
--- a/source/blender/blenkernel/BKE_pbvh.hh
+++ b/source/blender/blenkernel/BKE_pbvh.hh
@@ -17,9 +17,9 @@
 namespace blender::bke::pbvh::pixels {
 
 /* TODO(jbakker): move encoders to blenlib. */
-class EncodedBarycentricCoord;
+class EncodedBarycentricWeights;
 
-/* Stores a barycentric coordinate in a float2. */
+/** Barycentric weights. */
 class BarycentricWeights {
  private:
   float3 weights;
@@ -54,15 +54,24 @@ class BarycentricWeights {
     return weights;
   }
 
-  friend class EncodedBarycentricCoord;
+  friend class EncodedBarycentricWeights;
 };
 
-class EncodedBarycentricCoord {
+/**
+ * Barycentric weights encoded into 2 floats.
+ *
+ * The third coordinate can be extracted as all 3 coordinates should sum up to 1.
+ * 
+ * \code{.cc}
+ * co[2] = 1.0 - co[0] - co[1]
+ * \endcode
+ */
+class EncodedBarycentricWeights {
  private:
   float2 encoded;
 
  public:
-  EncodedBarycentricCoord &operator=(const BarycentricWeights decoded)
+  EncodedBarycentricWeights &operator=(const BarycentricWeights decoded)
   {
     encoded = float2(decoded.weights.x, decoded.weights.y);
     return *this;
@@ -170,7 +179,7 @@ struct Triangles {
  */
 struct PixelsPackage {
   /** Barycentric coordinate of the first encoded pixel. */
-  EncodedBarycentricCoord start_barycentric_coord;
+  EncodedBarycentricWeights start_barycentric_coord;
   /** Image coordinate starting of the first encoded pixel. */
   ushort2 start_image_coordinate;
   /** Number of sequetial pixels encoded in this package. */



More information about the Bf-blender-cvs mailing list