Commit graph

733 commits

Author SHA1 Message Date
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
great90
10c91f8116
Fix variable name 'max_size' to 'min_size' in aabb 2021-12-19 11:51:14 +08:00
Haoyu Qiu
1fb59d13c2 Fix font preview text color on light background 2021-12-18 00:34:28 +08:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Aaron Franke
24f57886d0
Expose max_axis_index and max_axis_index for Vector2(i)
Some cleanup with Vector3(i)'s methods so that it is consistent with Vector2, for example it returns enums internally (GDScript still gets ints).
2021-12-02 23:45:41 -06:00
Rémi Verschelde
892a5a72cd
Merge pull request #55474 from akien-mga/copy-operators-no-reference 2021-12-02 17:34:45 +01:00
Max Hilbrunner
837e6bdf18
Merge pull request #37626 from aaronfranke/rect2-warnings
Print warnings when using a Rect2 or AABB with a negative size
2021-12-02 14:41:02 +01:00
Rémi Verschelde
49d8925713
Merge pull request #47294 from sebastian-heinz/patch-1 2021-12-02 10:04:17 +01:00
Rémi Verschelde
02d6cbfd8c
Merge pull request #38604 from Calinou/astar-rename-get-point-ids 2021-12-02 09:35:57 +01:00
sebastian-heinz
be90aadbcd allow variant construction in expressions 2021-12-02 15:30:10 +08:00
Raul Santos
a367378f9e Rename Vector parameters to be consistent
Renames parameters that were named differently across different
scripting languages or their documentation to use the same name
everywhere.
2021-12-01 21:14:46 +01:00
Aaron Franke
9687f6fca3
Warn when using an AABB or Rect2 with a negative size 2021-11-30 18:27:58 -06:00
Hugo Locurcio
89849a9ed9
Rename AStar.get_points() to AStar.get_point_ids() for clarity
The same has been done for AStar2D as well.
2021-11-30 22:14:39 +01:00
Rémi Verschelde
7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde
2b24629847
Merge pull request #55042 from nekomatata/fix-segment-intersection 2021-11-17 17:33:56 +01:00
Yuri Roubinsky
a74acca858 Expose randfn to global scope 2021-11-17 14:29:19 +03:00
PouleyKetchoupp
6d0c93dccf Fix segment intersection in Geometry2D
Doing a multiplication to reduce the amount of tests was causing
precision which lead to 2D raycast detecting false positive contacts
in some cases with convex polygons.
2021-11-16 18:09:33 -07:00
Hugo Locurcio
8fb7e622a6
Rename built-in SGN() macro to SIGN()
This matches the name of the GDScript function (except it's uppercase
here).
2021-11-16 20:40:49 +01:00
Rémi Verschelde
d975b1bc37
Merge pull request #43072 from KoBeWi/point_to_angle 2021-11-15 09:56:21 +01:00
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
Tomasz Chabora
606cfa9a47 Fix Vector2.angle_to_point() being reversed 2021-11-09 16:59:58 +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