Commit Graph

72 Commits

Author SHA1 Message Date
Hugo Locurcio 0437db0106 Display values in vector/quaternion math function errors
This can help track down the source of the error more easily.
2024-01-28 18:45:46 +01:00
Aaron Franke 7ee273723d Fix Basis is_orthogonal and is_rotation methods, add is_orthonormal 2023-12-06 13:12:05 -06:00
Aaron Franke 56806ffeed Add is_conformal method to Basis and Transform2D 2023-09-13 17:20:30 -05:00
Lyuma 9aa46bf3f5 Fix for SkeletonIK3D interpolation and bone roll
Fix bug in internal Basis::rotate_to_align function (also used with identity Basis in scene/resources/curve.cpp)
Use ChainItem children rather than local bone rest to determine IK bone roll to match Godot 3.x behavior
2023-06-05 20:44:45 -07:00
Juan Linietsky 5fdc1232ef Add the ability to look-at in model-space.
This is a much simpler attempt to solve the same problem as #76060, but without breaking any compatibility.

* Adds a description of what model space is in the Vector3 enums (MODEL_* constants). This has the proper axes laid out for imported 3D assets.
* Adds the option to `look_at` using model_space, which uses Vector3.MODEL_FRONT as forward vector.

The attempt of this PR is to still break the assumption that there is a single direction of forward (which is not the case in Godot)
and make it easier to understand where 3D models are facing, as well as orienting them via look_at.
2023-05-24 10:10:24 +09:00
lawnjelly 50c5ed4876 Make acos and asin safe
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input.

The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe.
2023-05-11 08:34:34 +01:00
Silc Renew 1459b9c24c Fix scaled_orthogonal() & subgizmo global scaling 2023-02-04 00:46:04 +09:00
kobewi c0083e431b Cleanup unused engine code v2 2023-01-19 13:02:18 +01:00
Rémi Verschelde d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Andy Maloney cb6cffbfd9 Static analysis: remove "break" after "return"
Changes as requested to keep in sync with godotengine/godot-cpp#929
2022-11-18 17:57:33 -05:00
Rémi Verschelde 08d56ac2f1 Merge pull request #66747 from aaronfranke/move-euler-order
Move EulerOrder enum to math_defs.h and global scope
2022-11-02 22:37:12 +01:00
Aaron Franke 8556fdd4bc Move EulerOrder enum to math_defs.h and global scope 2022-11-02 13:44:13 -05:00
Rémi Verschelde f7c611ab71 Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Haoyu Qiu 5da515773d Add is_finite method for checking built-in types 2022-10-08 13:25:08 +08:00
Aaron Franke 43722dbcbc Use float literals for float calculations in Color 2022-10-07 11:28:47 -05:00
Aaron Franke 97d232c11d Enhancements to includes in core data structures 2022-10-05 23:11:02 -05:00
fabriceci 9f1a57d48b Test, refactor and fix a bug in Basis.get_axis_angle 2022-09-14 12:05:22 +02:00
Jonathan Nicholl 15d057c521 Add is_zero_approx methods to Vector2, 3, and 4 2022-09-02 00:29:50 -04:00
rafallus da7a5653f4 Expose Basis set_orthogonal_index method as a GridMap function 2022-08-20 21:42:20 -05:00
fabriceci db7c91e0ad Fix the calculation of the angular velocity when the rotation speed is not high. 2022-07-19 10:27:13 +02:00
reduz 7acf697479 Fix VECTOR/LOCAL transitions in Node3D
Fixes #62225, supersedes #62227
2022-06-27 13:45:35 +02:00
Rémi Verschelde e7a58a7eb6 Core: Rename math 'phi' arguments to 'angle' 2022-05-05 14:17:39 +02:00
Aaron Franke fa7a7795f0 Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
Aaron Franke 1bf94dff3a Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
bruvzg f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00