summaryrefslogtreecommitdiffstats
path: root/core/math
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #44128 from KoBeWi/🧹Rémi Verschelde2020-12-092-34/+0
|\ | | | | Cleanup unused engine code
| * Cleanup unused engine codeTomasz Chabora2020-12-092-34/+0
| |
* | Merge pull request #44199 from bruvzg/pvs_fixes_1Rémi Verschelde2020-12-091-27/+0
|\ \ | | | | | | PVS-Studio static analyzer fixes
| * | Static analyzer fixes:bruvzg2020-12-091-27/+0
| |/ | | | | | | | | | | Removes unused code in OS. Fixes return types. Fixes few typos.
* | Merge pull request #44089 from Xrayez/rng-stateRémi Verschelde2020-12-083-9/+13
|\ \ | |/ |/| Add ability to restore `RandomNumberGenerator` state
| * Add ability to restore `RandomNumberGenerator` stateAndrii Doroshenko (Xrayez)2020-12-073-9/+13
| | | | | | | | | | | | | | - 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>
* | Improve argument names for core typesAaron Franke2020-12-079-125/+125
|/
* [Complex Text Layouts] Refactor Font class, default themes and controls to ↵bruvzg2020-11-261-1/+2
| | | | | | | | use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
* Initialize class/struct variables with default values in core/ and drivers/Rafał Mikrut2020-11-233-23/+25
|
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-164-18/+0
|
* Refactor variant built-in methods yet again.reduz2020-11-111-5/+5
| | | | | | * 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
* Merge pull request #43372 from aaronfranke/clamp-fixesRémi Verschelde2020-11-111-1/+1
|\ | | | | Minor clamp and float fixes
| * Minor clamp and float fixesAaron Franke2020-11-101-1/+1
| |
* | Create Variant built-in functions.reduz2020-11-102-781/+14
|/ | | | | | | -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
* Variant: Sync docs with new constructors, fixups after #43403Rémi Verschelde2020-11-094-9/+28
| | | | | Change DocData comparators for MethodDoc and ArgumentDoc to get a better ordering of constructors.
* Merge pull request #43404 from akien-mga/color-fix-clamp-uint32_t-warningRémi Verschelde2020-11-092-51/+54
|\ | | | | Color: Fix -Wtype-limits GCC warning after refactoring
| * Color: Fix -Wtype-limits GCC warning after refactoringRémi Verschelde2020-11-092-51/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Refactored variant constructor logicreduz2020-11-092-2/+8
|/
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-0730-70/+1038
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Refactored variant setters/gettersreduz2020-11-074-3/+42
| | | | | | -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
* Refactored Variant Operators.reduz2020-11-064-2/+47
| | | | | -Using classes to call and a table -For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
* Exposed randi_range to global funcs + renamed rand_range to randf_rangeYuri Roubinsky2020-11-067-26/+40
|
* Remove unused `PHI` define in math funcsAndrii Doroshenko (Xrayez)2020-11-051-2/+0
|
* doc: Override default value for RandomNumberGenerator.seedRémi Verschelde2020-11-051-1/+4
| | | | | | | 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.
* doc: Sync classref with current source + fixup some bindingsRémi Verschelde2020-11-041-6/+6
| | | | Includes various changes triggered by the refactoring of method bindings.
* Implement DirectionalLight2Dreduz2020-11-041-0/+62
| | | | | | | 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.
* Fix biased output of randi_rangeYuri Roubinsky2020-10-292-5/+15
|
* Make `randbase` member protected in `RandomNumberGenerator`Andrii Doroshenko (Xrayez)2020-10-271-1/+1
| | | | Allows to extend `RandomNumberGenerator` via C++ modules.
* Refactored binding system for core typesreduz2020-10-145-0/+61
| | | | | | | | | 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.
* Merge pull request #42660 from Chaosus/remove_get_uv84_normal_bitRémi Verschelde2020-10-091-48/+0
|\ | | | | Removed unused method Geometry3D.get_uv84_normal_bit
| * Removed unused method Geometry.get_uv84_normal_bitYuri Roubinsky2020-10-091-48/+0
| |
* | Implement GPU Particle Collisionsreduz2020-10-091-0/+8
|/ | | | | | | | | | -Sphere Attractor -Box Attractor -Vector Field -Sphere Collider -Box Collider -Baked SDF Collider -Heightmap Collider
* Merge pull request #42133 from vnen/variant-op-consistencyRémi Verschelde2020-09-282-1/+33
|\ | | | | Allow commutative multiplication in Variant
| * Allow commutative multiplication in VariantGeorge Marques2020-09-172-1/+33
| | | | | | | | Also allow quaternions to be multiplied by integers.
* | Remove redundant is_equal_approx_ratio methodAaron Franke2020-09-233-28/+8
| | | | | | | | 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.
* | Change Basis is_equal_approx to use instance methodAaron Franke2020-09-231-2/+0
| |
* | Linux/BSD: Fix support for NetBSDRémi Verschelde2020-09-182-6/+6
|/ | | | | | | | | 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.
* Change inequality comparison operators to use exact equalityAaron Franke2020-09-082-12/+12
|
* Initialise Basis elements with a default Basis in the declaration.Marcel Admiraal2020-09-081-12/+6
| | | | Ensures a valid Basis is created with all constructors.
* Ensure assignment operators return by reference to avoid unnecessary copies.Marcel Admiraal2020-09-042-2/+2
|
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-10/+10
|
* Merge pull request #40955 from Calinou/test-add-expressionRémi Verschelde2020-08-311-1/+1
|\ | | | | Add a test suite for Expression
| * Add a test suite for ExpressionHugo Locurcio2020-08-271-1/+1
| | | | | | | | | | This also makes the first parameter of `Expression::execute()` optional from C++. Previously, it was only optional in the scripting API.
* | Added volumetric fog effect.Juan Linietsky2020-08-132-4/+3
|/
* Make all String float conversion methods be 64-bitAaron Franke2020-07-271-1/+1
|
* GDScript: Clarified/fixed inaccuracies in the built-in function docs.Meriipu2020-07-251-6/+6
| | | | | | | | | | | | | | | | | The input to smoothstep is not actually a weight, and the decscription of smoothstep was pretty hard to understand and easy to misinterpret. Clarified what it means to be approximately equal. nearest_po2 does not do what the descriptions says it does. For one, it returns the same power if the input is a power of 2. Second, it returns 0 if the input is negative or 0, while the smallest possible integral power of 2 actually is 1 (2^0 = 1). Due to the implementation and how it is used in a lot of places, it does not seem wise to change such a core function however, and I decided it is better to alter the description of the built-in. Added a few examples/clarifications/edge-cases.
* Update core documentation to match recent C# changesAaron Franke2020-07-214-6/+5
| | | | | | Also a few minor API changes like adding AABB.abs() Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Merge pull request #38713 from aaronfranke/string-64bitRémi Verschelde2020-07-011-1/+1
|\ | | | | Make all String integer conversion methods be 64-bit
| * Remove 32-bit String to_int methodAaron Franke2020-06-031-1/+1
| |
* | Addition of SDFGI for open world global illuminationJuan Linietsky2020-06-263-1/+13
| | | | | | | | Move GI to a deferred pass