Commit Graph

63 Commits

Author SHA1 Message Date
638938e5a8 Armature: remove remains of the object-level deformation data cache.
Now that B-Bone shape data is kept in bPoseChannel_Runtime, the
armature level cache only holds one quaternion value per bone.
It can also be moved to runtime, and the structure removed.

This has an additional effect that, as far as I can tell, now
the Armature modifier can run as soon as all of the bones it
actually needs are done, thus making T59848 a purely depsgraph
level problem.
2019-04-18 23:19:44 +03:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
e2ec045cc9 BLI_math: add utility to calculate compatible quaternions 2019-03-19 16:54:37 +11:00
213ac7b1ac Cleanup: use const args for BLI_math_rotation 2019-02-25 23:18:55 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
02f083cdce BLI_math_rotation: properly name the quaternion power function.
"angular mult factor" is a completely unintelligible description
for a function that raises a unit quaternion to the scalar power.
2018-12-23 15:28:32 +03:00
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
7a58ff928c Math Lib: signed versions of quaternion angle
There was no simple way to get the shortest quaternion angle.
2017-12-19 14:03:29 +11:00
d7f33668d6 Math Lib: Add mat3_from_axis_conversion_single
Single axis version of mat3_from_axis_conversion,
when the second axis isn't important (orienting an arrow for eg).
2017-06-09 19:31:27 +10:00
e1e49fd1a8 Math Lib: rotate matrix cleanup
- Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix
  duplicating 'angle_to_mat2' - now used instead.
  (better avoid matching functions having different behavior).

- Add 'axis_angle_to_mat4_single',
  convenience wrapper for 'axis_angle_to_mat3_single'.

- Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'.
2016-11-25 16:39:34 +11:00
fbca69c69a BLI_math: add mat3_normalized_to_* functions
Many uses of matrices for rotation keep them normalized,
so no need to normalize each time.
2015-10-24 07:02:51 +11:00
9d8a01dba1 BLI_math: add invert_qt_normalized
When the quat is known to be unit length, so we can avoid scaling
(just conjugate_qt which asserts on non unit quats).
2015-10-24 03:51:00 +11:00
80470b639c BLI_math: axis_angle_to_quat_single
Useful to avoid defining a vector for an axis-aligned rotation.
Matches axis_angle_to_mat3_single behavior.
2015-10-23 03:09:28 +11:00
9fa628f35b mathutils: added exponential map to Quaternion
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.

Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.

Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.

Reviewers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1049
2015-02-01 13:06:00 +01:00
f77207b1c3 Math Lib: faster version of rotation_between_vecs_to_mat3
Use axis/angle calculation but avoid calls to sin/cos
2014-04-20 20:56:40 +10:00
fabc46b41f Math Lib: add rotation_between_vecs_to_mat3
- behaves like rotation_between_vecs_to_quat
- avoids calling sin,cos calls (approx 1.6x faster).
2014-04-19 15:36:47 +10:00
55f83e36cc Py API: Vector.slerp(). also added interp_v3_v3v3_slerp(_safe) functions 2014-03-31 13:28:37 +11:00
a6e8137983 Convenience macro for print_ funcs, saves passing id each time 2014-03-30 15:04:20 +11:00
c6252d6e60 Math Lib: add angle_qt functions 2014-03-20 15:15:29 +11:00
b5d6f14290 Fix T38858: Crazy spaces was unpredictable with co-linear edges 2014-02-27 12:28:40 +11:00
5fce3457b7 Math lib: add axis_angle_normalized_to_quat, use when length is known 2014-02-02 02:24:47 +11:00
ab8d88ac18 add angle_to_mat2 utility function. 2013-09-10 20:45:47 +00:00
2e2ea1ae21 set function args in BLI_math_rotation as const where possible. 2013-08-23 09:46:11 +00:00
adba695209 remove vec_rot_to_mat3(), replace with axis_angle_normalized_to_mat3() 2013-06-22 23:58:52 +00:00
59ca83c3a9 rename axis_angle_to_mat3_no_norm() --> axis_angle_normalized_to_mat3().
this matches closer to convention from existing functions - angle_v3v3() angle_normalized_v3v3().

also added assert to ensure argument given to axis_angle_normalized_to_mat3() is in fact normalized.
2013-04-15 15:16:11 +00:00
f6604f7612 New implementation for twist brushes.
It has much better rotation and avoids the compression effect that old
twist brushes have. Also twisting is now non periodic, meaning you can
twist beyond 180 degrees. The amount of twist is also calculated
relative to the angle formed after first translating the mouse away from
the brush center.
2013-04-15 14:55:42 +00:00
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
c68d5325d0 fix for [#34283] wasn't working in my tests (attached to original report),
made bone roll get compatible angle values with the original roll.
2013-02-19 04:37:28 +00:00
caac27dcbc mesh-cache deform modifier,
supports MDD and PC2 formats.

see wiki docs:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modifiers/Deform/Mesh_Cache
2013-01-21 15:41:00 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
b0bf816ece fix [#32646] Duplifaces can have wrong orientation with ngons
concave ngons could flip the dupliface, now use the faces normal when calculating the dupli-face.
2012-09-25 00:20:42 +00:00
32e4e0f873 add conjugate_qt_qt(), also some code cleanup and use const for 'rotOrders' var in math_rotation.c 2012-08-25 17:42:15 +00:00
71d1b09708 minor code cleanup 2012-08-25 12:55:14 +00:00
513aec7687 code cleanup: remove unused math functions (where already noted as deprecated) 2012-07-22 17:49:56 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
4ea816837d Configurable sensor size:
- Added support of variable size sensor width and height.
- Added presets for most common cameras, also new presets can be defined by user.
- Added option to control which dimension (vertical or horizontal) of sensor
  size defines FOV. Old behavior of automatic FOV calculation is also kept.
- Renderer, viewport, game engine and collada importer/exporter should
  deal fine with this changes. Other exporters would be updated soon.
2011-11-04 14:36:06 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
9d3b1f708f Move function out of mathutils to: BLI_math_rotation --- single_axis_angle_to_mat3(mat3, axis, angle), copied out from mathutils, axis arg is a char 'X/Y/Z' rather then a vector like axis_angle_to_mat3(). 2011-09-19 13:08:01 +00:00
a05d4a729a remove deprecated & unused mat3_to_vec_rot and mat4_to_vec_rot functions. 2011-08-27 01:42:49 +00:00
f1b42a129f add angle wrapping functions: angle_wrap_rad(), angle_wrap_deg().
use with mathutils.
2011-04-02 03:05:49 +00:00
8d7c3f8a7e interface: floats were being implicitly promoted to doubles, adjust to use floats (in most cases) otherwise cast to double. 2011-03-27 14:52:16 +00:00
c7609a27b3 remove unused RegionView3D retopo pointer and set quat printing to const args. 2011-03-08 07:31:42 +00:00
Nathan Letwory
b97ad119b9 doxygen: add blenlib under core as module. 2011-02-18 13:58:08 +00:00
95df65f1b5 - some parts of the code to remove rotation were not removing axis/angle rotation (only functional change of this commit).
- use BLI_math functions for removing rotations from objects and pose channels.
- add unit_axis_angle() to avoid setting the Y axis inline anywhere rotation needs removing.
2011-02-02 00:40:55 +00:00
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
48614fbc2a Added an assert() check for normalized quats which exposed a number of bugs where normalized quat was incorrectly assumed.
This would have made bug #25003 very simple to find.

- Objects had their quats normalized when calculating their matrix, this is inconstant with pose bones and isn't useful for animation.
  Also it wasn't normalizing the delta rotation so these would give bad rotations.

- Converting between rotation modes BKE_rotMode_change_values() assumed normal length quat. changing quat to euler rotation for eg could change the bone.

- Clear rotation and transform were not normalizing the quat when 4d loc was disabled on quat rotation, corrected and also made it so the quat scale is restored after conversion so animations curves dont jump.

There is 1 case in mat3_to_quat_is_ok() where quat_to_mat3 on an unnormalized quat is needed, for this I had to add an ugly static function quat_to_mat3_no_assert(), but overall its worthwhile IMHO to be able to find incorrect use of rotation conversion.
2010-12-07 01:56:32 +00:00