summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2021-10-15Swap args of Plane(point, normal) constructormennomax
Now (normal, point)
2021-10-11Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and ↵Juan Linietsky
NodeAnimation"
2021-10-09implement ping-pong loop in animationTokage
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-07Replace references to VisualServer in code comments with RenderingServerHugo Locurcio
VisualServer no longer exists in the `master` branch.
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-30Merge pull request #52544 from JFonS/lod_fixesJuan Linietsky
Auto LOD fixes and improvements
2021-09-29Fix buffer overflow in 2D BVHPouleyKetchoupp
Some areas of code were missed and assumed Vector3.
2021-09-27Auto LOD fixes and improvementsjfons
* Fixed LODs for shadow meshes. * Added a merging step before simplification. This helps with tesselated meshes that were previously left untouched. The angle difference at wich edges ar considered "hard" can be tweaked as an import setting. * LODs will now start with the highest decimation possible and keep doubling (approximately) the number of triangles from there. This makes sure that very low triangle counts are included when possible. * Given more weight to normal preservation. * Modified MeshOptimizer to report distance-based error instead of including attributes in the reported metrics. * Added attribute transference between the original mesh and the various LODs. Right now only normals are taken into account, but it could be expanded to other attributes in the future.
2021-09-24Fix Face3::get_random_point_inside()John Wigg
Use correct overload of Math::random(from, to) to return floating point values within the correct range.
2021-09-24Merge pull request #52430 from AnilBK/vector2-replacementsRémi Verschelde
2021-09-23Construct values only when necessary.Anilforextra
2021-09-21Merge pull request #52878 from AnilBK/add-get-centerRémi Verschelde
2021-09-21Add Get Center Method for Rect2/Rect2i and AABB.Anilforextra
2021-09-20Merge pull request #52398 from deakcor/dev-transformRémi Verschelde
2021-09-19Expose get_skew for transform2d and add new constructorVincent D
Expose set_scale and set_skew for transform2d Replacing float by real_t Adding const parameters Updated transform2d doc
2021-09-17Replace Vector3.to_diagonal_matrix with Basis.from_scaleAaron Franke
2021-09-16Merge pull request #52358 from kleonc/astar_error_messagesRémi Verschelde
`AStar` Add error messages
2021-09-14Clean convex hull decomposition codePouleyKetchoupp
Remove unnecessary conversion between triangle data and vertex data whenever possible.
2021-09-13Revert some URLs from the "Replace HTTP URLs with HTTPS" PRAaron Franke
2021-09-10Merge pull request #52229 from lawnjelly/basis_quat_warningMax Hilbrunner
Improve Basis::get_quaternion error message
2021-09-07Merge pull request #52097 from mortarroad/master-fix-convex-hull-double-edgesMax Hilbrunner
Fix emitting duplicate edges for convex hulls
2021-09-07Use builtin Vector2 functions for calculation of angles.Anilforextra
.
2021-09-03AStar Add error messageskleonc
2021-08-31Add Vector2.from_angle() methodkobewi
2021-08-30Improve Basis::get_quaternion error messagelawnjelly
The previous error message incorrectly suggested that any Basis could be fixed by calling get_rotation_quation() or orthonormalize(). This PR points out that only a valid rotation Basis can be fixed in this way.
2021-08-25Fix segment intersection consistency in Geometry2DPouleyKetchoupp
Segment collision results could be different depending on the direction when they exactly touch (order of the points in segments). This was due to the way parallelism was checked, using different logic based on positive or negative sign of cross products. Now the results are the same whatever the direction, without changing the current design, which is that parallel or colinear segments are not considered colinear. Fixes inconsistencies with raycasts exactly on edges of convex shapes depending on the direction.
2021-08-25Fix emitting duplicate edges for convex hullsMorris Tabor
Identical to https://github.com/godotengine/godot/pull/52059
2021-08-22Replace HTTP links with HTTPS for sites with HTTPS versionsAaron Franke
2021-08-22Replace BIND_VMETHOD by new GDVIRTUAL syntaxreduz
* New syntax is type safe. * New syntax allows for type safe virtuals in native extensions. * New syntax permits extremely fast calling. Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`. These will require API rework on a separate PR as they work different than the rest of the functions. Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-20Fix winding of new convex hull implementation.Morris Tabor
2021-08-16Merge pull request #51368 from ↵Rémi Verschelde
TwistedTwigleg/GSOC_2020_Working_Branch_IK_SQUASHED New and improved IK system for Skeleton3D - Squashed!
2021-08-15Add constant to vector function parameters that don't actually modify their ↵Ricard Rovira Cubeles
input. Add more overloads of vector multiplication, required by templates to compile with float=64.
2021-08-14New and improved IK system for Skeleton3DTwistedTwigleg
This PR and commit adds a new IK system for 3D with the Skeleton3D node that adds several new IK solvers, as well as additional changes and functionality for making bone manipulation in Godot easier. This work was sponsored by GSoC 2020 and TwistedTwigleg Full list of changes: * Adds a SkeletonModification3D resource * This resource is the base where all IK code is written and executed * Adds a SkeletonModificationStack3D resource * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node * Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK * Each modification is in it's own file * Several changes to Skeletons, listed below: * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them. * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D * Added functions for getting the forward position of a bone * BoneAttachment3D node refactored heavily * BoneAttachment3D node is now completely standalone in its functionality. * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes * BoneAttachment3D now can be set either using the index or the bone name. * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility * BoneAttachment3D now shows a warning when not configured correctly * Added rotate_to_align function in Basis * Added class reference documentation for all changes
2021-08-13Fix some unnecessary includesAaron Franke
2021-08-10Merge pull request #50682 from aaronfranke/basis-looking-atRémi Verschelde
Move code for looking_at to Basis
2021-08-08[Text Server] Improve object (image/table) inline alignment.bruvzg
2021-08-07Fix Transform::xform(Plane) functionslawnjelly
The Transform::xform and xform_inv are made safe for Planes when using non-uniform scaling. Optimization of calling sites to prevent loss of performance from the changes to xform(Plane).
2021-08-01Move code for looking_at to BasisAaron Franke
2021-08-01Merge pull request #48958 from ↵Rémi Verschelde
kleonc/astar-get_available_point_id-start-from-zero Astar::get_available_point_id Return 0 instead of 1 when empty
2021-07-30Remove obsolete "dectime" methodAaron Franke
Replaced by "move_toward"
2021-07-25Merge pull request #50809 from akien-mga/iterators-const-referencesRémi Verschelde
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-25Fix various typos with codespellluz paz
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-23Merge pull request #50748 from JFonS/gizmo_reworkRémi Verschelde
Node3D gizmo improvements
2021-07-23Node3D gizmo improvementsjfons
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs. * Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins. * Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes. * Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles. * Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
2021-07-21Add min_axis and max_axis to Vector2iGilles Roudière
2021-07-21Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio
The `Math_INF` and `Math_NAN` defines were just aliases for those constants, so we might as well use them directly. Some portions of the code were already using `INFINITY` directly.
2021-06-29Implement painting properties over TileSetsGilles Roudière
2021-06-18Merge pull request #44156 from aaronfranke/quat-angle-toRémi Verschelde
Add Quaternion angle_to method