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:
authorHans Goudey <h.goudey@me.com>2022-04-15 17:54:15 +0300
committerHans Goudey <h.goudey@me.com>2022-04-15 17:54:45 +0300
commit47d961a4b1c14b0cee2817de226ee356e711e146 (patch)
tree4c057b00b7eb82144e4acf12196b9bf33481e9a5 /source/blender/blenlib/BLI_math_rotation.hh
parente96a809a68ef40225d5eddfd790644538e171a8d (diff)
Fix: Apply tilt in curves data-block normals calculation
The ported normal calculation from ceed37fc5cbb466a0 neglected to use the tilt attribute to rotate the normals around the tangents. This commit adds that behavior back, adding a new math header file to avoid duplicating the rotation function for normalized axes. Differential Revision: https://developer.blender.org/D14655
Diffstat (limited to 'source/blender/blenlib/BLI_math_rotation.hh')
-rw-r--r--source/blender/blenlib/BLI_math_rotation.hh18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_rotation.hh b/source/blender/blenlib/BLI_math_rotation.hh
new file mode 100644
index 00000000000..e8b746b34df
--- /dev/null
+++ b/source/blender/blenlib/BLI_math_rotation.hh
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#pragma once
+
+/** \file
+ * \ingroup bli
+ */
+
+#include "BLI_math_vec_types.hh"
+
+namespace blender::math {
+
+/**
+ * Rotate the unit-length \a direction around the unit-length \a axis by the \a angle.
+ */
+float3 rotate_direction_around_axis(const float3 &direction, const float3 &axis, float angle);
+
+} // namespace blender::math