aboutsummaryrefslogtreecommitdiff
path: root/core/math/matrix3.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #19193 from tagcup/quat_normJuan Linietsky2018-06-251-6/+18
|\ | | | | Fixed Basis -> Quat conversions, added a few safety checks.
| * Fixed Basis -> Quat conversions, added a few safety checks.tagcup2018-05-271-6/+18
| | | | | | | | Fixes #19027.
* | Style: Apply clang-format (5.0) to some missed filesRémi Verschelde2018-05-311-1/+1
|/
* Add SLERP to Vector{2,3}, optimize Quat's Vector3 rotation.tagcup2018-05-121-0/+13
| | | | Also even out Basis and Quat APIs a little.
* Avoid converting Quat to Euler angles when not necessary.tagcup2018-04-141-2/+61
| | | | | | | | Also ensure that get_scale doesn't arbitrarlity change the signs of scales, ensuring that the combination of get_rotation and get_scale gives the correct basis. Added various missing functions and constructors. Should close #17968.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Merge pull request #15083 from tagcup/spatial_rot_fixJuan Linietsky2018-01-021-2/+15
|\ | | | | Restore the behavior of Spatial rotations recently changed in c1153f5.
| * Restore the behavior of Spatial rotations recently changed in c1153f5.tagcup2017-12-271-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | That change was borne out of a confusion regarding the meaning of "local" in #14569. Affine transformations in Spatial simply correspond to affine operations of its Transform. Such operations take place in a coordinate system that is defined by the parent Spatial. When there is no parent, they correspond to operations in the global coordinate system. This coordinate system, which is relative to the parent, has been referred to as the local coordinate system in the docs so far, but this sloppy language has apparently confused some users, making them think that the local coordinate system refers to the one whose axes are "painted" on the Spatial node itself. To avoid such conceptual conflations and misunderstandings in the future, the parent-relative local system is now referred to as "parent-local", and the object-relative local system is called "object-local" in the docs. This commit adds the functionality "requested" in #14569, not by changing how rotate/scale/translate works, but by adding new rotate_object_local, scale_object_local and translate_object_local functions. Also, for completeness, there is now global_scale. This commit also updates another part of the docs regarding the rotation property of Spatial, which also leads to confusion among some users.
* | Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Change the rotate function of Spatial to be local, makes more sense. Closes ↵Juan Linietsky2017-12-261-0/+9
| | | | #14569
* Merge pull request #11249 from m4nu3lf/bugfix/get_eulerRémi Verschelde2017-10-311-13/+12
|\ | | | | Fix inertia tensor update & Generic6DOFJoint & Simplify Basis::get_euler()
| * Fix Basis::get_euler_xyz()m4nu3lf2017-09-221-13/+12
| |
* | Added Basis::get_quat() and set_quat().Ferenc Arn2017-10-111-11/+2
|/
* -Changed KinematicBody API yet again to make it friendlierJuan Linietsky2017-09-041-0/+15
| | | | -Fixed get_scale functions (and added set_scale) to make it more coherent when decomposing and composing (fixes bugs in transform interpolation)
* Add a new decomposition to Basis.Ferenc Arn2017-08-301-4/+35
| | | | This new decomposition splits the basis into a rotation-reflection matrix and a positive scaling matrix, which is required for physics calculations.
* Remove Basis::set_scale and Basis::set_rotation_* functions.Ferenc Arn2017-08-291-33/+0
| | | | | | Those functions were added in #8277 but they did more harm than good. They're subtle, don't do what people think and requires users to understand the non-uniqueness of polar decomposition. They ended up confusing people. Until we store additional information enough to make a unique polar decomposition, these functions shouldn't be a part of Basis.
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Fix incorrect workaround for pure Y (X) rotations in XYZ (YXZ) convention.Ferenc Arn2017-08-181-13/+4
| | | | Fixes #10352.
* Use YXZ convention for Euler angles.Ferenc Arn2017-08-091-5/+81
| | | | | | | As discussed in issues #1479 and #9782, choosing the up axis (which is Y in Godot) as the axis of the last (or first) rotation is helpful in practical use cases. This also aligns Godot's convention with Unity, helping with a smoother transition for people who are used to working with Unity (issue #9905). Internally, both XYZ and YXZ functions are kept, for potential future applications.
* Display the Y angle properly when rotating from gizmo, partially helps #1479Juan Linietsky2017-08-071-3/+11
|
* Implemented environment arrays for skybox reflection and roughness, quality ↵Juan Linietsky2017-07-041-3/+4
| | | | increase is enormous.
* Merge pull request #8277 from tagcup/math_checksRémi Verschelde2017-04-241-28/+98
|\ | | | | Added various functions basic math classes. Also enabled math checks …
| * Added various functions basic math classes. Also enabled math checks only ↵Ferenc Arn2017-04-061-28/+98
| | | | | | | | | | | | | | | | for debug builds. Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly. Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions. Various other changes mostly cosmetic in nature.
* | Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|/
* Merge pull request #8122 from tagcup/axis_check_normalizationRémi Verschelde2017-03-241-0/+2
|\ | | | | Explicitly documented that Transform.basis is not necessarily an orth…
| * Explicitly documented that Transform.basis is not necessarily an orthogonal ↵Ferenc Arn2017-03-231-0/+2
| | | | | | | | | | | | | | | | matrix. Also added a check that in axis-angle rotations, axis is a normalized vector, and modified the docs accordingly. Fixes #8113.
* | Fix typos in source code using codespellRémi Verschelde2017-03-241-1/+1
|/ | | | From https://github.com/lucasdemarchi/codespell
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-205/+174
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn2017-01-161-10/+10
| | | | | | than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
* Type renames:Juan Linietsky2017-01-111-75/+75
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* Merge pull request #7426 from m4nu3lf/bugfix/physicsJuan Linietsky2017-01-101-0/+74
|\ | | | | Fixed inertia tensor computation and center of mass
| * Fixed inertia tensor computation and center of massm4nu3lf2017-01-091-0/+74
| |
* | Fix the order in which additional transformations are applied in Matrix3 and ↵Ferenc Arn2017-01-081-20/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Transform. This is a part of the breaking changes proposed in PR #6865, solving the issue regarding the order of affine transformations described in #2565. This PR also fixes the affected code within Godot codebase. Includes improvements to documentation too. Another change is, Matrix3::get_scale() will now return negative scaling when the determinant of the matrix is negative. The rationale behind this is simple: when performing a polar decomposition on a basis matrix M = R.S, we have to ensure that the determinant of R is +1, such that it is a proper rotation matrix (with no reflections) which can be represented by Euler angles or a quaternion. Also replaced the few instances of float with real_t in Matrix3 and Transform. Furthermore, this PR fixes an issue introduced due to the API breakage in #6865. Namely Matrix3::get_euler() now only works with proper rotation matrices. As a result, the code that wants to get the rotation portion of a transform needs to use Matrix3::get_rotation() introduced in this commit, which complements Matrix3::get_scaled(), providing both parts of the polar decomposition. Finally, it is now possible to construct a rotation matrix from Euler angles using the new constructor Matrix3::Matrix3(const Vector3 &p_euler).
* | Use right handed coordinate system for rotation matrices and quaternions. ↵Ferenc Arn2017-01-031-40/+86
|/ | | | | | | | Also fixes Euler angles (XYZ convention, which is used as default by Blender). Furthermore, functions which expect a rotation matrix will now give an error simply, rather than trying to orthonormalize such matrices. The documentation for such functions has be updated accordingly. This commit breaks code using 3D rotations, and is a part of the breaking changes in 2.1 -> 3.0 transition. The code affected within Godot code base is fixed in this commit.
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* remove trailing whitespaceHubert Jarosz2016-03-091-21/+21
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+479