summaryrefslogtreecommitdiffstats
path: root/core/math/math_funcs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) 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>
* 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".
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Expose `randfn` to global scopeYuri Roubinsky2021-11-171-0/+4
|
* Remove obsolete "dectime" methodAaron Franke2021-07-301-10/+0
| | | | Replaced by "move_toward"
* 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-1/+1
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Exposed randi_range to global funcs + renamed rand_range to randf_rangeYuri Roubinsky2020-11-061-0/+4
|
* Remove unused `PHI` define in math funcsAndrii Doroshenko (Xrayez)2020-11-051-2/+0
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-5/+9
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-2/+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.
* 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.
* Remove circular include between core/typedefs.h and core/error_macros.hMarcel Admiraal2019-10-081-0/+2
|
* Inspector: Make default float step configurableRémi Verschelde2019-07-231-0/+9
| | | | | | | | | | Also allow lifting the decimal step formatting with a hint range step of 0. A new `range_step_decimals()` is added for this to avoid breaking compatibility on the general purpose `step_decimals()` (which still returns 0 for an input step of 0). Supersedes #25470. Partial fix for #18251.
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-2/+0
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Implement random number generatorChaosus2018-11-131-16/+9
| | | | Co-authored-by: Zirak <zirakertan@gmail.com>
* Fix: Strip integer part in "decimals"Aaron Franke2018-09-191-5/+7
| | | Note: Core only.
* Update wrap functionsChaosus2018-03-061-15/+0
|
* 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!
* Added new wrap functionsChaosus2017-10-131-0/+15
|
* Dead code tells no talesRémi Verschelde2017-08-271-4/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Fix PRNG randomization.Ferenc Arn2017-04-171-4/+2
| | | | | | | | PCG32 doesn't like small seeds, which leads to zero random values (prior to #7532, zero values were handled as special cases). Use a large default seed, and also add a shift in Math::randomize. Fixes #8423.
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-40/+36
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge pull request #7528 from tagcup/real_t_float_fixesJuan Linietsky2017-01-201-45/+15
|\ | | | | Use real_t rather than float or double in generic functions (core/mat…
| * Overloaded basic math funcs (double and float variants). Use real_t rather ↵Ferenc Arn2017-01-161-45/+15
| | | | | | | | | | | | than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions.
* | Some changes in the header so Godot3 compiles again on Windows.BastiaanOlij2017-01-181-4/+0
|/
* Replace the existing PRNG (Xorshift31) with (minimal) PCG (XSH-RR variant ↵Ferenc Arn2017-01-151-13/+12
| | | | | | with 32-bit output, 64-bit state). PCG is better than many alternatives by many metrics (see www.pcg-random.org) including statistical quality with good speed.
* made math functions inlnieJuan Linietsky2017-01-121-108/+1
|
* 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!
* xorshift32 PRNG for Math::rand_from_seed()yg2f2016-10-101-29/+8
| | | | | | should fixes #1043 PRNG adapted from : http://excamera.com/sphinx/article-xorshift.html
* Changed the way the step decimals are computed to a safer way, fixes many ↵Juan Linietsky2016-07-261-16/+20
| | | | issues.
* math: Fix rounding error for 0 in Math::round (#4495)Rémi Verschelde2016-05-011-1/+3
| | | | Thus revert the previous workaround in commit b123bc4a2a9c07fcfd27a84109960bda158b3b9d. Fixes #3221.
* remove trailing whitespaceHubert Jarosz2016-03-091-10/+10
|
* Fixed the decimals function, it can't be perfect but it should be good ↵Juan Linietsky2016-01-031-2/+8
| | | | enough. Closes #1955
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* optional formal changesehriche2015-05-061-3/+4
|
* -Fixes from source code analyzizer, closes #1768Juan Linietsky2015-05-011-2/+2
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* - Fix issue #802: randomize() now generate non-zero seed during the first ↵Guy Rabiller2014-10-271-1/+1
| | | | hour of every days, the first minute of every hours and the first second of every minutes.
* -fix bug in cache for atlas import/exportJuan Linietsky2014-03-131-2/+9
| | | | | | | | | | -fix some menus -fixed bug in out transition curves -detect and remove file:/// in collada -remove multiscript for now -remove dependencies on mouse in OS, moved to Input -avoid fscache from screwing up (fix might make it slower, but it works) -funcref was missing, it's there now
* -fixed bug in Button now exporting font propertyJuan Linietsky2014-02-151-1/+2
| | | | | | | | -made GUI Theme editor usable -editor does not allow to export or create .pck in the same path as a project -changed .pck format (lacked support for versioning so couldn't change it), previous was causing crashes and is now incompatible, just re-export. -will not look for .pck files recursively, was causing unexpected behaviors -fixed execution of Godot in paths with non unicode characters in Windows, OSX and Linux.
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+328