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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-01 17:12:54 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-01 17:20:50 +0300
commitd710cb91b9281e94851bddc8b49b570dc6326b5f (patch)
tree1dcca4ff99b327ce0eaf21715b5986082ac5e540 /source/blender/blenkernel/intern/multires_reshape.c
parentc2aa8d03f26ceb2700730e5aeb2c72ccfa969116 (diff)
Subdiv: Cleanup, de-duplicate tangent matrix calculation
Diffstat (limited to 'source/blender/blenkernel/intern/multires_reshape.c')
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index d99e8486738..22605eb510a 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -86,37 +86,6 @@ BLI_INLINE int rotate_quad_to_corner(const float u, const float v,
return corner;
}
-BLI_INLINE void construct_tangent_matrix(float tangent_matrix[3][3],
- const float dPdu[3],
- const float dPdv[3],
- const int corner)
-{
- if (corner == 0) {
- copy_v3_v3(tangent_matrix[0], dPdv);
- copy_v3_v3(tangent_matrix[1], dPdu);
- mul_v3_fl(tangent_matrix[0], -1.0f);
- mul_v3_fl(tangent_matrix[1], -1.0f);
- }
- else if (corner == 1) {
- copy_v3_v3(tangent_matrix[0], dPdu);
- copy_v3_v3(tangent_matrix[1], dPdv);
- mul_v3_fl(tangent_matrix[1], -1.0f);
- }
- else if (corner == 2) {
- copy_v3_v3(tangent_matrix[0], dPdv);
- copy_v3_v3(tangent_matrix[1], dPdu);
- }
- else if (corner == 3) {
- copy_v3_v3(tangent_matrix[0], dPdu);
- copy_v3_v3(tangent_matrix[1], dPdv);
- mul_v3_fl(tangent_matrix[0], -1.0f);
- }
- cross_v3_v3v3(tangent_matrix[2], dPdu, dPdv);
- normalize_v3(tangent_matrix[0]);
- normalize_v3(tangent_matrix[1]);
- normalize_v3(tangent_matrix[2]);
-}
-
static void multires_reshape_init_mmd(
MultiresModifierData *reshape_mmd,
const MultiresModifierData *mmd)
@@ -364,7 +333,8 @@ static void multires_reshape_vertex_from_final_data(
float D[3];
sub_v3_v3v3(D, final_P, P);
float tangent_matrix[3][3];
- construct_tangent_matrix(tangent_matrix, dPdu, dPdv, grid_corner);
+ BKE_multires_construct_tangent_matrix(
+ tangent_matrix, dPdu, dPdv, grid_corner);
float inv_tangent_matrix[3][3];
invert_m3_m3(inv_tangent_matrix, tangent_matrix);
float tangent_D[3];