Multires: Correct function name, to match behavior
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 17 Jan 2019 10:17:15 +0000 (11:17 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 18 Jan 2019 11:29:53 +0000 (12:29 +0100)
source/blender/blenkernel/BKE_subdiv.h
source/blender/blenkernel/intern/subdiv_ccg.c
source/blender/blenkernel/intern/subdiv_inline.h

index 0d262b5..28efb15 100644 (file)
@@ -259,10 +259,11 @@ BLI_INLINE int BKE_subdiv_rotate_quad_to_corner(
         const float quad_u, const float quad_v,
         float *r_corner_u, float *r_corner_v);
 
-/* Inverse of above. */
-BLI_INLINE void BKE_subdiv_rotate_corner_to_quad(
+/* Converts (u, v) coordinate from within a grid to a quad coordinate in
+ * normalized ptex coordinates. */
+BLI_INLINE void BKE_subdiv_rotate_grid_to_quad(
         const int corner,
-        const float corner_u, const float corner_v,
+        const float grid_u, const float grid_v,
         float *r_quad_u, float *r_quad_v);
 
 #include "intern/subdiv_inline.h"
index a94df94..9802c8a 100644 (file)
@@ -227,7 +227,7 @@ static void subdiv_ccg_eval_regular_grid(CCGEvalGridsData *data,
                        for (int x = 0; x < grid_size; x++) {
                                const float grid_u = (float)x * grid_size_1_inv;
                                float u, v;
-                               BKE_subdiv_rotate_corner_to_quad(
+                               BKE_subdiv_rotate_grid_to_quad(
                                        corner, grid_u, grid_v, &u, &v);
                                const size_t grid_element_index = (size_t)y * grid_size + x;
                                const size_t grid_element_offset =
index 1863c86..b779cee 100644 (file)
@@ -77,27 +77,27 @@ BLI_INLINE int BKE_subdiv_rotate_quad_to_corner(
        return corner;
 }
 
-BLI_INLINE void BKE_subdiv_rotate_corner_to_quad(
+BLI_INLINE void BKE_subdiv_rotate_grid_to_quad(
         const int corner,
-        const float corner_u, const float corner_v,
+        const float grid_u, const float grid_v,
         float *r_quad_u, float *r_quad_v)
 {
        if (corner == 0) {
-               *r_quad_u = 0.5f - corner_v * 0.5f;
-               *r_quad_v = 0.5f - corner_u * 0.5f;
+               *r_quad_u = 0.5f - grid_v * 0.5f;
+               *r_quad_v = 0.5f - grid_u * 0.5f;
        }
        else if (corner == 1) {
-               *r_quad_u = 0.5f + corner_u * 0.5f;
-               *r_quad_v = 0.5f - corner_v * 0.5f;
+               *r_quad_u = 0.5f + grid_u * 0.5f;
+               *r_quad_v = 0.5f - grid_v * 0.5f;
        }
        else if (corner == 2) {
-               *r_quad_u = 0.5f + corner_v * 0.5f;
-               *r_quad_v = 0.5f + corner_u * 0.5f;
+               *r_quad_u = 0.5f + grid_v * 0.5f;
+               *r_quad_v = 0.5f + grid_u * 0.5f;
        }
        else {
                BLI_assert(corner == 3);
-               *r_quad_u = 0.5f - corner_u * 0.5f;
-               *r_quad_v = 0.5f + corner_v * 0.5f;
+               *r_quad_u = 0.5f - grid_u * 0.5f;
+               *r_quad_v = 0.5f + grid_v * 0.5f;
        }
 }