summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2022-06-22Add surface indices to TriangleMeshreduz
Helps unblock #56597
2022-06-20Clean up Hash Functionsreduz
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
2022-06-17Ensure AudioFrame variables l and r are always initialisedMarcel Admiraal
2022-06-16Remove redundand header from `a_star.h`Yuri Rubinsky
2022-06-16Make AStar to use 64-bit logicYuri Rubinsky
2022-06-16Merge pull request #58669 from theraot/ASar2DbidirectionalRémi Verschelde
AStar2D bidirectional
2022-06-08Fix `wrapf` to correct wrap values with 0.1 steppingYuri Rubinsky
2022-06-08i18n: Misc fixes translation stringsRémi Verschelde
Adds some translator comments to solve some questions raised on Weblate.
2022-06-07Merge pull request #61319 from JFonS/taa_wipRémi Verschelde
Initial TAA implementation
2022-06-07Allow picking similar colours using OKHSL.K. S. Ernest (iFire) Lee
2022-06-07Initial TAA implementationjfons
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.
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-19Use range iterators for RBSet in most casesAaron Record
2022-05-16Replace most uses of Map by HashMapreduz
* 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!
2022-05-11Implement exponential operator (**) to GDScript/ExpressionsYuri Roubinsky
2022-05-10Fix warnings found by Emscripten 3.1.10Rémi Verschelde
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and `-Wliteral-range` warnings.
2022-05-06Allow AStar2D/AStar3D zero point weightsmix8
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.
2022-05-05Core: Rename math 'phi' arguments to 'angle'Rémi Verschelde
2022-05-03Rename Basis get_axis to get_column, remove redundant methodsAaron Franke
2022-05-03Merge pull request #60627 from aaronfranke/rename-elementsRémi Verschelde
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-02Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde
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.
2022-04-29Rename Basis "elements" to "rows"Aaron Franke
2022-04-29Rename Transform2D "elements" to "columns"Aaron Franke
2022-04-20Fix more issues found by cppcheck.bruvzg
2022-04-13Color: Rename `to_srgb`/`to_linear` to include base color spaceRémi Verschelde
This helps reduce confusion around sRGB <> Linear conversions by making both input and output color spaces explicit.
2022-04-13Rearrange TriangleMesh stack level incrementation to fix MSVC compiler ↵SaracenOne
optimization bug
2022-04-06Fix some issues found by cppcheck.bruvzg
2022-04-05Fix DynamicBVH crash after #59867Rémi Verschelde
I made a wrong assumption that initialization the other pointer in the union would properly initialize the `childs` array.
2022-04-04Zero initialize all pointer class and struct membersRémi Verschelde
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
2022-03-23Add protective checks for invalid handle use in BVHlawnjelly
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.
2022-03-20Rename `AStar` to `AStar3D`Yuri Roubinsky
2022-03-17Merge pull request #59229 from ↵Rémi Verschelde
taigi100/Bugfix-#59215-Standard-color-name-returns-non-standard-color-code
2022-03-17Update color constants to use HEX codestaigi100
2022-03-16Fix blend animation to solve TRS track bug & blend order inconsistencySilc 'Tokage' Renew
2022-03-09Remove VARIANT_ARG* macrosreduz
* 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.
2022-03-07VariantUtility: Unexpose `Math::range_step_decimals`Rémi Verschelde
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.
2022-03-07Protection for array operator for Vector2 / 3 in DEV buildslawnjelly
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.
2022-03-04Merge pull request #57630 from lawnjelly/bvh4_templated_checksRémi Verschelde
[4.x] BVH - Sync BVH with 3.x
2022-03-01Added missing p_bidirectional to AStar2D methodsTheraot
The methods disconnect_points and are_points_connected now have an optional p_bidirectional parameter matching AStar.
2022-03-01Merge pull request #58488 from lawnjelly/float_literals_castsRémi Verschelde
2022-02-26Use is_zero_approx and fix spelling in CameraMatrix invertAaron Franke
2022-02-24Float literals - fix main primitives to use real_t castinglawnjelly
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-19Core: Use forward declares for Vector3/Vector3iRémi Verschelde
Add add Vector3 operator in Vector3i.
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-12Implement cubic_interpolate() as MathFunc for refactoringSilc 'Tokage' Renew
2022-02-10Float literals - fix main primitives to use .flawnjelly
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-09Fix Vector2 and Vector2i coord access via operator[]Bartłomiej T. Listwon
2022-02-07Merge pull request #57729 from TechnoPorg/astar-fix-invalid-includeRémi Verschelde
Remove a cross include from a_star.cpp
2022-02-06Remove a cross include from a_star.cppTechnoPorg
2022-02-06Fix integer vector mul/div operators and bindings.reduz
* 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.