Commit Graph

23 Commits

Author SHA1 Message Date
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 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
Campbell Barton a05d4a729a remove deprecated & unused mat3_to_vec_rot and mat4_to_vec_rot functions. 2011-08-27 01:42:49 +00:00
Campbell Barton f1b42a129f add angle wrapping functions: angle_wrap_rad(), angle_wrap_deg().
use with mathutils.
2011-04-02 03:05:49 +00:00
Campbell Barton 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
Campbell Barton 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
Campbell Barton 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
Campbell Barton 86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
Campbell Barton 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
Campbell Barton b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
Campbell Barton 2fe940f8df Fix for snapping pose bones with axis-angle rotation.
- armature_mat_pose_to_bone() was missing axis-angle check.
- added loc_axisangle_size_to_mat4() for completeness.
- use 'const' prefix where possible in math rotation functions.
2010-10-22 03:56:50 +00:00
Campbell Barton 65b0893df0 bugfix [#21483] Twisting when Dupliframing a Surface Circle (Nurbs) along a Curve.
use the curve's twist for follow path constraint and parent-path.
2010-10-08 07:29:08 +00:00
Campbell Barton c6e2e7aa93 move tracking functions into math_rotation.c (no functional changes) 2010-10-08 02:08:11 +00:00
Janne Karhu b57e09544a Fix for [#21875] Copy rotation only on y axies 2010-09-24 17:49:33 +00:00
Campbell Barton c04850ec06 python mathutils change
quat * quat was returning the dot product (a float), rather then the cross product.
 Use BLI_math's mul_qt_qtqt() function.
2010-08-02 00:08:01 +00:00
Campbell Barton e4a7087982 bugfix [#22836] Alt+MMB view alignment don't respect all axes directions
also moved rotation_between_quats_to_quat into BLI_math from python mathutils.
2010-07-26 00:11:14 +00:00
Campbell Barton 3afd8d6cc8 move camera lens/angle conversion to BLI_math 2010-04-17 08:55:31 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton fde4686d77 barycentric transform utility geometry function.
From 2 triangles and 1 point, the relative position between the point and the first triangle is applied to the second triangle to find the target point.
the barycentric weights are calculated in 2D space with a signed area so values outside the triangle bounds are supported.

wrapped by python:
 pt_to = Geometry.BarycentricTransform(pt_from, t1a, t1b, t1c, t2a, t1b, t1c)

NOTE: 
- moved some barycentric weight functions out of projection painting into the math lib.
- ended up making some of the math functions use const args.
TODO:
- support exceptional cases. zero area tries and similar.
2009-12-27 01:32:58 +00:00
Brecht Van Lommel 4617bb68ba Math Lib
* Pre-conversion commit removing old arithb.c code, this will not compile,
  next commit fixes that.
2009-11-10 20:40:18 +00:00
Brecht Van Lommel 385875632d Math Lib
* Fix remaining issues before conversion.
* Inline various vector functions, currently enabled for all platforms.
  I expect this to work in GCC/MSVC at least, if other platforms don't
  support it, #ifdef's can be added.
2009-11-10 19:13:05 +00:00
Brecht Van Lommel 60ea745613 Math Lib Reorganization
* New header and source files.
* Still need a few tweaks before switching code to use them.
2009-11-09 22:42:41 +00:00