Commit Graph

192 Commits

Author SHA1 Message Date
e3e6e9e231 Bind missing method in NavigationServer. 2023-09-10 08:44:29 +02:00
0ff2bbdf70 Make sure that all parameters are properly set into PathQueryResults. 2023-09-05 11:58:36 +02:00
8880722565 Removed cell height getters and setters from the Navigation2DServer. 2023-09-05 11:57:34 +02:00
a222159442 Backported from godot4: Add NavigationServer API to enable regions and links
Adds NavigationServer API to enable regions and links.
- smix8
69fad39cf5
2023-09-04 20:22:28 +02:00
b37e0e6a4e Backported from godot4: Update navigation obstacle API
Updates navigation obstacle API.
- smix8
c1fc331b88
2023-09-04 19:55:32 +02:00
aeb4d3fbe2 Backported from godot4: Add agent pause mode to NavigationServer
Adds agent pause mode to NavigationServer.
- smix8
https://github.com/godotengine/godot/commit/ae9dd47d0c1c237d0733439862aa5ff651dcac2
2023-09-04 19:04:29 +02:00
8485b37515 Ported from godot4: Fix Navigation API abbreviations inconsistency
Schema for navigation to name user facing API with  "navigation" without abbreviation and e.g. NavigationServer internals with abbr "nav".
- smix8
34e7628f5f
2023-09-04 17:09:39 +02:00
e81f25ac7b Added init and finish methods to the NavigationMeshGenerator. Also small tweaks in initialization. 2023-09-03 11:51:09 +02:00
9ae3aa65b7 Added finish method to the NavigationServers. 2023-09-03 11:46:46 +02:00
9fd4b941e2 Backported from godot4: Unbind NavigationServer3D.process()
Unbinds NavigationServer3D.process().
- smix8
f1026450bf
2023-09-03 09:26:48 +02:00
25ac0d8f49 Fix the initial value of _debug_enabled in NavigationServer. 2023-08-30 15:04:11 +02:00
a29d232a4c Ported: Physics Interpolation - add support for CPUParticles2D
Similar to the existing 3D CPUParticles physics interpolation.
- lawnjelly
a117a3307a
2023-08-27 21:59:54 +02:00
26bb16d86e Ported: Fix 2D MultiMesh hierarchical culling
Fixes updating local bounds for MultiMeshes used in canvas items by introducing a back link.
- lawnjelly
ad577e3c7e
2023-08-27 21:28:30 +02:00
17fa82ac02 Ported: Add debug_canvas_item_get_local_bound() function to VisualServer
Useful for debugging hierarchical culling.
- lawnjelly
61e41cc9a1
2023-08-27 19:00:01 +02:00
d977ed360e Ported: 2D Fixed Timestep Interpolation
Adds support to canvas items and Camera2D.
- lawnjelly
5162efbfe9
2023-08-27 18:48:25 +02:00
87b91721da Ported: Physics interpolation - Move out of Scenario
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios.

Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
- lawnjelly
d2b1d29634
2023-08-27 17:25:38 +02:00
b223601445 Fix non-tools builds. 2023-08-27 13:06:06 +02:00
5ae44c4746 Ported: SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.

This is wasteful on multiple aspects:

- Binary size: Around 20% binary size reduction with exceptions disabled
  for both MSVC and GCC binaries.
- Compile time:
  * More than 50% build time reduction with MSVC.
  * 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.

Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
- akien-mga
55550da68b
2023-08-27 13:04:04 +02:00
34e2ebe8cc Fix build. 2023-08-27 12:54:44 +02:00
lawnjelly
ca171817a8 MultiRect - Fix flushing in TextEdit
The FontDrawer used in TextEdit was previously not being flushed before drawing auto-completion boxes. This was causing rendering artifacts.
This PR also increases the backward compatibility of the MultiRect OFF mode, by forcing a flush after each character.
2023-08-27 11:45:09 +02:00
834cbe8cef Ported: Single Compilation Unit build.
Adds support for simple SCU build.
This speeds up compilation by compiling multiple cpp files within a single translation unit.
- lawnjelly
43e181a00a
2023-07-11 16:07:36 +02:00
5b869f8b54 Ported from godot: Canvas item hierarchical culling
Adds optional hierarchical culling to the 2D rendering (within VisualServer).
Each canvas item maintains a bound in local space of the item itself and all child / grandchild items. This allows branches to be culled at once when they don't intersect a viewport.
- lawnjelly
b777a9e5f9
2023-06-28 20:25:48 +02:00
de1763d40d Renamed neighbor_dist properties / getters / setters for the navigation server. 2023-06-12 08:37:57 +02:00
6b95f31b70 Also fix method qualifiers. 2023-06-11 18:35:22 +02:00
975e5c4a9e Rethink the previous fix. 2023-06-11 18:32:15 +02:00
50c96d5414 Fix building with ptrcall on. 2023-06-11 18:02:58 +02:00
552226ab5d Backported: Backport spatial shader built-ins
Backport of this PR: godotengine#63597
This adds these as new Built-Ins to Spatial Shaders
* Object's Position in World Space
* Camera Position in World Space
* Camera Direction in World Space
* Object's Position in View Space
- paddy-exe
be3d331f26
2023-06-11 09:37:10 +02:00
f058c87868 Backported from godot4: Rework Navigation Avoidance
Rework Navigation Avoidance.
- smix8
a6ac305f96
2023-06-10 20:58:49 +02:00
8b18898609 Backported from godot4: Rework const on NavigationServer methods
`const` is used on all methods, even when they cause modification of the server.  This reworks the methods of the server to only use `const` on method that don't change the state of the server.
- DarkKilauea
a0715b30f9
2023-06-09 22:03:42 +02:00
6384b9624f Ported from godot4: Make navigation mesh edge connections optional
Makes navigation mesh edge connections optional.
- smix8
f986b52b3c
2023-06-09 20:54:05 +02:00
29784d5d5b Ported from godot4: Enable assigning an owner to navigation regions and links
This allows users of the server APIs to get back the nodes that created certain regions and links.
- DarkKilauea
5769b0e8d8
2023-06-09 19:46:44 +02:00
160cb38a50 Ported from godot4: Add support for emitting a signal when entering a NavLink
- DarkKilauea
5d8ba2b2d1
2023-06-09 19:08:38 +02:00
19fac49904 Turn PoolVectors in NavigationPathQueryResults into Vectors. 2023-06-09 16:27:24 +02:00
ae018648fe Added missing binds. 2023-06-09 14:19:41 +02:00
268645ff0b Ported from godot4: Add NavigationAgent Path Debug Visualization
Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.
- smix8
0ab764e84b
2023-06-09 14:17:54 +02:00
11c84049fa Ported from godot4: Fix NavigationMesh debug visuals for non-triangulated meshes
Fixes NavigationMesh debug visuals for non-triangulated meshes.
- smix8
4490a3303b
2023-06-09 13:03:30 +02:00
23daaf95a6 Ported from godot4: Fix 2D navigation debug visuals ignoring half the ProjectSettings
Fixes that NavigationRegion2D and TileMap debug visuals ignored more or less half the ProjectSetting. E.g. random color could not be disabled, edges did not display.
2b19c70664
2023-06-09 11:29:33 +02:00
c11500d480 Ported from godot4: Rename Navigation uses of 'location' to 'position'
Contrary to the entire rest of the engine NavigationAgent's and NavigationLinks decided to deal with locations instead of positions.
- smix8
bf1571979c
2023-06-09 10:28:31 +02:00
b940854ca9 Ported from godot4: Add NavigationServer Performance Monitor
Adds Performance Monitor for NavigationServer3D.
- smix8
9802914f97
2023-06-09 10:17:43 +02:00
2b4d3e69de Fix non tools build. 2023-06-09 09:12:30 +02:00
a5a07d8ff6 Backported from godot4: Add NavigationServer2D debug functions
Adds debug functions to NavigationServer2D to mirror NavigationServer3D functions for 2D users.
- smix8
d254f0fa5f
2023-06-09 09:03:33 +02:00
9c95fade84 Backported from godot4: Fix navigation debug not toggleable in scripts
Fixes that navigation debug was not toggleable in script while even the docs mentioned it.
- smix8
aecad7bb25
2023-06-09 09:01:01 +02:00
d434a1c4e5 Backported from godot4: Fix Editor Navigation debug edge connection visuals
Fixes missing Navigation debug edge connection visuals in Editor due to disabled NavigationServer.
- smix8
8bfea7dcb4
2023-06-09 08:55:21 +02:00
0438c3cc3f Backported from godot4: Added node for Navigation links .
- DarkKilauea
3dd59013f4
2023-06-08 20:46:09 +02:00
f6e65112d7 Backported from godot4: Add NavigationPathQuery
Adds NavigationPathQueryParameters objects that can be used with NavigationServer.query_path() to query a customized navigation path.
- smix8
63dcb9aa80
2023-06-08 18:23:48 +02:00
7ce5f939a9 Ported the docs from the navigation mesh generator rework pr. 2023-06-06 16:52:04 +02:00
890d6f1b28 Removed region_bake_navmesh from the NavigationServer. 2023-06-06 09:36:19 +02:00
654cfb81b7 Renamed NavigationRegion2D back to NavigationPolygonInstance, as I think it fits the engine better. 2023-06-05 18:09:53 +02:00
68b9f4c90e Ported from godot4: Add more detailed Navigation Debug Visualization
- Adds more customization options to ProjectSettings.
- Displays navregion edge connections and navigation polygon edges in editor and at runtime.
- Majority of debug code moved from SceneTree to NavigationServer.
- Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.
- smix8
c394ea518e
2023-06-05 18:05:15 +02:00
5578afc3d6 Fix scons warning. 2023-06-05 14:56:10 +02:00
57153f4a33 Make overrides consistent again. 2023-06-04 13:11:04 +02:00
6136f0b802 Fix the type of the CreateNavigationMeshGeneratorCallback. 2023-06-04 09:41:39 +02:00
0a3d1d6cf5 Added in NavigationMeshGeneratorDummy and set up initialization. 2023-06-03 20:00:42 +02:00
9a35d6c7d3 Cleaned up NavigationMeshGenerator and added it to the build. 2023-06-03 18:45:20 +02:00
8cbb1bb879 Started porting pull request from godot 4: Rework NavigationMeshGenerator
Reworks NavigationMeshGenerator and navigation mesh parse and bake process. Adds navigation mesh baking for 2D.
- smix8
https://github.com/godotengine/godot/pull/70724
38699a8259
2023-06-03 18:22:12 +02:00
2114b2239b Split NavigationPolygon and NavigationPolygonInstance into 2 files. Also renamedNavigationPolygonInstance to NavigationRegion2D. 2023-06-03 16:54:48 +02:00
f4a4956b7a Ported: Fix Polygon2D skinned bounds (for culling)
The bound Rect2 was previously incorrect because bone transforms need to be applied to verts in bone space, rather than local space. This was previously resulting in skinned Polygon2Ds being incorrectly culled.
- lawnjelly
dd6c213dac
2023-05-01 13:34:35 +02:00
belzecue
ad1464d9e5 Backport from Godot 4 - Fix RigidDynamicBody gaining momentum with bounce #55313 2023-05-01 12:24:31 +02:00
1263101396 Ported: Batching - Add MultiRect command
Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to VisualServerCanvas, and uses the new functionality from Font, BitmapFont, DynamicFont and TileMap, via the VisualServerCanvasHelper class.

- lawnjelly

910ddd13c4
2023-04-20 23:09:37 +02:00
45ffb33025 Add init() virtual methods to the navigation servers. 2023-04-16 18:23:56 +02:00
86bdecbfe9 Now more than one Naviugation2D servers can be registered. 2023-04-16 18:19:57 +02:00
f6c1c1dc8d Move NavigationServer2d's forwarding logic to the navigation module as a new derived class. 2023-04-16 18:11:15 +02:00
7068f1834e Now more than one Navigation Server can be registered. 2023-04-16 17:42:34 +02:00
7567494570 Ported: Eliminate collision checks between geometry in rendering BVH.
Later logic using the `pairable_mask` would catch cases preventing pairing callbacks between geometry. However the collision checks were still taking place, wasting performance.
Here we utilize the `tree_mask` feature of BVH to totally eliminate unnecessary collision checks between geometry.
- lawnjelly
18d7d36b63
2023-04-15 10:51:26 +02:00
40a9b72afb Ported from godot-plus: Add ability to mute AudioServer.
Adds the option to change the audio driver to the Dummy driver and back at runtime, with a set of MuteState flags - Disabled (user control), Silence (period of silence), Focus Loss (when app is not in focus), and Paused (when app is paused).
Control for the flags is added for the editor in EditorSettings, and for the project in ProjectSettings.
Editor defaults to muted (Dummy driver) when there is no audio output, and automatically switches to active on output. This significantly reduces CPU usage.
- lawnjelly
cedb01fb84
2023-04-10 19:42:23 +02:00
stmSi
9b65e9df6a Fix Editor hanging if audiostream's pitch_scale is NaN 2023-03-12 14:14:29 +01:00
2cd4e4d828 Renamed Set to RBSet. 2023-01-15 19:42:08 +01:00
1b0aac6028 Renamed Map to RBMap. 2023-01-15 19:12:50 +01:00
lawnjelly
880f84f8c4 Fix pairing crash in physics Octree
Remove section of code that should not run and was causing crash.
2022-12-22 14:26:42 +01:00
smix8
9225e78f68 Fix Navigation agent callback wild pointer crash
Fixes crash in sanitizer builds when callback agent or object are already freed.

(cherry picked from commit 194c1c44e0a20faa4463e3a41bb12cf93a71fc03)
2022-12-22 14:12:00 +01:00
Ricardo Buring
721ae8f4ad Fix typo bug in heightmap shape
(cherry picked from commit 55eceb5150ee0c6b38f12f4be3fd601506959288)
2022-12-12 12:14:25 +01:00
dzil123
298be38336 Fix shader compiler asan out of bounds 2022-11-30 14:34:44 +01:00
BimDav
3e937eab15 Correctly compute inverse_mass when inertia is defined by user 2022-11-30 14:26:26 +01:00
clayjohn
c9b6b1bffe Properly initialize use_aabb_center in visual server 2022-11-13 00:25:23 +01:00
25d8fbdba4 Ported: visual instance layers are regarded during shadow culling.
todo: setting Camera cull_mask should mark affected shadows dirty somehow
- markusneg
16517ecb3d
2022-10-08 17:47:22 +02:00
Haoyu Qiu
f693b632fe Fix crash executing MultiMesh.reset_instance_physics_interpolation 2022-10-08 17:35:34 +02:00
93eb41c69e Ported: added options for sorting transparent objects
- QbieShay, akien-mga, clayjohn
acdcbefa4e
2022-09-17 10:54:57 +02:00
64f5bd2339 Ported: Bind Physics Interpolation functions in VisualServer
To allow maximum flexibility in the initial rollout, VisualServer functions were not bound in order to prevent compatibility issues if the API changed.

These functions are now bound to allow direct use from the VisualServer.
- lawnjelly
96a1b86717
2022-09-17 10:22:26 +02:00
Yuri Sizov
494dc2f957 Backport fixes to documentation for paths, curves and navigation servers 2022-09-16 13:07:20 +02:00
e24cb96418 Fix compile. 2022-09-16 13:05:22 +02:00
Pedro J. Estébanez
9db0cca2d9 Make audio thread control flags safe 2022-09-16 12:57:59 +02:00
e4ae7f2ebc Renamed Environment to Environment3D, and WorldEnvironment to WorldEnvironment3D. 2022-08-29 17:21:40 +02:00
e2d42db711 Also renamed the files. 2022-08-19 21:24:36 +02:00
cffe742085 Renamed the VisualServer to RenderringServer like in Godot4, as I think it's a lot better name for it. I did not yet rename the files. 2022-08-19 20:50:20 +02:00
f1619cad4f Ported: Add hint_transparent to use a transparent black placeholder texture - Calinou
ab9a95f266
2022-08-19 02:57:42 +02:00
2a13c65298 Ported: Visual/Physics/Navigation Servers validate RIDs with documentation update - tinmanjuggernaut
2be0738304
2022-08-19 02:52:31 +02:00
9757c39f05 Moved a few more core classes. 2022-08-17 17:43:49 +02:00
686663d3e4 Moved around more classes in core. 2022-08-17 16:01:01 +02:00
04feb63860 Moved Engine and projectSettings. 2022-08-17 15:35:28 +02:00
be16fe23ad Moved the error macros. 2022-08-17 15:14:19 +02:00
220b2db443 Moved String and related classes under a string folder in core. 2022-08-17 14:19:55 +02:00
dc9cc716c7 Moved Object related classes under core/object. 2022-08-17 13:45:14 +02:00
9555ee56b9 Moved Variant related classes under a variant folder in core. 2022-08-17 13:17:12 +02:00
388b88678e Moved container related classes in core under a new containers directory. 2022-08-17 12:53:49 +02:00
9e1588160f Now all Variant math types are structs. 2022-08-16 22:09:26 +02:00
e71e3ed897 Now Vector4, Vector4i, Projection, PoolVector4Array, PoolVector4iArray, are built in variant types. Also reordered the Variant's Type enum, renamed _RID in it to RID, fixed a few smaller issues and removed some very old compat code. 2022-08-16 21:55:56 +02:00
8c2e76840c Removed CameraMatrix, and switched to Projection. 2022-08-16 10:26:35 +02:00
e4cad690a3 Renamed elements in Transform2D to columns. 2022-08-14 15:37:05 +02:00
d9e094ab9a Renamed elements in Basis to rows. 2022-08-13 19:07:59 +02:00
c991043c95 Backported improvements to AABB from Godot 4. Also made sure all eligible methods are bound. 2022-08-13 18:21:54 +02:00