Age | Commit message (Collapse) | Author |
|
|
|
Automated using clang-tidy.
|
|
|
|
matrix inversion was changed in rB01c75c3765eb from own code to EIGEN
for performance reasons. EIGEN would return a zero matrix on failure
(resulting in the pivot always being at the object origin).
This brings back the "old" matrix inversion code (which has the benifit
of providing a partial solution which makes the local transform center
appear correct)
Reviewers: campbellbarton
Maniphest Tasks: T57767
Differential Revision: https://developer.blender.org/D4804
|
|
Unlike location and rotation, there is a meaningful definition of
overall/average scaling via the total change in the volume. This
adds an option to retrieve that via a single driver variable,
instead of having to use three and an expression.
Using the determinant to compute the volume scaling also allows
detecting flipping due to negative scale - this is impossible
to do via the three variable approach.
The volume_scale functions are added purely for code readability:
'volume scale factor' is easier to understand than determinant.
Differential Revision: https://developer.blender.org/D4803
|
|
|
|
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
|
|
Also, mul_m3_m3m4 was named incorrectly.
|
|
Use doxy references to function and enums,
also correct some names which became out of sync.
|
|
Previously B-Bone deformation mapped every vertex to just one
B-Bone segment. This results in abrupt transformation differences
between the sides of each threshold plane, reducing the quality
of B-Bone deformation and making the use of shape keys impractical.
This commit replaces this approach with a linear blend between
the two closest segment transformations, effectively representing
the B-Bone as two weight-blended plain bones for each vertex.
In order to distribute the interpolation more evenly along the
bone, segment matrices for deformation are now computed at points
between the segments and at the ends of the B-Bone. The computation
also uses the true tangents of the Bezier curve for the orientation.
The nodes at the end of the bone require some special handling to
deal with zero-length Bezier handles caused by a zero ease value.
The Copy Transforms constraint now also smoothly interpolates
rotation and scaling along the bone shape when enabled.
The initial version of the patch was submitted by @Sam200.
Differential Revision: https://developer.blender.org/D4635
|
|
|
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
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.
|
|
Avoids nasty code all over where such math is required, and
compilers can easily deal with such situation.
Don't prefer questionable micro-optimization which comes with
a cost of nasty actual logic code.
|
|
Prevents clang-format wrapping text before comments.
|
|
|
|
|
|
|
|
|
|
In some heavy rigs matrix inverse can be 10% of computation time. This
reduces it to 2% by using Eigen's optimized 4x4 matrix inverse and SSE
matrix multiplication.
|
|
|
|
|
|
Also use assert w/ rotate_m4.
|
|
|
|
|
|
Also remove duplicate & mismatching comments from grease-pencil header.
Keep comments close to implementation to avoid getting out of sync.
|
|
|
|
|
|
No need to have temp array storage, avoid 2x loops.
|
|
- 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'.
|
|
mul_v4_m4v3(r, M, v) means r = M * vec4(v, 1.0)
Based on rB194998766c65
|
|
Same as 5c6baf1ee9754e39392926cd077bb2097baf39b9 but for 3x3 matrices.
|
|
mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R.
This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM.
With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.
|
|
GPU_matrix needs this very soon, and it's good practice in general.
also sprinkled in some TODOs for later
|
|
- mul_v3_m3v3_db
- mul_m3_v3_db
- negate_v3_db
|
|
|
|
|
|
Many uses of matrices for rotation keep them normalized,
so no need to normalize each time.
|
|
|
|
|
|
Useful when we need to use the axis lengths too.
|
|
|
|
mat3_polar_decompose gives the right polar decomposition of given matrix,
as a pair (U, P) of matrices.
interp_m3_m3m3 uses that polar decomposition to perform a correct matrix interpolation,
even with non-uniformly scaled ones (where blend_m3_m3m3 would fail).
interp_m4_m4m4 just adds translation interpolation to the _m3 variant.
|
|
`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.
|
|
|
|
|
|
This also increases the tolerances in is_orthogonal / is_orthonormal functions,
which were much too low for practical purposes.
|
|
|