Groups the ill-defined NavigationAgent properties between pathfinding and avoidance to make it more clear which property affects what.
(cherry picked from commit dde09be302)
Mark Navigation/Navigation2D nodes as deprecated. They already just redirect calls to the NavigationServer and have no longer a real purpose. In Godot 4.0 both nodes are already removed for good reasons.
Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.
Changes NavigationAgent avoidance callback to a toggle that is disabled by default.
Also fixes a few missing descriptions / wrong warnings.
(cherry picked from commit 7f3688603c)
Temporarily removes agent from navigation map when parent node cannot process due to SceneTree pause and process_mode property. Normal process_mode does not work as other agents would still avoid the paused agents because they were still active on the navigation map and the rvo world. Also fixes potential crash when region_get_map or agent_get_map is called while no map is set.
(cherry picked from commit 6b51ab66d8)
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NOEDITOR
Exposes get_rid() function for scripting.
Adds configuration warning when obstacle is used with not intended static body parent.
(cherry picked from commit 001d89223f)
Fixes NavigationObstacle2D/3D reporting a 'get_global_transform: Condition "!is_inside_tree()" error when estimating the agent radius.
The collisionshapes that are lower in the SceneTree order than the obstacle node are not loaded in the SceneTree yet so the global_transform function fails.
Also adds warning message when this happens.
(cherry picked from commit cc707412e9)
This feature makes it possible to workaround problems such as:
- long baking time due to heavy synchronization when parsing geometry
from mesh instances
- crash when freeing `NavigationMeshInstance` while baking
- errors when actively baking node tree is being detached from the
scene tree
The data flow to the VisualServer of current and previous transforms is essential for allowing correct interpolation. An optimization was present that disabled sending transforms when nodes were hidden, however this meant that when unhidden, nodes would interpolate incorrectly from the last transform received when hiding, rather than the up to date previous transform.
This PR disables the optimization and sends always sends transforms when a node is interpolated.
When switching emission on and off, processing was always being switched on and off using internal_process, which was incorrect for using physics interpolation (where physics_process is the relevant one).
This PR correctly updates the process mode according to whether physics interpolation is being used.
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.
This allows for lower field of view (or higher zoom) in orthogonal
and frustum camera modes.
The property hint also allows setting the size with greater precision.
During room conversion, if a prefixed Spatial is converted to a Room / RoomGroup etc, when using instanced scenes the owner was incorrectly set, resulting in the instanced scene objects being duplicated.
This PR corrects this.
The previous and current transforms in the interpolation data were not being correctly updated in cases where two or more physics ticks occurred on a frame. This PR introduces a simple mechanism to ensure updates on interpolated spatials.
Introduces fallback path for geometry types that are not recognised.
Allows STATIC mode for CPUParticles (using expansion margin)
Allows STATIC mode for Particles (using "visibility_aabb")
In order to properly support the resource sharing paradigm, Occluders are split into Instances and Resources in the VisualServer. Instances are owned by a Scenario, and Resources are global. OccluderShape resources can now correctly be shared by multiple OccluderInstances.
Adds fixed timestep interpolation to the visual server.
Switchable on and off with project setting.
This version does not add new API for set_transform etc, when nodes have the interpolated flag set they will always use interpolation.
Instead of fitting all atlas slices into a single image, which meant there
was a hard limit on the size, BakedLightmap will now save as many images
as needed to fit all the slices generated by the lightmapper.
Using codespell 2.2-dev from current git.
Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
(cherry picked from commit 1bdb82c64e)
The portal system introduced basic mesh merging functionality, this has wide ranging uses outside of the portal system.
For this reason, this PR binds the mesh merging functionality.
It also slightly modifies the calling from RoomManager to use a Vector of Node *, in order to allow binding of the function.
A regression had occurred whereby particle systems in DYNAMIC mode weren't added to the room correctly.
This PR recognise the case and bypasses the function to retrieve geometry, as retrieving the geometry is not necessary for DYNAMIC objects as they should not affect the room bound. Their AABB will be retrieved during gameplay rather than once off at level conversion.
When editor continuous redraws is switched off, the editor only redraws when a redraw_request was issued by an element in the scene. This works well in most situations, but when scenes have dynamic content they will continuously issue redraw_requests.
This can be fine on high power desktops but can be an annoyance on lower power machines.
This PR splits redraw requests into high and low priority requests, defaulting to high priority. Requests due to e.g. shaders using TIME are assigned low priority.
An extra editor setting is used to record the user preference and an extra option is added to the editor spinner menu, to allow the user to select between 3 modes:
* Continuous
* Update all changes
* Update vital changes
Change the entire navigation system.
Remove editor prefix from nav mesh generator class. It is now used for baking
at runtime as well.
Navigation supports obstacle avoidance now with the RVO2 library.
Nav system will also automatically link all nav meshes together to form one
overall complete nav map.
Applying overlay materials into multi-surface meshes currently
requires adding a next pass material to all the surfaces, which
might be cumbersome when the material is to be applied to a range
of different geometries. This also makes it not trivial to use
AnimationPlayer to control the material in case of visual effects.
The material_override property is not an option as it works
replacing the active material for the surfaces, not adding a new pass.
This commit adds the material_overlay property to GeometryInstance
(and therefore MeshInstance), having the same reach as
material_override (that is, all surfaces) but adding a new material
pass on top of the active materials, instead of replacing them.
Implemented in rasterizer of both GLES2 and GLES3.
Previously a crude metric was used to decide on the roaming expansion margin, but it created unexpected results in some scenarios. Instead this setting is exposed to the user via the RoomManager, allowing them to tailor it to the world size, room sizes, roaming objects sizes and the speeds of movement.
Reporting rest collision information is needed for move_and_collide and
move_and_slide so floor detection can be done properly, but in the case
of just testing the motion for collision, it makes sense to return false
if the body is able to move all along the path without being stopped.
Updated the logic in test_move and clarified the documentation for
test_move and move_and_collide.
In all physics servers, body_get_direct_state() now silently returns
nullptr when the body has been already freed or is removed from space,
so the client code can detect this state and invalidate the body rid.
In 2D, there is no change in behavior (just no more errors).
In 3D, the Bullet server returned a valid direct body state when the
body was removed from the physics space, but in this case it didn't
make sense to use the information from the body state.