summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2018-08-09Fix clang compile errorMarcelo Fernandez
2018-08-08Ability to pass custom variables to expression.Juan Linietsky
2018-08-08-Add Expression class, used to evaluate expressionsJuan Linietsky
-Added expression evaluation to EditorSpinSlider, fixes #20813, fixes #18932
2018-07-26Merge pull request #18955 from tagcup/fix_set_scaleRémi Verschelde
Removed incorrect Basis::set_scale().
2018-07-26Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam
This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
2018-07-24Removed unnecessary assignmentsWilson E. Alvarez
2018-07-05Merge pull request #19279 from aaronfranke/core-fposmod-fixMax Hilbrunner
[Core] [Math] Fix fposmod() function
2018-07-03Merge pull request #19819 from MetaSaval/masterMax Hilbrunner
Change the neighbours vector to a set in AStar
2018-06-27Change the neighbours vector to a set in AStarDanny
This fixes an issue where one could not disconnect two points that were connected more than once.
2018-06-25Merge pull request #19193 from tagcup/quat_normJuan Linietsky
Fixed Basis -> Quat conversions, added a few safety checks.
2018-06-21Added auto triangle generation in blend space, using Delaunay.Juan Linietsky
2018-06-13Polished 3D selectionJFonS
2018-06-10[Core] [Math] Fix fposmod() functionAaron Franke
ffff meth
2018-06-07Added functions to get trimesh infoAndrea Catania
2018-05-31Style: Apply clang-format (5.0) to some missed filesRémi Verschelde
2018-05-27Fixed Basis -> Quat conversions, added a few safety checks.tagcup
Fixes #19027.
2018-05-17Removed incorrect Basis::set_scale().tagcup
Also added a missing constructor in Basis, and fixed usage of inverse and affine inverse in Transform.
2018-05-12Add SLERP to Vector{2,3}, optimize Quat's Vector3 rotation.tagcup
Also even out Basis and Quat APIs a little.
2018-05-07Merge pull request #15943 from poke1024/geometry-line-lineJuan Linietsky
Add Geometry::line_intersects_line_2d()
2018-05-04Vector3::round, Vector2::round & Vector2::ceil methods were added.Alexander Alekseev
Now both structs (Vector2 & Vector3) have round, floor & ceil methods. (see #18603)
2018-04-19Fix Coverity reports of uninitialized scalar variableRémi Verschelde
Fixes most current reports on Coverity Scan of uninitialized scalar variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html These happen most of the time (in our code) when instanciating structs without a constructor (or with an incomplete one), and later returning the instance. This is sometimes intended though, as some parameters are only used in some situations and should not be double-initialized for performance reasons (e.g. `constant` in ShaderLanguage::Token).
2018-04-14Avoid converting Quat to Euler angles when not necessary.tagcup
Also ensure that get_scale doesn't arbitrarlity change the signs of scales, ensuring that the combination of get_rotation and get_scale gives the correct basis. Added various missing functions and constructors. Should close #17968.
2018-04-13Small performance fix to wrapfChaosus
2018-04-09Resolves Inccorect Quaternion ConversionCrazy-P
Fixes https://github.com/godotengine/godot/issues/18025
2018-04-08Merge pull request #16495 from Chaosus/is_point_in_triangle_fixJuan Linietsky
Fix is_point_in_triangle function
2018-03-22Fix for clang warning at distance_toMarcelo Fernandez
2018-03-13Merge pull request #17254 from Chaosus/updatewrapRémi Verschelde
Update wrap functions
2018-03-07Bring back Vector2.cross()Bernhard Liebl
2018-03-06Update wrap functionsChaosus
2018-02-28Allow degenerate triangles in polygon triangulation when necessary.Nicolas Silva
2018-02-08Fix is_point_in_triangleChaosus
2018-02-05Fix polygon triangulation failure.Nicolas Silva
The ear clipping algorithm used to triangulate polygons has a slightly too conservative point-in-triangle test which can, in some configurations prevent it from finding a possible tessellation. Relaxing the test by considering that points exactly on edges don't belong the triangle fixes the issue. Changing the semantic of the test is safe because no other code makes use of it. A more detailed explanation can be found in issue #16395. Fixes #16395.
2018-01-21Add Geometry::line_intersects_line_2d()Bernhard Liebl
2018-01-18Fix typos in code and docs with codespellRémi Verschelde
Using v1.11.0 from https://github.com/lucasdemarchi/codespell
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
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.
2018-01-03Merge pull request #15093 from poke1024/canvas-editor-selectRémi Verschelde
More exact picking for canvas editor
2018-01-02Merge pull request #15083 from tagcup/spatial_rot_fixJuan Linietsky
Restore the behavior of Spatial rotations recently changed in c1153f5.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-01-01Merge pull request #15091 from poke1024/fix-rect2-distance-toNoshyaar
Fix Rect2::distance_to() not returning 0
2017-12-27Restore the behavior of Spatial rotations recently changed in c1153f5.tagcup
That change was borne out of a confusion regarding the meaning of "local" in #14569. Affine transformations in Spatial simply correspond to affine operations of its Transform. Such operations take place in a coordinate system that is defined by the parent Spatial. When there is no parent, they correspond to operations in the global coordinate system. This coordinate system, which is relative to the parent, has been referred to as the local coordinate system in the docs so far, but this sloppy language has apparently confused some users, making them think that the local coordinate system refers to the one whose axes are "painted" on the Spatial node itself. To avoid such conceptual conflations and misunderstandings in the future, the parent-relative local system is now referred to as "parent-local", and the object-relative local system is called "object-local" in the docs. This commit adds the functionality "requested" in #14569, not by changing how rotate/scale/translate works, but by adding new rotate_object_local, scale_object_local and translate_object_local functions. Also, for completeness, there is now global_scale. This commit also updates another part of the docs regarding the rotation property of Spatial, which also leads to confusion among some users.
2017-12-27More exact picking for canvas editorBernhard Liebl
2017-12-27Fix Rect2::distance_to() not returning 0Bernhard Liebl
2017-12-27Merge pull request #15045 from poke1024/vector2-inlineNoshyaar
Inline some very common Vector2 operations
2017-12-26Change the rotate function of Spatial to be local, makes more sense. Closes ↵Juan Linietsky
#14569
2017-12-25Inline some very common Vector2 operationsBernhard Liebl
2017-12-25Add missing parameter namesPoommetee Ketson
2017-12-21Fixes grow_margin not working at allGilles Roudiere
2017-12-10Fix wrong return value in some virtual method bindingsRémi Verschelde
2017-12-09Merge pull request #13347 from Noshyaar/hang_in_thereRémi Verschelde
Rect2: add function returning same rect with positive w and h
2017-12-07Style: Apply new clang-format 5.0 style to all filesRémi Verschelde