summaryrefslogtreecommitdiffstats
path: root/core/math
Commit message (Collapse)AuthorAgeFilesLines
* Initial TAA implementationjfons2022-06-072-0/+6
| | | | | | Initial TAA support based on the implementation in Spartan Engine. Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
* Add a new HashSet templatereduz2022-05-205-17/+20
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Use range iterators for RBSet in most casesAaron Record2022-05-191-3/+3
|
* Replace most uses of Map by HashMapreduz2022-05-1610-59/+66
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Implement exponential operator (**) to GDScript/ExpressionsYuri Roubinsky2022-05-112-14/+27
|
* Fix warnings found by Emscripten 3.1.10Rémi Verschelde2022-05-102-6/+0
| | | | | Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and `-Wliteral-range` warnings.
* Allow AStar2D/AStar3D zero point weightsmix82022-05-061-2/+2
| | | | | | Allow AStar2D/AStar3D zero point weight. Limit was set to 1 which seemed like an arbitrary value as lower values down to zero can be useful for common gameplay navigation elements like teleports.
* Core: Rename math 'phi' arguments to 'angle'Rémi Verschelde2022-05-058-42/+42
|
* Rename Basis get_axis to get_column, remove redundant methodsAaron Franke2022-05-034-51/+31
|
* Merge pull request #60627 from aaronfranke/rename-elementsRémi Verschelde2022-05-038-366/+366
|\ | | | | Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
| * Rename Basis "elements" to "rows"Aaron Franke2022-04-295-245/+245
| |
| * Rename Transform2D "elements" to "columns"Aaron Franke2022-04-294-121/+121
| |
* | Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde2022-05-023-6/+6
|/ | | | | | | | | | | Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
* Fix more issues found by cppcheck.bruvzg2022-04-203-5/+8
|
* Color: Rename `to_srgb`/`to_linear` to include base color spaceRémi Verschelde2022-04-131-2/+2
| | | | | This helps reduce confusion around sRGB <> Linear conversions by making both input and output color spaces explicit.
* Rearrange TriangleMesh stack level incrementation to fix MSVC compiler ↵SaracenOne2022-04-131-10/+10
| | | | optimization bug
* Fix some issues found by cppcheck.bruvzg2022-04-064-15/+16
|
* Fix DynamicBVH crash after #59867Rémi Verschelde2022-04-051-2/+5
| | | | | I made a wrong assumption that initialization the other pointer in the union would properly initialize the `childs` array.
* Zero initialize all pointer class and struct membersRémi Verschelde2022-04-044-47/+26
| | | | | This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
* Add protective checks for invalid handle use in BVHlawnjelly2022-03-233-14/+28
| | | | | | Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs. Any such misuse is a bug in the physics, but this should flag any errors quickly.
* Rename `AStar` to `AStar3D`Yuri Roubinsky2022-03-202-78/+78
|
* Merge pull request #59229 from ↵Rémi Verschelde2022-03-171-146/+146
|\ | | | | | | taigi100/Bugfix-#59215-Standard-color-name-returns-non-standard-color-code
| * Update color constants to use HEX codestaigi1002022-03-171-146/+146
| |
* | Fix blend animation to solve TRS track bug & blend order inconsistencySilc 'Tokage' Renew2022-03-162-0/+21
|/
* Remove VARIANT_ARG* macrosreduz2022-03-091-1/+1
| | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* VariantUtility: Unexpose `Math::range_step_decimals`Rémi Verschelde2022-03-071-1/+1
| | | | | | | This method was meant only as a convenience for editor code to allow using a step of 0 to disable snapping. It was exposed by mistake when refactoring GlobalScope.
* Protection for array operator for Vector2 / 3 in DEV buildslawnjelly2022-03-074-0/+11
| | | | | | A previous PR had changed the array operator to give unbounded access. This could cause crashes where old code depended on this previous safe behaviour. This PR adds DEV_ASSERT macros for out of bound access to DEV builds, allowing us to quickly identify bugs in calling code, without affecting performance in release or release_debug editor builds.
* Merge pull request #57630 from lawnjelly/bvh4_templated_checksRémi Verschelde2022-03-0411-213/+533
|\ | | | | [4.x] BVH - Sync BVH with 3.x
| * BVH - Sync BVH with 3.xlawnjelly2022-02-0411-213/+533
| | | | | | | | | | Templated mask checks and generic NUM_TREES Fix leaking leaves
* | Merge pull request #58488 from lawnjelly/float_literals_castsRémi Verschelde2022-03-0115-68/+68
|\ \
| * | Float literals - fix main primitives to use real_t castinglawnjelly2022-02-2415-68/+68
| | | | | | | | | | | | Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
* | | Use is_zero_approx and fix spelling in CameraMatrix invertAaron Franke2022-02-261-7/+5
|/ /
* | Core: Use forward declares for Vector3/Vector3iRémi Verschelde2022-02-195-38/+52
| | | | | | | | Add add Vector3 operator in Vector3i.
* | Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-163-13/+6
| | | | | | | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* | Implement cubic_interpolate() as MathFunc for refactoringSilc 'Tokage' Renew2022-02-123-32/+24
| |
* | Float literals - fix main primitives to use .flawnjelly2022-02-1021-222/+222
| | | | | | | | Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
* | Fix Vector2 and Vector2i coord access via operator[]Bartłomiej T. Listwon2022-02-092-10/+16
| |
* | Merge pull request #57729 from TechnoPorg/astar-fix-invalid-includeRémi Verschelde2022-02-071-1/+0
|\ \ | | | | | | Remove a cross include from a_star.cpp
| * | Remove a cross include from a_star.cppTechnoPorg2022-02-061-1/+0
| | |
* | | Fix integer vector mul/div operators and bindings.reduz2022-02-065-24/+46
| | | | | | | | | | | | | | | | | | | | | * Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively. * Create specializations to allow proper bindings. This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
* | | Merge pull request #57620 from Haydoggo/expression-exp-fixRémi Verschelde2022-02-051-3/+1
|\ \ \ | | | | | | | | Fix Expression's parsing of positive exponent literals
| * | | Make parser treat all exponent literals as floatHayden2022-02-051-3/+1
| | | |
* | | | Merge pull request #57623 from akien-mga/core-math-struct-em-allRémi Verschelde2022-02-049-31/+26
|\ \ \ \
| * | | | Core: Make all Variant math types structsRémi Verschelde2022-02-049-31/+26
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Some were declared as structs (public by default) and others as classes (private by default) but in practice all these math types exposed as Variants are all 100% public.
* / | | Core: Move Vector2i to its own `vector2i.h` headerRémi Verschelde2022-02-0410-198/+283
|/ / / | | | | | | | | | Also reduce interdependencies and clean up a bit.
* | | Core: Move Rect2i to its own `rect2i.h` headerRémi Verschelde2022-02-048-217/+318
| | | | | | | | | | | | | | | And take the opportunity to improve interdependencies a bit with forward declares where possible.
* | | Cleanup and move char functions to the `char_utils.h` header.bruvzg2022-02-041-24/+12
|/ /
* | Added hex and bin literal support to Expression parserHayden Leete2022-02-041-4/+44
| | | | | | | | fixed formatting
* | Vectors: Use clear() and has().Anilforextra2022-02-021-4/+4
| | | | | | | | | | | | Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
* | Merge pull request #57469 from Sauermann/fix-rect2i-intersectRémi Verschelde2022-02-011-6/+6
|\ \