Commit graph

712 commits

Author SHA1 Message Date
Rémi Verschelde e2e9b08cc7
Color: Bind from_hsv as static method 2021-11-11 11:50:02 +01:00
Rémi Verschelde 06a33e590f
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
Brian Semrau dc11e73bf0 Rename AABB get_area to get_volume 2021-11-05 18:22:42 -04:00
Aaron Franke 744b43b527
Fix Quaternion multiplication operator 2021-11-04 11:24:46 -05:00
Silc 'Tokage' Renew 953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Rémi Verschelde 0ae65472e7
clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Rémi Verschelde 24fdedfe94
Merge pull request #54050 from reduz/animation-compression 2021-10-25 14:27:58 +02:00
reduz a69541da4c Implement Animation Compression
Roughly based on https://github.com/godotengine/godot-proposals/issues/3375 (used format is slightly different).

* Implement bitwidth based animation compression (see animation.h for format).
* Can compress imported animations up to 10 times.
* Compression format opens the door to streaming.
* Works transparently (happens all inside animation.h)
2021-10-21 18:27:34 -03:00
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
mennomax b4eeeb315a
Swap args of Plane(point, normal) constructor
Now (normal, point)
2021-10-15 20:49:42 -05:00
Juan Linietsky 610de0974d
Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation" 2021-10-11 19:27:50 -03:00
Tokage 372ba76663 implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-09 18:08:43 +09:00
Hugo Locurcio bcf4a56c74
Replace references to VisualServer in code comments with RenderingServer
VisualServer no longer exists in the `master` branch.
2021-10-07 15:49:41 +02:00
Lightning_A c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Juan Linietsky c370b4c4d0
Merge pull request #52544 from JFonS/lod_fixes
Auto LOD fixes and improvements
2021-09-30 14:49:11 -03:00
PouleyKetchoupp d3c6395dcd Fix buffer overflow in 2D BVH
Some areas of code were missed and assumed Vector3.
2021-09-29 12:10:23 -07:00
jfons 9e1810695c Auto LOD fixes and improvements
* 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-27 17:04:56 +02:00
John Wigg ccf05aeb9a
Fix Face3::get_random_point_inside()
Use correct overload of Math::random(from, to) to return floating point values within the correct range.
2021-09-24 21:41:17 +02:00
Rémi Verschelde 32ab77ef8f
Merge pull request #52430 from AnilBK/vector2-replacements 2021-09-24 13:04:42 +02:00
Anilforextra cc51b045da Construct values only when necessary. 2021-09-23 22:26:07 +05:45
Rémi Verschelde ba57252bd8
Merge pull request #52878 from AnilBK/add-get-center 2021-09-21 21:30:30 +02:00
Anilforextra 90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
Rémi Verschelde 89417ba75b
Merge pull request #52398 from deakcor/dev-transform 2021-09-20 08:46:51 +02:00
Vincent D aa82cb6f35 Expose get_skew for transform2d and add new constructor
Expose set_scale and set_skew for transform2d

Replacing float by real_t

Adding const parameters

Updated transform2d doc
2021-09-19 17:10:05 +02:00
Aaron Franke bf0213470c
Replace Vector3.to_diagonal_matrix with Basis.from_scale 2021-09-17 10:30:30 -05:00
Rémi Verschelde ca5c28fed4
Merge pull request #52358 from kleonc/astar_error_messages
`AStar` Add error messages
2021-09-16 13:36:13 +02:00
PouleyKetchoupp 2ca94e51e4 Clean convex hull decomposition code
Remove unnecessary conversion between triangle data and vertex data
whenever possible.
2021-09-14 17:14:06 -07:00
Aaron Franke 3a902c66c4
Revert some URLs from the "Replace HTTP URLs with HTTPS" PR 2021-09-13 15:18:35 -05:00
Max Hilbrunner 744d5829b7
Merge pull request #52229 from lawnjelly/basis_quat_warning
Improve Basis::get_quaternion error message
2021-09-10 13:21:00 +02:00
Max Hilbrunner f8fb2bc0b4
Merge pull request #52097 from mortarroad/master-fix-convex-hull-double-edges
Fix emitting duplicate edges for convex hulls
2021-09-07 21:50:16 +02:00
Anilforextra a1f616dcfc Use builtin Vector2 functions for calculation of angles.
.
2021-09-07 08:30:26 +05:45
kleonc 71255bc2a9 AStar Add error messages 2021-09-03 00:06:23 +02:00
kobewi 3f3739ccb5 Add Vector2.from_angle() method 2021-08-31 01:53:58 +02:00
lawnjelly d3a3b3aff3 Improve Basis::get_quaternion error message
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-30 07:26:25 +01:00
PouleyKetchoupp 511c80b2ec Fix segment intersection consistency in Geometry2D
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-25 18:17:52 -07:00
Morris Tabor 75dd294732 Fix emitting duplicate edges for convex hulls
Identical to https://github.com/godotengine/godot/pull/52059
2021-08-25 14:18:45 +02:00
Aaron Franke ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* 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-22 08:23:58 -03:00
Morris Tabor 054c7a125f Fix winding of new convex hull implementation. 2021-08-20 14:44:56 +02:00
Rémi Verschelde fff9a451a1
Merge pull request #51368 from TwistedTwigleg/GSOC_2020_Working_Branch_IK_SQUASHED
New and improved IK system for Skeleton3D - Squashed!
2021-08-16 15:37:17 +02:00
Ricard Rovira Cubeles a8d12b5a61 Add constant to vector function parameters that don't actually modify their input.
Add more overloads of vector multiplication, required by templates to compile with float=64.
2021-08-15 16:45:37 +02:00
TwistedTwigleg 5ffed49907 New and improved IK system for Skeleton3D
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-14 15:57:00 -04:00
Aaron Franke eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
Rémi Verschelde 16d73fefdb
Merge pull request #50682 from aaronfranke/basis-looking-at
Move code for looking_at to Basis
2021-08-10 11:28:12 +02:00
bruvzg 7c3c5603d0 [Text Server] Improve object (image/table) inline alignment. 2021-08-08 22:35:47 +03:00
lawnjelly dd0f54a368 Fix Transform::xform(Plane) functions
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-07 11:10:50 +01:00
Aaron Franke 9f3ae0adcd
Move code for looking_at to Basis 2021-08-01 12:49:02 -05:00