summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2020-12-28Merge pull request #44149 from madmiraal/rename-tangent-orthogonalRémi Verschelde
Rename Vector2.tangent() to Vector2.orthogonal()
2020-12-28Rename Rect2 and Rect2i grow_margin() to grow_side()Marcel Admiraal
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-24Use page allocator for BVHreduz
2020-12-24Cull fixes and optimizationsreduz
2020-12-24Fix BVH to world_aabb, and call updatelawnjelly
The calls to the BVH need to use the world space AABB, rather than local space for it to work. Also, update was not being called which is required to update the AABB as objects move.
2020-12-23Replace Octree by DynamicBVH in cull codereduz
-Much greater pairing/unpairing performance -For now, using it for culling too, but this will change in a couple of days. -Added a paged allocator, to efficiently alloc/free some types of objects.
2020-12-23Rename Control margin to offsetMarcel Admiraal
2020-12-21simplify randi_rangeMarco Cognetta
2020-12-19Add a Dynamic BVH implementation.reduz
-Based on Bullet Dbvh, has style and functional changes. -Provides efficient pairing -Needed to optimize rendering -Needed to optimize physics This PR is up for others to review the implementation.
2020-12-19Rename Rect2 and Rect2i clip() to intersection()Marcel Admiraal
2020-12-18Implement automatic LOD (Level of Detail)reduz
-Happens on import by default for all models -Just works (tm) -Biasing can be later adjusted per node or per viewport (as well as globally) -Disabled AABB.get_support test because its broken
2020-12-09Merge pull request #44128 from KoBeWi/🧹Rémi Verschelde
Cleanup unused engine code
2020-12-09Cleanup unused engine codeTomasz Chabora
2020-12-09Merge pull request #44199 from bruvzg/pvs_fixes_1Rémi Verschelde
PVS-Studio static analyzer fixes
2020-12-09Static analyzer fixes:bruvzg
Removes unused code in OS. Fixes return types. Fixes few typos.
2020-12-08Merge pull request #44089 from Xrayez/rng-stateRémi Verschelde
Add ability to restore `RandomNumberGenerator` state
2020-12-07Add ability to restore `RandomNumberGenerator` stateAndrii Doroshenko (Xrayez)
- added `state` as a property to restore internal state of RNG; - `get_seed()` returns last seed used to initialize the state rather than the current state. Co-authored-by: MidZik <matt.idzik1@gmail.com>
2020-12-07Improve argument names for core typesAaron Franke
2020-12-06Rename Vector2.tangent() to Vector2.orthogonal()Marcel Admiraal
2020-11-26[Complex Text Layouts] Refactor Font class, default themes and controls to ↵bruvzg
use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
2020-11-23Initialize class/struct variables with default values in core/ and drivers/Rafał Mikrut
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke
2020-11-11Refactor variant built-in methods yet again.reduz
* Using C-style function pointers now, InternalMethod is gone. * This ensures much better performance in typed code. * Renamed builtin_funcs to utility_funcs, to avoid naming confusion
2020-11-11Merge pull request #43372 from aaronfranke/clamp-fixesRémi Verschelde
Minor clamp and float fixes
2020-11-10Create Variant built-in functions.reduz
-Moved Expression to use this, removed its own. -Eventually GDScript/VisualScript/GDNative need to be moved to this. -Given the JSON functions were hacked-in, removed them and created a new JSONParser class -Made sure these functions appear properly in documentation, since they will be removed from GDScript
2020-11-10Minor clamp and float fixesAaron Franke
2020-11-09Variant: Sync docs with new constructors, fixups after #43403Rémi Verschelde
Change DocData comparators for MethodDoc and ArgumentDoc to get a better ordering of constructors.
2020-11-09Merge pull request #43404 from akien-mga/color-fix-clamp-uint32_t-warningRémi Verschelde
Color: Fix -Wtype-limits GCC warning after refactoring
2020-11-09Color: Fix -Wtype-limits GCC warning after refactoringRémi Verschelde
Warning from GCC 10.2.0 with `warnings=extra`: ``` ./core/math/color.h: In member function 'int32_t Color::get_r8() const': ./core/typedefs.h:107:42: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits] 107 | #define CLAMP(m_a, m_min, m_max) (((m_a) < (m_min)) ? (m_min) : (((m_a) > (m_max)) ? m_max : m_a)) | ~~~~~~^~~~~~~~~ ./core/math/color.h:201:49: note: in expansion of macro 'CLAMP' 201 | _FORCE_INLINE_ int32_t get_r8() const { return CLAMP(uint32_t(r * 255.0), 0, 255); } | ^~~~~ ``` Also some code consistency changes while at it.
2020-11-09Refactored variant constructor logicreduz
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-11-07Refactored variant setters/gettersreduz
-Discern between named, indexed and keyed -Get direct access to functions for typed GDScript and GDNative bindings -Small changes to some classes in order to work with the new setget binder
2020-11-06Refactored Variant Operators.reduz
-Using classes to call and a table -For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
2020-11-06Exposed randi_range to global funcs + renamed rand_range to randf_rangeYuri Roubinsky
2020-11-05Remove unused `PHI` define in math funcsAndrii Doroshenko (Xrayez)
2020-11-05doc: Override default value for RandomNumberGenerator.seedRémi Verschelde
It's non-deterministic so it's better to show a fixed value like 0 instead of having it potentially change whenever `randomize()` is called. Fixes #43317.
2020-11-04doc: Sync classref with current source + fixup some bindingsRémi Verschelde
Includes various changes triggered by the refactoring of method bindings.
2020-11-04Implement DirectionalLight2Dreduz
Also separated Light2D in PointLight2D and DirectionalLight2D. Used PointLight2D because its more of a point, and it does not work the same as OmniLight (as shape depends on texture). Added a few utility methods to Rect2D I needed.
2020-10-29Fix biased output of randi_rangeYuri Roubinsky
2020-10-27Make `randbase` member protected in `RandomNumberGenerator`Andrii Doroshenko (Xrayez)
Allows to extend `RandomNumberGenerator` via C++ modules.
2020-10-14Refactored binding system for core typesreduz
Moved to a system using variadic templates, shared with CallableBind. New code is cleaner, faster and allows for much better optimization of core type functions from GDScript and GDNative. Added Variant::InternalMethod function for direct call access.
2020-10-09Merge pull request #42660 from Chaosus/remove_get_uv84_normal_bitRémi Verschelde
Removed unused method Geometry3D.get_uv84_normal_bit
2020-10-09Implement GPU Particle Collisionsreduz
-Sphere Attractor -Box Attractor -Vector Field -Sphere Collider -Box Collider -Baked SDF Collider -Heightmap Collider
2020-10-09Removed unused method Geometry.get_uv84_normal_bitYuri Roubinsky
2020-09-28Merge pull request #42133 from vnen/variant-op-consistencyRémi Verschelde
Allow commutative multiplication in Variant
2020-09-23Remove redundant is_equal_approx_ratio methodAaron Franke
is_equal_approx is able to handle values of any size, and is_equal_approx_ratio is no longer used in any exposed APIs, so we don't need is_equal_approx_ratio anymore. Also, add #ifdef MATH_CHECKS for a method that is only used when MATH_CHECKS is defined.
2020-09-23Change Basis is_equal_approx to use instance methodAaron Franke
2020-09-18Linux/BSD: Fix support for NetBSDRémi Verschelde
Add __NetBSD__ to `platform_config.h` so that it can find `alloca` and use the proper `pthread_setname_np` format. Rename RANDOM_MAX to avoid conflict with NetBSD stdlib. Fixes #42145.
2020-09-17Allow commutative multiplication in VariantGeorge Marques
Also allow quaternions to be multiplied by integers.