Commit Graph

121 Commits

Author SHA1 Message Date
909fa34c5f BLI_matrix space_transform: Add a 'local-invariant' setter.
`BLI_space_transform_from_matrices()` defines a 'global-invariant' transform
(same point in global space, two different coordinates in local and target spaces).

New `BLI_space_transform_global_from_matrices()` is kind of opposite, it defines
a 'local-invariant' transform (two different points in global space, same coordinates in local and target spaces).

Useful to 'match' meshes.
2015-07-11 00:04:27 +02:00
52b9d83417 Fix T44592: Zero scale on an axis, zeros all 2015-05-04 22:39:33 +10:00
c19f3ea1b2 Fixed comment. 2015-05-04 14:31:44 +02:00
b6caefdaa9 Fix T43711: dual quaternion deform bug with shearing in deform matrix.
This also increases the tolerances in is_orthogonal / is_orthonormal functions,
which were much too low for practical purposes.
2015-05-01 19:21:41 +02:00
9dadc8f599 Math Lib: add mul_v3_mat3_m4v3 2015-04-27 21:52:42 +10:00
9c782c17ba Cleanup: hopefully last int->bool one in this area! 2014-12-01 17:11:55 +01:00
1cb59394ae Cleanup: use const, avoid float -> double in matrix invert 2014-11-29 17:49:38 +01:00
25c5542fe7 Math Lib: add constant: M_SQRT1_3 1/sqrt(3) 2014-11-22 18:21:52 +01:00
af9da0be43 Complementary fix for rB8054372: Follow the common naming scheme by
using negate_mat3_m4 instead of negate_m4.

This avoids changing the behavior and only flips the 3x3 part of the
matrix.
2014-10-30 15:31:18 +01:00
be63ba315f Math Lib: pseudoinverse_m4_m4 changed input matrix 2014-10-30 14:49:57 +01:00
c2dc51d827 Math Lib: add transpose_m3_m3, m3_m4, m4_m4 2014-10-30 12:15:14 +01:00
0414ed1c48 Fix for mat3_to_rot_size modifying input matrix 2014-10-30 10:37:55 +01:00
8054372d22 Fix negate_m3 (taking 4x4 matrix)
Cycles bake used incorrectly.
2014-10-30 10:29:37 +01:00
775a54485b Math Lib: add mul_v3_project_m4_v3 2014-09-16 15:41:17 +10:00
671f75a12a Math Lib: Add copy_m2_m2, unit_m2, zero_m2 2014-09-06 11:29:27 +10:00
eadfddd02a Cleanup: magic numbers 2014-08-12 15:58:53 +10:00
3c9e11df37 Cleanup: Move SpaceTransform helpers from BKE_shrinkwrap to BLI_math_matrix. 2014-08-01 16:31:06 +02:00
74758576fc Cleanup: general cleanup in BLI_math code (mostly, use 'const' where possible, true/false for booleans, format for float litterals). 2014-07-30 12:19:41 +02:00
8489b94e07 Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-21 18:57:35 +10:00
6f1f5771ff Correction to 7c7b730, multiplication order was flipped
That's really annoying that multiplication order is flipped
comparing mat3 and mat4 cases, but for the purposes of not
breaking all the branches which might use this stuff we'd
better keep order consistent with old version for now.

Suggestion here would be to make order consistent but rename
this functions to mult_* to make compilation fail instead
of failing and using wrong order silently.
2014-07-20 20:44:42 +06:00
7c7b7302d3 Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing NULL's) 2014-07-20 14:01:42 +10:00
b2cad79500 Math lib: add negate_m3, negate_m4 2014-05-30 00:26:32 +10:00
Dalai Felinto
7f089afc8b Bake-API: relaxing in the check for scale uniformity
It still warns the user that there may be an error, but the baking goes
on. Also using the new is_uniform_scaled_m4() instead of float comparison.

Reported and fix suggested by Campbell Barton as a concern over 2bfc3deb
2014-05-22 21:35:58 -03:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
b7dbb2f48e Correction to the previous commit 2014-03-25 16:22:47 +06:00
d4cc81d552 Fix T38870: Freezes when jumping in front of a keyframe.
Issue was caused by inverting a degenerate matrix when
evaluating drivers.

Solved by using tweaked inverse code (same as used in Cycles).

Should have no affect on cases when matrix is not degenerate.
2014-03-25 16:07:13 +06:00
798e684c7c Math lib: simplify size_to_mat4 and use in b_bone_spline_setup 2014-02-02 02:24:47 +11:00
99d050f88b Text3d: selection in editmode now follows rotated text along path 2014-01-05 22:20:33 +11:00
07ceb99213 Code Cleanup: use strict flags for math lib, add inline declarations 2013-12-06 03:57:17 +11:00
f3d13bec6d Code Cleanup: correct fabsf/fabs/abs use 2013-12-04 09:24:38 +11:00
a304b5a988 correct typo 2013-10-25 22:12:05 +00:00
e9d5e9813c Code cleanup: added generic function copt_m3_m3d 2013-10-20 12:08:51 +00:00
fc8b0ed5e5 Move utility functions from mball to mathutils 2013-10-18 23:38:51 +00:00
9b09af0dca Fix #36701: Mask pivioting doesnt honor parenting
Made mask transformation aware of parent matrix.
2013-09-11 10:06:54 +00:00
8d6e5606d8 Add assert to mul_v3_m3v3 and mul_v2_m3v3,
So they're not likely to be called with bad arguments.
2013-08-06 02:37:02 +00:00
76e989d7b1 function renaming for own recently added BLI_math functions, suggested by Brecht. 2013-07-30 10:58:36 +00:00
5dc3cfc983 fix [#36282] Spin error with non uniform scale
add support for passing object matrix to bmesh transform operators.
2013-07-26 11:15:22 +00:00
29df776b89 optimization: call one bmesh operator for rotate (not 3).
added pivot_m4() utility function since rotating about an arbitrary point is handy.
2013-07-26 06:12:49 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
7430701600 correct own incorrect check bmesh edgerin subdivide, also add missing break in orthogonalize_m3 though this one wouldn't effect release builds. 2013-07-16 11:39:48 +00:00
d522a995cf fix for orthogonalize_m3,4, missing break statements in switch. 2013-07-13 06:54:44 +00:00
3d13f22e89 no need to copy mat4x4 -> 3x3 in mat4_to_scale 2013-07-10 12:12:58 +00:00
ec8d277c64 BLI_math rename functions:
- mult_m4_m4m4 -> mul_m4_m4m4
- mult_m3_m3m4 -> mul_m3_m3m4

these temporary names were used to avoid problems when argument order was switched.
2013-05-26 18:36:25 +00:00
877e0e1184 Fix #35319: python 2x2 matrix inverse and adjugate were wrong. 2013-05-12 09:26:02 +00:00
89c8de1f48 add matrix multiply for projection that outputs 2d values. 2013-05-08 12:55:36 +00:00
4a7feafa49 Support object scale for mesh display options. (currently only uniform scale for thickness test) 2013-04-17 23:30:19 +00:00
ae58968e0a Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.

When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)

- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
  works for non-raytrace scenes, or zoom in ortho or camera mode, or for 
  Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
  re-render yet.

Tech notes:

- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.

- Fixed some bugs that were noticable with such excessive re-renders, like 
  for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
2433404e4b add inline function mul_project_m4_v3_zfac() to get the z-depth value from a vector & mat4x4 2013-03-09 15:39:24 +00:00
7961147a59 code cleanup: was using var named 'in' for output. 2013-03-09 11:55:12 +00:00
abd1748e48 code cleanup: move runtime var zfac out of RegionView3D. rename initgrabz() -> ED_view3d_calc_zfac() and have it return the zfac to use. 2013-03-09 11:40:42 +00:00