Commit graph

8315 commits

Author SHA1 Message Date
Yuri Roubinsky 61904d56ea Better port handling connection for GraphEdit 2021-08-12 09:09:24 +03:00
PouleyKetchoupp f9176a39ce Make radius & height in CapsuleShape3D independent
Also changed CapsuleMesh to make settings consistent between render and
physics.
2021-08-11 14:54:53 -07:00
Rémi Verschelde 7188cb6012
Merge pull request #51498 from codecat/fix-triple-click
Triple click in text editor now uses last mouse position for validity
2021-08-11 23:44:55 +02:00
Melissa Geels 408401a642 Triple click in text editor now uses last mouse position for validity
Previously, you would be able to double click a word, followed by
single-clicking another word on the same line, which would select the
entire line. Now, it will only select the whole line if the mouse
position has remained the same after the double click. This mimicks the
behavior in most third party text editors.

Fixes #51312.
2021-08-11 21:49:26 +02:00
kobewi b35a2516a0 Improve CapsuleShape2D size clamping 2021-08-11 21:39:18 +02:00
Yuri Roubinsky 9cf158019d Changed TransformMult node to TransformOp in visual shaders 2021-08-11 22:05:04 +03:00
Rémi Verschelde e30be92ce8
Merge pull request #41634 from KoBeWi/the_independence 2021-08-11 18:16:24 +02:00
Tomasz Chabora f12f5b36b5 Make radius & height in CapsuleShape2D independent 2021-08-11 17:34:27 +02:00
Rémi Verschelde a57d420224
Merge pull request #51500 from timothyqiu/navmesh-doc 2021-08-11 14:12:56 +02:00
Melissa Geels ed4c3eb7b3 Move cursor to edge of selection when moving caret left/right
This is to mimic the behavior of many third party text editors. The
reason it's not doing it when moving by word is due to that behavior
being mostly the same on other editors.
2021-08-11 13:27:12 +02:00
Haoyu Qiu 60298328ca Improve NavigationMesh typing, parameter validation and documentation 2021-08-11 18:18:10 +08:00
Yuri Roubinsky 0eb97c11cf Few improvements for constants in visual shader 2021-08-11 13:14:16 +03:00
Rémi Verschelde c00303ff55
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
2021-08-11 11:20:45 +02:00
Rémi Verschelde 80dec1948a
Merge pull request #41956 from Calinou/rename-engine-iterations-per-second
Rename `iterations_per_second` to `physics_ticks_per_second`
2021-08-11 08:05:33 +02:00
Rémi Verschelde 7d43da928f
Merge pull request #51490 from nekomatata/clean-character-body
Remove infinite inertia and ray shapes from CharacterBody
2021-08-11 08:04:09 +02:00
Rémi Verschelde 2c88e1c15d
Merge pull request #51178 from Geometror/layout-options-textline-textparagraph
Various text layout improvements (TextLine, TextParagraph, Label, TextServer)
2021-08-11 07:51:57 +02:00
Rémi Verschelde 588883eb4a
Merge pull request #51442 from Geometror/styleboxflat-fake-aa-float
StyleBox fake AA improvements (make anti aliasing size a float property)
2021-08-11 07:35:53 +02:00
Hugo Locurcio 937c1a716c
Rename iterations_per_second to physics_ticks_per_second
This makes it clearer that this property is only about physics FPS,
not rendering FPS.

The `physics_fps` project setting was also renamed to
`physics_ticks_per_second` for consistency.
2021-08-11 02:37:02 +02:00
Hendrik Brucker 403f4902d0 Various text layout improvements (TextLine, TextParagraph, Label, TextServer) 2021-08-11 00:09:48 +02:00
Hendrik Brucker db2460f43c StyleBox fake AA improvements (aa_size float property) 2021-08-10 23:37:06 +02:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
K. S. Ernest (iFire) Lee 18bd0fee5a
Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
2021-08-10 15:42:04 -04:00
Umang Kalra 12fc3f1eef Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this 
feature is compact, with minimum crossings between connections
& uniform horizontal & vertical gaps between the nodes. 

This work has been sponsored by GSoC '21.

Full list of additions/changes:
• Added arrange_nodes() method in GraphEdit module.
    • This method computes new positions for all the selected
      nodes by forming blocks and compressing them.
      The nodes are moved to these new positions. 
    • Adding this method to GraphEdit makes it available for 
      use in VisualScript/VisualShaders editors and its other
      subclasses. 
• Button with an icon has been added to call arrange_nodes() in GraphEdit. 
    • This button is inherited by VisualScript/VisualShaders editors
       to invoke the method.
• Undo/redo is functional with this method.
    • By using signals in arrange_nodes(), position changes are registered 
       in undo/redo stack of the subclass that is using the method. 
• Metadata of the method has been updated in ClassDB
• Method description has been added to class reference of GraphEdit
2021-08-11 00:44:28 +05:30
PouleyKetchoupp 4da3a87f7d Remove infinite inertia and ray shapes from CharacterBody
Infinite inertia:
Not needed anymore, since it's now possible to set one-directional
collision layers in order for characters to ignore rigid bodies, while
rigid bodies still collide with characters.

Ray shapes:
They were introduced as a work around to allow constant speed on slopes,
which is now possible with the new property in CharacterBody instead.
2021-08-10 12:10:26 -07:00
Rémi Verschelde ac1dab5062
Merge pull request #51027 from fabriceci/improve-move-and-slide
Add properties to CharacterBody for more move_and_slide options
2021-08-10 18:55:58 +02:00
Rémi Verschelde dce488d8f7
Merge pull request #49417 from Bhu1-V/gsoc-cmd-plt
Command Palette For Godot
2021-08-10 18:55:22 +02:00
Aaron Franke 339687e04f
Organize methods in Viewport and explicitly name 3D methods with 3D 2021-08-10 09:10:34 -05:00
fabriceci c6666cc051 Add properties to CharacterBody for more move_and_slide options 2021-08-10 15:57:33 +02:00
Rémi Verschelde 50d5569ad4
Merge pull request #51457 from nekomatata/moving-platforms-3d
Fix 3D moving platform logic
2021-08-10 14:12:01 +02: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
Rémi Verschelde 483bbd6ecc
Merge pull request #51464 from hpnrep6/mesh-disable-deprecated
Enclose deprecated components with `DISABLE_DEPRECATED` in Mesh
2021-08-10 09:56:27 +02:00
Rémi Verschelde d56da233c4
Merge pull request #51463 from SaracenOne/assign_path_fix
Assign embedded text resource path earlier to prevent error on embedded scripts
2021-08-10 08:13:14 +02:00
Rémi Verschelde 536950f9f3
Merge pull request #21922 from aaronfranke/double
Some work on double-precision support
2021-08-10 07:41:46 +02:00
hpnrep6 0eca908e86
Enclose unused components in DISABLE_DEPRECATED 2021-08-10 00:54:24 -04:00
SaracenOne d00c151db1 Assign embedded text resource path earlier to prevent error on embedded scripts. 2021-08-10 05:42:35 +01:00
PouleyKetchoupp ec9fed69f4 Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion
by using a call to move_and_collide that excludes the platform itself,
instead of making it part of the body motion.

Helps with handling walls and slopes correctly when the character walks
on the moving platform.

Also made some minor adjustments to the 2D version and documentation.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-08-09 20:21:04 -07:00
Nathan Franke b57b8453b1
Follow-Up Add SNames to get theme icon 2021-08-09 17:50:26 -05:00
Aaron Franke 430ad75963
Some work on double support 2021-08-09 17:43:48 -05:00
Rémi Verschelde 2de5d2361a
Merge pull request #51446 from nekomatata/fix-moving-platform-rotation
Fix applied rotation from moving platforms in move_and_slide
2021-08-09 23:20:44 +02:00
PouleyKetchoupp 5650c83e4b Fix applied rotation from moving platforms in move_and_slide
When synchronizing CharacterBody motion with moving the platform using
direct body state, only the linear velocity was taken into account.

This change exposes velocity at local point in direct body state and
uses it in move_and_slide to get the proper velocity that includes
rotations.
2021-08-09 12:30:17 -07:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Aaron Franke 78d33a6e24
Use doubles for time in animation code 2021-08-09 14:04:25 -05:00
Rémi Verschelde dc20830348
Merge pull request #45568 from aaronfranke/node3d-real_t
Use real_t in 3D nodes
2021-08-09 21:01:29 +02:00
Fabio Alessandrelli 511f961973
Merge pull request #51097 from Faless/mp/4.x_spawnable
[Net] MultiplayerAPI remote scene spawning/despawning.
2021-08-09 19:45:31 +02:00
Rémi Verschelde 0a38d5c8f7
Merge pull request #43158 from nathanfranke/fix-gradient-and-draw-tile
Fix Gradient and Color Picker checkerboard, Fix tile parameter for CanvasItem.draw_texture_rect
2021-08-09 16:47:58 +02:00
Fabio Alessandrelli 9fcf3b5a9c [Net] Basic extensible MultiplayerAPI spawn/despawn.
`PackedScene`s can be configured to be spawnable via a new
`MultiplayerAPI.spawnable_config` method.
They can be configured either to be spawned automatically when coming
from the server or to always require verification.
Another method, `MultiplayerAPI.send_spawn` lets you request a spawn on
the remote peers.
When a peer receive a spawn request:
- If it comes from the server and the scene is configured as
  `SPAWN_MODE_SERVER`:
  - Spawn the scene (instantiate it, add it to tree).
  - Emit signal `network_spawn`.
- Else:
  - Emit signal `network_spawn_request`.

In a similar way, `despawn`s are handled automatically in
`SPAWN_MODE_SERVER`.

In `SPAWN_MODE_SERVER`, when a new client connects it will also receive,
from the server all the spawned (and not yet despawned) instances.
2021-08-09 16:34:40 +02:00
Bhuvan Vemula a0a019a998 Added EditorCommandPalette 2021-08-09 17:41:50 +05:30
Rémi Verschelde 85399a9170
Merge pull request #51155 from Chaosus/shader_fix_specular_mode
Fix a default shader specular render mode to `SCHLICK_GGX`
2021-08-09 08:13:47 +02:00
bruvzg 7c3c5603d0 [Text Server] Improve object (image/table) inline alignment. 2021-08-08 22:35:47 +03:00
Nathan Franke 051234e84e
Fix Gradient, Color Picker BG, Fix CanvasItem::draw_texture_rect p_tile 2021-08-07 16:40:50 -05:00
Michael Alexsander 4bef900399 Invert how global_rate_scale value works, and rename it to playback_speed_scale 2021-08-07 12:32:42 -03:00
Rémi Verschelde 3177da1d05
Merge pull request #51360 from Paulb23/item-list-bg-colour-update 2021-08-07 14:14:08 +02:00
Paulb23 738b0fdae5 Redraw on item list custom bg/fg colour change 2021-08-07 12:08:46 +01:00
Raul Santos 18f7acf611 Fix Path3D initial forward calculation 2021-08-07 12:39:34 +02:00
Yuri Roubinsky 47a6bb2f28 Fix a default shader specular render mode to (SCHLICK_GGX/BLINN) 2021-08-06 16:01:58 +03:00
Aaron Franke 136dd887ad
Preserve original name in shader params cache 2021-08-05 18:31:08 -05:00
PouleyKetchoupp b9e68c8155 Fix one-way collision in Tilemap
In a given quadrant there can be one or more bodies used, and the
process iterated over cells to add the shapes, so the shape index
doesn't necessarily correspond to the polygon shape index.

Instead body shape indices need to be tracked separately.
2021-08-05 12:10:35 -07:00
kobewi 665dc7805b Fix get_used_rect() calculation 2021-08-05 20:40:21 +02:00
Rémi Verschelde de2c2be19b
Shortcut: Rename shortcut property to event
Having a property which has the same name as its class leads to confusing
situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut`
which has a `shortcut` property of type `InputEvent`).

Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event`
to better reflect what the methods check.
2021-08-05 13:48:43 +02:00
kleonc fd483c729f TabContainer: Fix error on removing top-level Control child, Remove _get_tab method 2021-08-04 21:13:10 +02:00
PouleyKetchoupp 7d0a28f875 Fix inverted condition in CharacterBody2D/3D set_max_slides 2021-08-03 19:24:46 -07:00
Aaron Franke 7cec3c2b95
Use real_t in 3D nodes 2021-08-03 11:16:51 -05:00
Rémi Verschelde 57a5186b08
Merge pull request #51006 from foxydevloper/drag-drop-naming
Name nodes added when drag & dropping an image by `name_casing`
2021-08-03 09:38:03 +02:00
Rémi Verschelde e0b560fb6f
Merge pull request #51177 from kleonc/tab_container-drop-tab-index-fix
TabContainer Fix moving dropped tab to incorrect child index
2021-08-03 09:34:51 +02:00
Rémi Verschelde 0f8cba285b
Merge pull request #50986 from raulsntos/fix-path-3d-end 2021-08-03 09:31:22 +02:00
Yuri Roubinsky a34a91a30b Added more input/output built-ins to visual shaders 2021-08-03 09:32:40 +03:00
Rémi Verschelde 26481cff95
Merge pull request #51198 from Calinou/codeedit-improve-callhint-highlight
Improve CodeEdit's callhint highlight visibility
2021-08-03 08:02:20 +02:00
K. S. Ernest (iFire) Lee 04703c6f66
Merge pull request #51042 from nikitalita/fix_binary_res_load_save
Fix binary resource loading and saving
2021-08-02 18:41:05 -07:00
Hugo Locurcio 3ea3addc79
Improve CodeEdit's callhint highlight visibility
This makes the currently edited parameter more visible in the
script editor's code completion hint.
2021-08-02 23:16:16 +02:00
Rémi Verschelde c17a541650
Merge pull request #51039 from nekomatata/layer-grid-32
Refactor layer property editor grid
2021-08-02 21:14:16 +02:00
Yuri Roubinsky bd6b7c4b0f
Merge pull request #51144 from Chaosus/vs_version
Makes dictionary instead of string for visual shader version
2021-08-02 21:55:50 +03:00
Rémi Verschelde c620ede327
Merge pull request #50122 from Paulb23/code_edit_auto_brace_completion 2021-08-02 20:44:39 +02:00
Yuri Roubinsky 94c6817b51 Makes dictionary instead of string for visual shader version
Update doc/classes/VisualShader.xml

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-08-02 21:34:19 +03:00
Rémi Verschelde 737d3d31a6
Merge pull request #51192 from timothyqiu/sdfgi-enum-range
Validates set_sdfgi_cascades argument range
2021-08-02 18:20:58 +02:00
Rémi Verschelde 51fac9e3c7
Merge pull request #51187 from timothyqiu/vertex-index-3
Fix crash when number of indices to optimize is not a multiple of 3
2021-08-02 18:19:06 +02:00
Haoyu Qiu b6638cb80d Validates set_sdfgi_cascades argument range 2021-08-02 23:50:59 +08:00
Rémi Verschelde 2db45b62c0
Merge pull request #51185 from timothyqiu/tile-data-enum-range
Validate TileData enum range before using it as index
2021-08-02 17:20:44 +02:00
Rémi Verschelde 5360c2012c
Merge pull request #51004 from groud/tilemap_layers
Implements TileMap layers and move TileSetPlugins's functions to the TileMap node instead
2021-08-02 17:20:32 +02:00
Haoyu Qiu 0c879ab288 Fix crash when number of indices to optimize is not a multiple of 3 2021-08-02 23:07:18 +08:00
Haoyu Qiu 091d802692 Validate TileData enum range before using it as index 2021-08-02 22:49:23 +08:00
kleonc a5a4532378 TabContainer Fix moving dropped tab at incorrect child index 2021-08-02 14:15:51 +02:00
kobewi 053f20be76 Add null check to Tween.bind_node() 2021-08-02 14:15:40 +02:00
Gilles Roudière ad8b5cd5a4 Implements TileMap layers and move TileSetPlugins's functions to the TileMap node instead 2021-08-02 13:54:39 +02:00
Aaron Franke 9f3ae0adcd
Move code for looking_at to Basis 2021-08-01 12:49:02 -05:00
Paulb23 809a32c045 Clean up and complete CodeEdit inspector and docs 2021-08-01 12:24:19 +01:00
Paulb23 dd5a37f556 Move symbol lookup into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 8f900ac178 Move line length guidelines into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 d1a1ad127e Move brace matching into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 12f0053555 Move auto brace completion to CodeEdit 2021-08-01 12:06:33 +01:00
Yuri Sizov 7137ebdaf6 Make theme item overrides more obvious in the Inspector 2021-07-31 23:46:24 +03:00
Rémi Verschelde f2efa6f4f3
Merge pull request #51083 from akien-mga/variantparser-fix-crash-42115
VariantParser: Fix uninitialized ResourceParser funcs
2021-07-31 00:02:23 +02:00
Rémi Verschelde 63be3c1f00
Merge pull request #50935 from Vitika9/50807 2021-07-30 23:37:07 +02:00
Rémi Verschelde f3aaa713d9
VariantParser: Fix uninitialized ResourceParser funcs
They could cause a segfault when parsing values with ID "Resource"
as apparently we never set a valid `func` for it.

Fixes crash part of #42115.
2021-07-30 23:23:31 +02:00
PouleyKetchoupp 7a0c210f9b Refactor layer property editor grid
- Now able to display up to 32 layers in physics (still 20 for render)
- Adjustable grid size to fit available space in dock
- Expansion icon to display more layers vertically
- Layer numbers in cells to help with selection
2021-07-30 11:19:50 -07:00
Michael Alexsander b70b9c4ede Fix "Custom *" theme sections being inside "Auto Translate" 2021-07-30 13:55:07 -03:00
Rémi Verschelde 6d5c1086c3
Merge pull request #50982 from Calinou/editor-use-bullet-points
Use bullet points in the editor instead of dashes where relevant
2021-07-30 13:42:20 +02:00
nikitalita bc58bf5477 Use constant for reserved field count 2021-07-29 22:24:29 -07:00
nikitalita 160601cc78 Fix binary resource loading and saving 2021-07-29 18:17:49 -07:00
Michael Alexsander 94a64d557e Add auto_translate toggle for automatic translation 2021-07-29 18:30:34 -03:00
reduz 55d357b1eb Fix directional shadow bias
* Simplified code a lot, bias based on normalized cascade size.
* Lets scale cascades, max distance, etc. without creating acne.
* Fixed normal biasing in directional shadows.

I removed normal biasing in both omni and spot shadows, since the technique can't be easily implemented there.
Will need to be replaced by something else.
2021-07-29 13:51:32 -03:00
Yuri Sizov 0ab661de63 Fix a crash when trying to load a WebP StreamTexture2D 2021-07-29 16:05:03 +03:00
foxydevloper 07a8f0fe38 Name nodes added from drag & drop by name_casing 2021-07-29 00:29:24 -04:00
Raul Santos e23f6a5bba Fix forward calculation in PathFollow3D for the position at the end of the curve 2021-07-28 22:10:36 +02:00
Hugo Locurcio 07dbe2045a
Use bullet points in the editor instead of dashes where relevant 2021-07-28 19:40:45 +02:00
Hugo Locurcio 48fc5b2480
Add node configuration warning for GeometryInstance3D distance 2021-07-28 19:33:14 +02:00
Rémi Verschelde 60eb508fbb
Merge pull request #50961 from YeldhamDev/embed_windows_fixes
Multiple cosmetic fixes for embedded windows
2021-07-28 18:24:07 +02:00
Michael Alexsander 79fc188fc4 Multiple cosmetic fixes for embedded windows 2021-07-27 23:55:06 -03:00
Rémi Verschelde 78f0d2d1d6
Merge pull request #50905 from fabriceci/fix-multiple-direction-collision
Allow multiple collision direction at the same time
2021-07-27 19:10:47 +02:00
vitika9 22eaec6895 Fixed Camera2D's reset_smoothing() does not work as described 2021-07-27 16:29:30 +05:30
K. S. Ernest (iFire) Lee 2fa4b59f99
Merge pull request #50355 from Calinou/immediategeometry3d-remove-remains
Remove the remains of ImmediateGeometry3D
2021-07-27 00:54:23 -07:00
Haoyu Qiu 448295cd51 Add check to internal methods to prevent crash 2021-07-27 12:26:13 +08:00
Rémi Verschelde caf7cbd871
Merge pull request #50904 from YeldhamDev/switch_hover_embedded
Make `switch_on_hover` work on embedded windows
2021-07-26 21:00:13 +02:00
Michael Alexsander 478b6d6a13 Make switch_on_hover work on embedded windows 2021-07-26 14:45:26 -03:00
Rémi Verschelde fab3412139
Merge pull request #50899 from akien-mga/refref
Use Ref<T> references as iterators where relevant
2021-07-26 19:45:04 +02:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
fabriceci f45af43784 Allow to have multiple collision direction at the same time 2021-07-26 19:14:41 +02:00
Aaron Franke 4ecb6fba80
Use doubles for time everywhere in Timer/SceneTree 2021-07-26 02:00:48 -04:00
Rémi Verschelde 738205d923
Merge pull request #50835 from bruvzg/optimize_is_rtl
Optimise `is_layout_rtl`.
2021-07-25 12:55:46 +02:00
Rémi Verschelde ff0b5f8fa1
Merge pull request #50809 from akien-mga/iterators-const-references 2021-07-25 12:52:58 +02:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
luz paz 3564c16cb8
Fix various typos with codespell
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-25 11:21:51 +02:00
bruvzg 9bb03e60d9 Optimise is_layout_rtl by caching its return value. 2021-07-25 10:33:00 +03:00
Rémi Verschelde 2b1e6e303e
Merge pull request #50786 from reduz/implement-resource-uids
Implement Resource UIDs
2021-07-24 17:18:12 +02:00
reduz 32b43cfeb3 Implement Resource UIDs
* Most resource types now have unique identifiers.
* Applies to text, binary and imported resources.
* File formats reference both by text and UID (when available). UID always has priority.
* Resource UIDs are 64 bits for better compatibility with the engine.
* Can be represented and used textually, example `uuid://dapwmgsmnl28u`.
* A special binary cache file is used and exported, containing the mappings.

Example of how it looks:

```GDScript
[gd_scene load_steps=2 format=3 uid="uid://dw86wq31afig2"]

[ext_resource type="PackedScene" uid="uid://bt36ojelx8q6c" path="res://subscene.scn" id="1_t56hs"]
```

GDScript, shaders and other special resource files can't currently provide UIDs, but this should be doable with special keywords on the files.
This will be reserved for future PRs.
2021-07-24 09:16:52 -03:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Rémi Verschelde 57388809f7
Merge pull request #50780 from JFonS/fix_submenus
Fix Popup submenu in single-window mode
2021-07-23 22:15:23 +02:00
Rémi Verschelde 4c3d5850de
Merge pull request #50748 from JFonS/gizmo_rework
Node3D gizmo improvements
2021-07-23 21:55:16 +02:00
jfons cfb555a081 Node3D gizmo improvements
* 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-23 21:01:10 +02:00
jfons 944b5ee639 Fix popup submenu in single-window mode
The internal processing code only works for OS windows, since it takes
the mouse position relative to the window and not the viewport. Now we
make sure it's not called in single-window mode.
2021-07-23 19:45:30 +02:00
kobewi 8793ec4564 Show tooltips even when paused or time_scale is 0 2021-07-23 17:49:30 +02:00
Rémi Verschelde c2c82de49d
Merge pull request #50676 from reduz/textual-resource-ids 2021-07-22 20:32:59 +02:00
reduz 75755beeee
Implement textual ext/subresource IDs.
* Friendlier with version control.
* Generates pseudo unique IDs, to minimize conflicts when merging, but still
  user readable (so, not UUID).
* Eventually will also allow to have more precisely named sub-resources in
  imported files.
* This will allow better reloading on changes (including resources already
  loaded) as well as better keeping track of changes on the DCC.
* Keeps backward compatibility with the old formats.
* Binary and text format version incremented to mark breakage in forward
  compatibility.
2021-07-22 19:37:47 +02:00
Michael Alexsander a690cd9251 Make MenuButton's switch_on_hover work again 2021-07-22 14:27:30 -03:00
Rémi Verschelde c8719c38e1
Merge pull request #50711 from nekomatata/popup-close-fix
Fix logic for Popup closing when parent is focused
2021-07-21 22:52:55 +02:00
PouleyKetchoupp 0b4037fe64 Fix logic for Popup closing when parent is focused
The member popped_up is used to avoid closing a Popup before it had a
chance to be focused. It wasn't reset properly when the popup is hidden,
causing the Popup to close right after showing in some random cases
(spotted on X11, might not happen on Windows).
2021-07-21 12:03:03 -07:00
Rémi Verschelde 286e9b8533
Merge pull request #50695 from reduz/fix-sky-initialization 2021-07-21 17:51:24 +02:00
Rémi Verschelde d42f6f4718
Merge pull request #50370 from QbieShay/circle-emitter-particle
Ring emitter for 4.0
2021-07-21 16:50:26 +02:00
Rémi Verschelde 59d98ed3bb
Merge pull request #50643 from groud/improve_tilemap_compatibility 2021-07-21 14:26:31 +02:00
reduz 67e5715dbf Make Sky initialize shaders only once
* Create the shader on demand.
* Makes sure compilation happens only once, then shader is cached.
* Speeds up scene loading times.
* Speeds up editor initialization.
2021-07-21 09:23:51 -03:00
Yuri Roubinsky e978b46b0f
Merge pull request #50690 from Chaosus/vs_fix_triplanar
Fix function code generation for uniform triplanar node in visual shader
2021-07-21 14:58:13 +03:00
Gilles Roudière 5d34a81e52 Implement atlas merging and tile proxies 2021-07-21 12:36:37 +02:00
Gilles Roudière 047e9b19f8 Import old tiles in SINGLE_TILE mode as atlases 2021-07-21 12:29:51 +02:00
Yuri Roubinsky 40419a394d Fix function code generation for uniform triplanar node in visual shader 2021-07-21 13:02:23 +03:00
Rémi Verschelde 2273f13fbe
Merge pull request #50686 from Calinou/use-standard-inf-nan-constants
Use the standard C `INFINITY` and `NAN` constants directly
2021-07-21 11:50:26 +02:00
Hugo Locurcio 4bd5e4fd9b
Use the standard C INFINITY and NAN constants directly
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-07-21 10:41:08 +02:00
Aaron Franke 78b0a7da03
Use is_equal_approx in more places 2021-07-21 00:32:37 -04:00
Rémi Verschelde c82daaed48
Merge pull request #38317 from verdog/get-cam-2d-4.0
add viewport.get_camera_2d()
2021-07-20 22:19:06 +02:00
Rémi Verschelde 693f9b4e20
Merge pull request #50655 from JFonS/sname_opt
Editor StringName and Viewport optimizations
2021-07-20 21:49:32 +02:00
Joan Fons a6adb58493 Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
  is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
  that.
2021-07-20 20:35:41 +02:00
Rémi Verschelde 394191c02f
Merge pull request #50605 from Calinou/tweak-shader-code-style
Use C++11 raw literals for shader code to improve readability
2021-07-20 10:05:13 +02:00
Rémi Verschelde b4baec08cf
Merge pull request #50206 from groud/undoredo_increase_args_count
Increase the number of arguments accepted by UndoRedo methods
2021-07-20 09:50:01 +02:00
Rémi Verschelde a0bc2f359d
Merge pull request #50588 from bruvzg/menu_gen
Optimize LineEdit and TextEdit menu item generation.
2021-07-19 22:56:53 +02:00
Rémi Verschelde db010bd71d
Merge pull request #50604 from aaronfranke/float-array-cast
Explicitly cast real_t to float when creating a float array
2021-07-19 22:47:57 +02:00
Rémi Verschelde dfc1ec7fb9
Merge pull request #50606 from Chaosus/textedit_fix_guttertype
Fixed typos in `TextEdit::GutterType` enum
2021-07-19 16:40:42 +02:00
Rémi Verschelde 855c7c7414
Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
2021-07-19 15:20:25 +02:00
Yuri Roubinsky 1597045b09 Fixed typos in TextEdit::GutterType enum 2021-07-19 11:18:54 +03:00
Rémi Verschelde 95def293a6
Merge pull request #48186 from EricEzaM/PR/tooltip-improvements
Made default tooltips (non-custom ones) disappear on mouse enter.
2021-07-19 09:02:06 +02:00
Hugo Locurcio abc38b8d66
Use C++11 raw literals for shader code to improve readability
In files that have lots of branching, `\t` was replaced with a
tab character instead.
2021-07-19 08:19:50 +02:00
Aaron Franke 09f0596eb2
Explicitly cast to float when creating a float array 2021-07-19 01:21:22 -04:00
bruvzg 1ac7a126f1 Optimize LineEdit and TextEdit menu item generation. 2021-07-19 08:19:09 +03:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Yuri Roubinsky d63a284dff Prevent function gen in visual shader if no out connection is provided 2021-07-17 22:51:22 +03:00
reduz a3fb76cd45 Create many types of popups on demand
* LineEdit popups created on demand.
* TextEdit popups created on demand.
* SpinSlider popups created on demand.
* ResourcePicker popups created on demand.

Improves editor responsiveness.
2021-07-17 10:57:14 -03:00
Hugo Locurcio 523d6b2ae8
Merge pull request #47395 from sygi/shape_idx_collision
Add shape_idx to CollisionObject2D mouse_entered signal
2021-07-16 19:05:08 +02:00
Rémi Verschelde 60add98a4c
Merge pull request #49328 from nekomatata/sync-to-physics-3d
Support for 3D sync to physics
2021-07-15 23:18:59 +02:00
PouleyKetchoupp 7f92127959 Support for 3D sync to physics
Same implementation as in 2D.
2021-07-15 10:15:13 -07:00
PouleyKetchoupp d12b44ca13 Move sync to physics to StaticBody2D
Now static body is used for moving platforms through kinematic motion
property, so sync to physics needs to be in StaticBody2D instead of
CharacterBody2D.

Constant kinematic motion is also supported in combination with sync to
physics for smoother movements.
2021-07-15 10:13:27 -07:00
Rémi Verschelde f79e79d479
Merge pull request #38819 from EricEzaM/improve-to_string-for-nodes
Added Node name to print() of all Nodes by making to_string() in Object virtual, so it can be overriden in C++.
2021-07-15 15:11:21 +02:00
Eric M 3ca25ffe8a Added Node name to print() when printing Nodes. 2021-07-15 21:48:58 +10:00
fabriceci cee814e4df Fixing 2D moving platform logic
Fixing by applying the movement in two steps, first the platform
movement, and then the body movement. Plus, add the platform movement
when we are on_wall.
2021-07-15 11:54:43 +02:00
Rémi Verschelde 29c56f33a4
Merge pull request #48502 from KoBeWi/visual_button
Add set_pressed_no_signal method to BaseButton
2021-07-14 15:05:50 +02:00
Rémi Verschelde 8f6240a275
Merge pull request #49348 from Geometror/fix-particles-hidden-basecolor
Fix color properties of particle nodes/material
2021-07-14 15:05:20 +02:00
Rémi Verschelde 536825d004
Rename Curve3Texture to CurveXYZTexture
Neither name is a perfect match but `Curve3Texture` looked too similar to
`CurveTexture` and `Curve3D`, which made things confusing when picking a
texture type or browsing the API reference.
2021-07-14 00:30:58 +02:00
Rémi Verschelde bc6ea71771
Merge pull request #50063 from nekomatata/more-accurate-move-and-slide
Make move_and_slide collision detection more accurate
2021-07-13 20:41:09 +02:00
Rémi Verschelde 79137a0260
Merge pull request #50299 from YeldhamDev/window_wrap_controls_fix
Fix `Window`'s `wrap_controls` not actually doing anything
2021-07-13 18:04:33 +02:00
Rémi Verschelde b61b30e6ff
Merge pull request #50420 from KoBeWi/counter_headers
Add header theme type variations to labels
2021-07-13 17:57:03 +02:00
kobewi f4b361dd15 Add header theme type variations to labels 2021-07-13 15:42:09 +02:00
Rémi Verschelde 8747f25653
Merge pull request #50381 from reduz/implement-disable-classes
Implement the ability to disable classes
2021-07-13 15:31:38 +02:00
Rémi Verschelde b44b277f6f
Merge pull request #50169 from pycbouh/theme-type-variations 2021-07-13 15:13:00 +02:00
reduz 5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
kobewi 50c63bdc4c Add set_pressed_no_signal method to BaseButton 2021-07-13 13:57:26 +02:00
Rémi Verschelde aab6dc301c
Merge pull request #50086 from Geometror/label-improve-layout-options
Improvements to Label's layout options
2021-07-13 13:10:42 +02:00
Rémi Verschelde f2ad067509
Merge pull request #48375 from bowling-allie/discrete-carry-bug 2021-07-13 10:33:34 +02:00
Rémi Verschelde 3adb129a54
Merge pull request #50135 from KoBeWi/🌲.update()
Update Tree when modified
2021-07-13 09:03:40 +02:00
Rémi Verschelde 65486cd15e
Merge pull request #50401 from Calinou/decal-add-node-configuration-warnings
Add node configuration warnings for the Decal node
2021-07-13 08:13:21 +02:00
Hugo Locurcio 1bbdc5cc65
Add node configuration warnings for the Decal node 2021-07-13 01:57:59 +02:00
Yuri Sizov 4ee0e6ddf5 Add type variations to Theme 2021-07-13 02:26:28 +03:00
Rémi Verschelde fc00a83901
Merge pull request #50262 from nekomatata/convex-hull-simplification
Options to clean/simplify convex hull generated from mesh
2021-07-12 22:15:40 +02:00
Rémi Verschelde 30d4732623
Merge pull request #50389 from Chaosus/vs_uniform_ref
Auto-set a first compatible uniform on dragging to create a UniformRef (VisualShaders)
2021-07-12 19:24:27 +02:00
Fabio Alessandrelli 88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
Fabio Alessandrelli 31142ac3ee [Net] Remove most multiplayer hooks from SceneTree.
Use `multiplayer` or `get_multiplayer()` instead of `get_tree()`.
2021-07-12 15:28:01 +02:00
JestemStefan f84ae146f0 Limit scale of node2D to EPSILON 0.00001 to prevent det==0 bug 2021-07-12 11:55:58 +02:00
Yuri Roubinsky 7d34701d63 Auto-set a first compatible uniform on dragging to create a UniformRef 2021-07-12 11:19:42 +03:00
QbieShay 9058367d14 This commits adds a new emitter type for particles material
and 3D CPU particles. The new emitter is called "ring"
and it can emit either in a ring or cylinder fashion.
This adds the following properties for the emitter:
1. emission_ring_axis: the axis along which the ring/cylinder
    will be constructed
2. emission_ring_radius: outer radius of the ring/cylinder
3. emission_ring_inner_radius: inner radius of the cylinder.
    when set to zero, particles will emit in the full volume.
4. emission_ring_height: height of the ring/cylinder emitter.
2021-07-11 17:30:47 +02:00
QbieShay c4d8eecfe5 added offset for plane mesh and quad mesh 2021-07-11 14:33:08 +02:00
Yuri Roubinsky 9d4afa8b75
Merge pull request #50149 from Chaosus/vs_curve3d 2021-07-11 12:36:56 +03:00
Hugo Locurcio 161214d374
Remove the remains of ImmediateGeometry3D
ImmediateGeometry3D was recently removed in favor of the ImmediateMesh
resource.
2021-07-11 00:42:44 +02:00
Hugo Locurcio a2d5f191d8
Merge pull request #48622 from Geometror/reimplement-disableable-vsync 2021-07-10 01:02:23 +02:00
Michael Alexsander fe5605334a Fix Window's wrap_controls not actually doing anything 2021-07-08 20:06:16 -03:00
Rémi Verschelde 47e5fed485
Merge pull request #50261 from Razoric480/cache-color-picker-presets
Add cache to ColorPicker for color presets
2021-07-07 23:31:24 +02:00
PouleyKetchoupp 1de995ae99 Options to clean/simplify convex hull generated from mesh
Clean: remove duplicate and interior vertices (uses Bullet algorithm)
Simplify: modify the geometry for further simplification (uses VHACD
algorithm)

In the editor, single convex hull now uses the clean option.
Added a new editor entry to create a simplified convex hull, can be
useful for creating convex hull from highly tessellated triangle meshes.
2021-07-07 12:14:12 -07:00
Francois Belair 94a464f555 Add cache to color picker for presets
This prevents loading from the project metadata more than once,
significantly saving performance with nodes that have color pickers.
2021-07-07 14:17:44 -04:00
Hugo Locurcio 2c7813385d
Tweak the GradientTexture property hint to follow CurveTexture
This prevents setting too large values and crashing the editor.

Very low values are also no longer allowed since they are generally
not detailed enough to represent complex gradients, leading to confusion.
2021-07-07 19:17:02 +02:00
Rémi Verschelde 48a5226829
Merge pull request #50193 from reduz/fix-command-queue-crash
Fix Command Queue Crash
2021-07-07 16:36:13 +02:00
Rémi Verschelde f62da984af
Merge pull request #50214 from Calinou/occluderinstance3d-add-node-configuration-warnings
Add node configuration warnings to OccluderInstance3D
2021-07-07 16:04:02 +02:00
reduz d41e3f9aeb Fix Command Queue Crash
* No longer allow sending an object (texture) to the server as material parameter
* Keep a parameter cache locally in ShaderMaterial
2021-07-07 10:57:56 -03:00
Hugo Locurcio 8cc147076c
Add node configuration warnings to OccluderInstance3D 2021-07-07 13:59:52 +02:00
Rémi Verschelde e4c940ee6a
Merge pull request #50208 from kleonc/accept_dialog-remove_button
Add AcceptDialog::remove_button method
2021-07-07 09:12:03 +02:00
Hugo Locurcio ce941397e5
Merge pull request #49890 from voxelv/fix_tree_range_click_timeout_crash_46648
Avoid using a nullptr root in Tree._range_click_timeout().
2021-07-07 01:21:32 +02:00
Rémi Verschelde f50a866335
Merge pull request #50215 from Calinou/improve-node-configuration-warning-display
Format node configuration warnings as a bullet point list
2021-07-06 23:07:16 +02:00
Rémi Verschelde fa90b6e285
Merge pull request #50162 from Calinou/inspector-hint-allow-ormmaterial3d
Allow using ORMMaterial3D by using BaseMaterial3D as a resource hint
2021-07-06 22:56:06 +02:00
Rémi Verschelde 86b215516d
Merge pull request #50213 from m44615/fix_50161
Fix: The ORMMaterial3D shader doesn't compile #50161
2021-07-06 22:55:14 +02:00
Hugo Locurcio 730ffcf65d
Format node configuration warnings as a bullet point list
This makes multiple warnings easier to distinguish from each other.
2021-07-06 19:36:40 +02:00
Gilles Roudière 2f9a0268dd Increase the number of arguments accepted by UndoRedo methods 2021-07-06 18:52:28 +02:00
Martin Krbila 2a34ff94e4 Fix: The ORMMaterial3D shader doesn't compile #50161 2021-07-06 18:38:11 +02:00
kleonc 714e6a595d Add AcceptDialog::remove_button method 2021-07-06 18:14:20 +02:00
Rémi Verschelde 9a1ce8e6c3
LineEdit: Respect max_length by truncating text to append
When appending text (either via `set_text()` or by pasting from clipboard),
if the input would make the `LineEdit` exceed its configured `max_length`,
the input text is truncated to fit. The discard part is passed as a parameter
in the `text_change_rejected` signal.

Fixes #33321.
Fixes #41278.

Also cleaned up unimplemented `max_chars` property in `TextEdit`.

Co-authored-by: Tony-Goat <70238376+Tony-Goat@users.noreply.github.com>
2021-07-06 18:03:03 +02:00
Hendrik Brucker 043ae91560 Restructure and reimplement vsync options
-Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX
-Removed the V-Sync via Compositor option
2021-07-06 16:34:26 +02:00
George Marques 0525467fbc
Fix TileSet::CellNeighbor enum binding
Having the TileSet:: prefix has some unintended consequences in the
bindings, in particular in the extension API dump.
2021-07-06 11:07:58 -03:00
reduz 7f6027927a Fix Subsurface Scattering
* Works again
* Transmittance also works again
* Removed the curve patamter, exp() function is good enough.
2021-07-05 17:17:45 -03:00
PouleyKetchoupp ccac36a6e2 Remove unused PhysicsShapeQueryResult3D & PhysicsShapeQueryResult2D 2021-07-05 11:16:11 -07:00
reduz f4379cbc82 Clean up Tree
Fixes some problems introduced by #49917

* Tree used minimum size as a stretch ratio, so it forced a minimum size of 1.
* Minimum size redone, stretch ratio moved to a separate setting
* Fitting to contents was enforced, this is more intuitive, but in many situations this is undesired.
* Added a clip content option for situations where fit to contents does not apply.
* Icon would scroll with the item, making it invislbe if the item is too long.
* Made icon always appear to the right (or left if RTL is enabled) of the visible item space.
2021-07-04 13:13:53 -03:00
Hugo Locurcio 8f7e1b53ff
Allow using ORMMaterial3D by using BaseMaterial3D as a resource hint
Previously, only StandardMaterial3D could be defined as an alternative
to ShaderMaterial.

This also reorders the CanvasItemMaterial property hints to follow
alphabetical order (which is enforced by the inspector).
2021-07-04 17:49:36 +02:00
Hendrik Brucker 56a8d3f30c Improvements to Label's layout options
- Added options to trim the text in case it overruns
- Added more autowrap modes
- Improved line breaking, which ignores trailing spaces
2021-07-04 16:43:55 +02:00
kobewi 9569729888 Update Tree when modified 2021-07-04 15:28:39 +02:00
Yuri Roubinsky 4cf2f79892 Added Curve3Texture to Visual Shaders 2021-07-04 12:21:19 +03:00
Hendrik Brucker 3a4a2198ed Fix color properties of particle nodes/material 2021-07-04 02:14:31 +02:00
Josh Chandler 879f84d8f8 add viewport.get_camera_2d()
* there is now a more clear distinction between camera_2d and camera_3d functions in the engine code
* simplified camera2d's exported interface - now everything happens directly with the 'current' variable and make_current and clear_current are no longer exposed- there were some situations where calling one instead of set_current would result in incomplete results
* rebased to current godot master
2021-07-03 15:08:17 -04:00
Rémi Verschelde cb4e42155d
Merge pull request #50054 from reduz/curve-texture-3d
Implement Curve3Texture
2021-07-03 20:32:18 +02:00
Rémi Verschelde e849dc1791
Merge pull request #50080 from reduz/fix-old-mesh-compatibility
Add compatibility with old mesh formats
2021-07-03 17:13:34 +02:00
reduz d6893cb2e8 Implement Curve3Texture
* This was required by users in some scenarios, such as animating individual axes over time with a single texture.
* Examples: Shaders, Particles, etc.
* CurveTexture now defaults to RGB, can be changed to Red if needed, this allows to freely exchange them.
2021-07-03 12:11:01 -03:00
Rémi Verschelde 4cb6986cdb
Merge pull request #50096 from reduz/fix-render-info
Fix Render Info
2021-07-03 17:04:07 +02:00
reduz 6c55d2aad2 Fix Render Info
* Fixed and redone the process to obtain render information from a viewport
* Some stats, such as material changes are too difficult to guess on Vulkan, were removed.
* Separated visible and shadow stats, which causes confusion.
* Texture, buffer and general video memory can be queried now.
* Fixed the performance metrics too.
2021-07-03 10:15:04 -03:00
Rémi Verschelde a525e77740
Merge pull request #49468 from menip/FixGetScreenPosition
Fix Control::get_screen_position() not considering viewport scale
2021-07-03 14:29:20 +02:00
Rémi Verschelde a8fb450b3c
Merge pull request #50092 from YeldhamDev/window_get_contents_expose
Expose `Window.get_contents_minimum_size()` to scripts
2021-07-02 22:12:11 +02:00
Rémi Verschelde 676027fc3d
Merge pull request #50089 from YeldhamDev/splitcontainer_minimal_fix
Make invisible `SplitContainer` nodes correctly calculate the minimal size of its children
2021-07-02 22:11:30 +02:00
sygi 6f3e7f7cb0 Add mouse_shape_entered and mouse_shape_exited signals to CollisionObject2D.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-07-02 20:50:27 +01:00
Michael Alexsander a829e88ddc Expose Window.get_contents_minimum_size() to scripts 2021-07-02 15:35:56 -03:00
Hugo Locurcio 5370f4876e
Remove leftovers from the DirectionalLight3D Optimized shadow depth range
The Optimized shadow depth range was removed in late 2020 in favor
of the Stable shadow depth range, but it still had a (broken) property
that allowed to enable it.
2021-07-02 20:32:43 +02:00
Michael Alexsander e4d56e4c62 Make invisible SplitContainer nodes correctly calculate the minimal size of its children 2021-07-02 14:39:50 -03:00
reduz a632f9fd6e Add compatibility with old mesh formats
* Can load 2.x meshes
* Can load 3.x meshes
2021-07-02 12:34:54 -03:00
PouleyKetchoupp cf1ddfdb90 Make move_and_slide collision detection more accurate
More accurate unsafe motion calculation
* Safe and unsafe motion are calculated by dichotomy with a limited
number of steps. It's good for performance, but on long motions that
either collide near the beginning or near the end, the result can be
very imprecise.
* Now a factor 0.25 or 0.75 is used to converge faster when this case
happens, which allows longer motions to get more accurate collision
detection.
* Makes snap collision more precise, and helps with cases where diagonal collision on the border of a platform can lead to the character being stuck.

Additional improvements to move_and_slide:
* Handle slide canceling in move_and_collide with 0 velocity instead of
not applying it.
* Better handling of snap with custom logic to cancel sliding.
* Remove small jittering when using stop on slope, by canceling the
motion completely when the resulting motion is less than margin instead
of always projecting to the up direction (in both body motion and snap).

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-07-01 15:15:42 -07:00
Aaron Franke 2508fd0533
Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
Rémi Verschelde ad8a2b3d52
Merge pull request #50040 from reduz/fix-renderingserver-bindings
Clean up RenderingServer and its bindings
2021-07-01 15:17:33 +02:00
reduz 37776b2867 Clean up RenderingServer and its bindings
* Rewrote bindings for RenderingServer.
* They are now all up to date.
* Several unused methods and deprecated features were cleaned up.
2021-07-01 09:07:36 -03:00
Rémi Verschelde ba376a0452
Merge pull request #50037 from reduz/move-color-to-8bit
Import mesh colors in 8BPC
2021-07-01 08:15:13 +02:00
reduz 9ad0c6cde7 Import mesh colors in 8BPP.
* Colors were imported as 16BPP (half float)
* Far most common use cases only require 8BPP
* If you need higher data precision, use a custom array, which are supported now.

**WARNING**: 3D Scenes imported in 4.0 no longer compatible with this new format. You need to re-import them (erase them from .godot/import)
2021-06-30 23:33:25 -03:00
Eric 525ad7c37e Enable Camera2D smoothing on limit change 2021-06-30 16:21:29 -07:00
Rémi Verschelde 915344fe76
Merge pull request #49834 from nekomatata/physics-disable-modes
Add support for controlling physics nodes' behavior when disabled
2021-06-30 20:36:36 +02:00
Rémi Verschelde 270f9d4c88
Merge pull request #50014 from reduz/remove-immediate
Deprecate ImmediateGeometry
2021-06-30 20:18:59 +02:00