summaryrefslogtreecommitdiffstats
path: root/core/math/vector3.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122Spartan3222024-11-021-1/+1
|\
| * Always add decimal when printing floatkobewi2024-10-231-1/+1
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* [Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`A Thousand Ships2024-05-021-0/+19
| | | | Convenience for a number of cases operating on single values
* Fix some uses of float and real_t in core/mathAaron Franke2024-03-291-2/+2
|
* [Core] Codestyle improvements to math typesA Thousand Ships2024-03-041-10/+10
|
* Remove unnecessary `this->` expressionsA Thousand Ships2024-01-291-1/+1
|
* Bias octahedral tangent y axis to avoid errors around 0clayjohn2023-02-131-0/+2
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Add `is_finite` method for checking built-in typesHaoyu Qiu2022-10-081-0/+4
|
* Remove set_axis and get_axis methods from Vector2/2i/3/3i/4/4iAaron Franke2022-09-191-10/+0
|
* Add `is_zero_approx` methods to `Vector2`, `3`, and `4`Jonathan Nicholl2022-09-021-0/+4
|
* Basis constructor: row vectors -> column vectorsZhehang Ding2022-08-311-5/+5
|
* Octahedral Normal/Tangent CompressionOmar El Sheikh2022-08-131-0/+16
| | | | Implementation of Octahedral normal compression into Godot 4.0
* Refactor bezier interpolation functionsHendrik Brucker2022-06-271-8/+0
|
* Core: Rename math 'phi' arguments to 'angle'Rémi Verschelde2022-05-051-4/+4
|
* Float literals - fix main primitives to use real_t castinglawnjelly2022-02-241-1/+1
| | | | Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
* Core: Use forward declares for Vector3/Vector3iRémi Verschelde2022-02-191-0/+32
| | | | Add add Vector3 operator in Vector3i.
* Implement cubic_interpolate() as MathFunc for refactoringSilc 'Tokage' Renew2022-02-121-16/+5
|
* Float literals - fix main primitives to use .flawnjelly2022-02-101-4/+4
| | | | Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Rename Vector parameters to be consistentRaul Santos2021-12-011-4/+4
| | | | | | Renames parameters that were named differently across different scripting languages or their documentation to use the same name everywhere.
* clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-4/+5
| | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* Replace Vector3.to_diagonal_matrix with Basis.from_scaleAaron Franke2021-09-171-6/+0
|
* Add constant to vector function parameters that don't actually modify their ↵Ricard Rovira Cubeles2021-08-151-7/+7
| | | | | input. Add more overloads of vector multiplication, required by templates to compile with float=64.
* Reformat structure string operatorsAaron Franke2021-06-111-1/+1
| | | | | | The order of numbers is not changed except for Transform2D. All logic is done inside of their structures (and not in Variant). For the number of decimals printed, they now use String::num_real which works best with real_t, except for Color which is fixed at 4 decimals (this is a reliable number of float digits when converting from 16-bpc so it seems like a good choice)
* Allow clamping vectors and colorsAaron Franke2021-06-031-0/+7
|
* Rename Vector2 clamped to limit_length and add limit_length to Vector3Aaron Franke2021-06-031-0/+11
|
* Dynamic BVH broadphase in 2D & 3D Godot PhysicsPouleyKetchoupp2021-05-101-8/+0
| | | | | | | | | | | | | | Port lawnjelly's dynamic BVH implementation from 3.x to be used in both 2D and 3D broadphases. Removed alternative broadphase implementations which are not meant to be used anymore since they are much slower. Includes changes in Rect2, Vector2, Vector3 that help with the template implementation of the dynamic BVH by uniformizing the interface between 2D and 3D math. Co-authored-by: lawnjelly <lawnjelly@gmail.com>
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename Math::stepify to snappedMarcel Admiraal2020-12-281-6/+6
|
* Cleanup unused engine codeTomasz Chabora2020-12-091-33/+0
|
* Improve argument names for core typesAaron Franke2020-12-071-4/+4
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-2/+4
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-12/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Fix Vector3 ambiguities and out of bounds init.bruvzg2020-02-111-2/+2
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Make is_equal_approx separate for structuresAaron Franke2019-10-141-0/+5
| | | | This commit adds exposed behavior for C#
* Remove circular dependency between Vector3 and Basis.Marcel Admiraal2019-10-071-0/+15
|
* Added move_toward functions for float, Vector2 and Vector3Giacom2019-05-281-0/+7
|
* [Core] Rename Matrix3 file to BasisAaron Franke2019-02-091-1/+1
| | | The code already referred to "Basis", it's just the file name that was different for some reason.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+2
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* 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.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Dead code tells no talesRémi Verschelde2017-08-271-45/+0
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Fixed syntax inconsistency in Vector3.snap and Vector3.snappedTwistedTwigleg2017-07-031-5/+5
|