Commit Graph

60 Commits

Author SHA1 Message Date
4dd552fef9 patch [#31104] Correct comment for mul_qt_v3
from Bill Currie (taniwha)
2012-04-28 11:45:28 +00:00
950ed69297 code cleanup:
- replace inline face UV center calc.
- use const float[3] for mesh and uv functions.
- remove unused define
2012-04-28 08:29:20 +00:00
d2d2b8c2f2 code cleanup: replace inline axis angle conversion with axis_angle_to_mat3() 2012-04-02 06:43:16 +00:00
3f56ee3da7 style cleanup: issues missed last commit 2012-03-25 15:56:17 +00:00
53d32a0bd2 style cleanup: conform to style guide - mostly operator whitespace changes 2012-03-25 12:41:58 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
f6ae27daef style cleanup - comment spelling + translate some dutch. 2012-03-04 04:35:12 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
ed04c21374 code cleanup: use float vector size in function definitions, and const's where the values are unchanged. 2012-02-28 14:05:00 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
a98a75346c quiet warnings and possible NULL checking crash fix for indentation functions. 2012-01-20 23:03:41 +00:00
3311164b24 Math lib: matrix multiplication order fix for two functions that were
inconsistent with similar functions & math notation:

mul_m4_m4m4(R, B, A) => mult_m4_m4m4(R, A, B)
mul_m3_m3m4(R, B, A) => mult_m3_m3m4(R, A, B)

For branch maintainers, it should be relatively simple to fix things manually,
it's also possible run this script after merging to do automatic replacement:
http://www.pasteall.org/27459/python
2011-12-16 19:53:12 +00:00
4924abaad6 replace fabs with fabsf where both input and output are floats. 2011-11-19 01:10:05 +00:00
094c9799f9 quiet -Wdouble-promotion warnings 2011-11-11 12:00:08 +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
0d63bb005f replace VECCOPY and QUATCOPY with inline funcs. 2011-10-28 12:40:15 +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
3a81f23e09 warning cleanup for -Wdouble-promotion 2011-08-19 16:21:29 +00:00
f1b42a129f add angle wrapping functions: angle_wrap_rad(), angle_wrap_deg().
use with mathutils.
2011-04-02 03:05:49 +00:00
59cdbfd884 math lib and UV project: floats were being implicitly promoted to doubles, adjust to use floats. 2011-03-27 15:54:20 +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
7900b5949f doxygen: blender/blenlib tagged. 2011-02-27 20:37:56 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
d17df68c24 - clear some warnings
- rename layout.operator_enums -> operator_enum (since we have operator_menu_enum, only called in 4 places)
2011-02-18 06:07:41 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +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
4cc4a73a9e feature request from colin levy, camera lens stamp. 2011-01-13 19:16:35 +00:00
e29ac3fc76 use prints rather then asserts when normalized quats are expected. 2010-12-08 09:57:21 +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
7e0f9229d6 fix for fix, r33086.
- incorrect range check broke ZYX euler rotations, use MIN/MAX constants so this doesn't happen again.
- BGE Armature PyAPI also wasn't using correct min/max with rotation modes.
- clamp on file read rather then when calling the rotation functions, so developers don't use invalid args without realizing it.
- added assert() checks for debug builds so invalid axis constants don't slip through.
2010-11-16 01:19:37 +00:00
e3ace7ee62 Bugfix, reported in IRC
The enum "rotmode" was read using an array, without checking for boundary
cases, causing crashes on bad input. (Wahooney report 2, thanks!)
2010-11-15 13:33:38 +00:00
369a5cc29e fix for compiling with the c90 standard, support for non-static variable initializers is a c99 feature. 2010-11-02 13:12:30 +00:00
90e9970094 change mat4_to_eulO, mat3_to_eulO to calculate 2 rotations and return the smallest one.
mat4_to_eul & mat3_to_eul are already working this way.

Without this we get problems with constraints, eg:
 rotation on the Y axis over 90d can be represented by setting the X and Z to -PI, Y would decrease to 0 (infact 180d).
2010-10-30 19:29:11 +00:00
082e9b329d Fix for [#24458] Problem with Axis Angle rotation
* Added checks to handle zero axis vector.
2010-10-30 17:42:08 +00:00
Nathan Letwory
6540bb1375 Add some missing const's 2010-10-22 10:17:55 +00:00
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
bcac1def4c eulO_to_quat wasn't functional for XZY, YXZ, ZYX rotation orders.
it also modified the input rotation value which isn't expected for these functions.
2010-10-22 03:27:01 +00:00
c79e054538 quat_apply_track had incomplete comments 2010-10-08 07:36:33 +00:00
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
5e232548d3 fix for error in track rotation, found while looking into adding an up axis to this function. 2010-10-08 03:50:01 +00:00
c6e2e7aa93 move tracking functions into math_rotation.c (no functional changes) 2010-10-08 02:08:11 +00:00
b57e09544a Fix for [#21875] Copy rotation only on y axies 2010-09-24 17:49:33 +00:00
728b713d86 use more BLI math functions. 2010-08-15 15:14:08 +00:00
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
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
708667c6f6 minor mathutils update
- docstring for Euler.rotate
- rotate_eul, use upper case in Py and C. 
- use less verbose repr method.
2010-04-25 03:34:16 +00:00
3afd8d6cc8 move camera lens/angle conversion to BLI_math 2010-04-17 08:55:31 +00:00