Make sure the direction of the motion is preserved, unless the depth is
higher than the margin, which means the body needs depenetration in any
direction.
Also changed move_and_slide to avoid sliding on the first motion, in
order to avoid issues with unstable position on ground when jumping.
Co-authored-by: fabriceci <fabricecipolla@gmail.com>
Fix more cases of node path needing an update when nodes are renamed or
moved in the editor.
Built-in node properties:
Before, node paths were checked only for script export variables. Now
all properties are checked from the node, which includes built-in node
properties.
Allows proper node path updates for nodes like remote transform, physics
joints, etc.
Arrays and dictionaries:
Node paths nested in array and dictionary properties are now also
updated in the editor.
Also update the documentation to be clear about node path update in the
editor and at runtime.
Co-authored-by: latorril <latorril@gmail.com>
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
The CylinderMesh generation code handles this special case and
avoids generating the top and bottom faces if their radius is equal
to 0. This improves performance by reducing the number of vertices
to draw.
If both values are set to 0, nothing will be visible but the mesh
generation will still succeed.
This also improves the CylinderMesh class documentation.
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
This can be used by editor plugins and non-game applications to
store data in the correct directories according to the
XDG Base Directory specification.
* Added a function to ignore subsequent commands if they don't fall within the slice.
* This will be used by the new TileMap to properly provide animated tiles.
* Renames for 2D and 3D
* Class name was confusing, given both 2D and 3D have a "visible" property that is unrelated to actual on-screen visibility.
* New name makes it clear that this is about visibility on screen.
* This is the 3D counterpart to #49632
* Implemented a bit different as 3D works using instancing
After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
* Works from RenderinServer
* Accurately tells when on or off-scren, its no longer approximate.
* VisibilityEnabler also simplified to use the process mode instead.
Renames get_parent_spatial() to get_parent_node3d() and changes its
implementation. Before it was not returning a correct pointer if the
node wasn't added to a SceneTree. Now it uses the same implementation as
CanvasItem, which will be correct even for nodes outside a SceneTree.
This commit adds the following properties to GeometryInstance3D: `visibility_range_begin`,
`visibility_range_begin_margin`, `visibility_range_end`, `visibility_range_end_margin`.
Together they define a range in which the GeometryInstance3D will be visible from the camera,
taking hysteresis into account for state changes. A begin or end value of 0 will be ignored,
so the visibility range can be open-ended in both directions.
This commit also adds the `visibility_parent` property to 'Node3D'.
Which defines the visibility parents of the node and its subtree (until
another parent is defined).
Visual instances with a visibility parent will only be visible when the parent, and all of its
ancestors recursively, are hidden because they are closer to the camera than their respective
`visibility_range_begin` thresholds.
Combining visibility ranges and visibility parents users can set-up a quick HLOD system
that shows high detail meshes when close (i.e buildings, trees) and merged low detail meshes
for far away groups (i.e. cities, woods).
Includes:
* Variant
* Viewport
and two fixes in Array that were pointed out in #40978
VisualScript classes are skipped on purpose.
That is the final commit of the inital code porting to C#. :)
* RingBuffer had no reason to be in this context
* A single buffer is used that can grow as much as the game needs.
This should make thread loading entirely reliable.
Physics FPS above 1000 cause the whole project to slow down
and are not very practical in the first place (since no CPU currently
available can keep up).
Updated the `SceneTree.quit()` method to include a note that on iOS this method won't work as apps are expected to be closed via the Home button, not programmatically.
Update Popup.xml
This PR and commit adds a new IK system for 2D with the Skeleton2D node
that adds several new IK solvers, a way to control bones in a Skeleton2D
node similar to that in Skeleton3D. It also adds additional changes
and functionality.
This work was sponsored by GSoC 2020 and TwistedTwigleg.
Full list of changes:
* Adds a SkeletonModifier2D resource
* This resource is the base where all IK code is written and executed
* Has a function for clamping angles, since it is so commonly used
* Modifiers are unique when duplicated so it works with instancing
* Adds a SkeletonModifierStack2D resource
* This resource manages a series of SkeletonModification2Ds
* This is what the Skeleton2D directly interfaces with to make IK possible
* Adds SkeletonModifier2D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
* Each modification is in its own file
* There is also a SkeletonModifier2D resource that acts as a stack for using multiple stacks together
* Adds a PhysicalBone2D node
* Works similar to the PhysicalBone3D node, but uses a RigidBody2D node
* Changes to Skeleton2D listed below:
* Skeleton2D now holds a single SkeletonModificationStack2D for IK
* Skeleton2D now has a local_pose_override, which overrides the Bone2D position similar to how the overrides work in Skeleton3D
* Changes to Bone2D listed below:
* The default_length property has been changed to length. Length is the length of the bone to its child bone node
* New bone_angle property, which is the angle the bone has to its first child bone node
* Bone2D caches its transform when not modified by IK for IK interpolation purposes
* Bone2D draws its own editor gizmo, though this is stated to change in the future
* Changes to CanvasItemEditor listed below:
* Bone2D gizmo drawing code removed
* The 2D IK code is removed. Now Bone2D is the only bone system for 2D
* Transform2D now has a looking_at function for rotating to face a position
* Two new node notifications: NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE
* These notifications only are called in the editor right before and after saving a scene
* Needed for not saving the IK position when executing IK in the editor
* Documentation for all the changes listed above.
* GIProbe is now VoxelGI
* BakedLightmap is now LightmapGI
As godot adds more ways to provide GI (as an example, SDFGI in 4.0), the different techniques (which have different pros/cons) need to be properly named to avoid confusion.
YSort now has a compatibility alias to Node2D.
Updated TileMap to use the existing Node2D y_sort_enabled property instead
of its own property.
Updated Node2D doc to include the new y_sort_enabled member.
Updated TileMap doc to remove its mention of cell_y_sort.
Deleted YSort doc.
CharacterBody has a linear_velocity property to replace the argument in
move_and_slide.
StaticBody handles reporting linear/angular velocity correctly when
kinematic motion is used (in 3D, used in vehicle and navigation).
Safe margin property on CharacterBody only, used as argument in
move_and_collide.
Removed kinematic_safe_margin in 3D physics server, not really useful
and now harmonized with 2D.
Does the same thing as simulate motion from RigidBody in Kinematic mode,
and CharacterBody (previously KinematicBody).
Added support for constant linear/angular velocity with kinematic_motion
in StaticBody, which moves the body in physics.
Updated documentation for StaticBody and CharacterBody to describe their
functionalities more accurately.
MODE_DYNAMIC instead of MODE_RIGID
MODE_DYNAMIC_LOCKED instead of MODE_CHARACTER
No more special case for sleeping behavior for MODE_DYNAMIC_LOCKED
(MODE_CHARACTER was forcing the body not to sleep, which is redundant
with can_sleep and wasn't done in Bullet).
- snap property to replace move_and_slide_with_snap()
- floor_max_angle, stop_on_slope, infinite_inertia, max_slides,
up_direction properties to replace arguments from move_and_slide()
- up direction now defaults to Vector3.UP and Vector2.UP
PhysicsBody now has methods move_and_collide/test_move and needed
properties for these methods: safe margin, locked axes (3D only).
Moved collision_exceptions from StaticBody to PhysicsBody for 3D
(same as 2D, and conforms to documentation).
RigidBody doesn't have test_motion method anymore, it's now redundant
with PhysicsBody.test_move.
In this PR:
- Removed rset
- rpc_config can now optionally configure transfer mode
(reliable/unreliable/ordered) and channel (channels are not actually
implemented yet.)
- Refactor how the RPC id is computed to minimize the logic in Node and
scripts that now only needs a single `get_rpc_methods` function.
Add two new functions to the IP class that returns all addresses/aliases associated with a given address.
This is a cherry-pick merge from 010a3433df which was merged in 2.1, and has been updated to build with the latest code.
This merge adds two new methods IP.resolve_hostname_addresses and IP.get_resolve_item_addresses that returns a List of all addresses returned from the DNS request.
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
Fixes#34541
Renamed MAX_DIGITS to MAX_DECIMALS, since it only changes the
amount of digits after the decimal point.
Increased MAX_DECIMALS to 32, and made String::num use
MAX_DECIMALS consistently. If -1 is passed as
decimal precision to String::num, it now gets changed to
the correct precision based on the number's magnitude,
instead of using printf default(which is 6)
String::num_real also calculates the correct precision now.
Also made the types used in floating-point math more
consistent in a few places.
- Tweak the setting property hint to be more informative.
- Make the setting a "basic" setting so it appears when Advanced Settings
is disabled.
- Remove redundant orientation setting in the iOS export preset.
The project setting is now used (like on Android).
Projects upgrading from a previous version will have to set the
screen orientation again in the Project Settings if it wasn't set
to the default value ("landscape").
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.
Prevents an infinite loop further down.
Fixes#49022.
This also acts as a general-purpose "deselect" shortcut since pressing
it a second time will deselect text.
This is available both in the script editor and in TextEdit fields
in use, both in the editor and projects.
The Duplicate Line script editor shortcut was moved to Ctrl + Shift + D
since it conflicts with the new shortcut (Ctrl + D). The rationale for
doing so is that Duplicate Line is a less commonly used action, and
its behavior can be replicated by copying and pasting the current line
anyway. (With no selection active, the whole line will be copied.)
Port lawnjelly's dynamic BVH implementation from 3.x to be used in
both 2D and 3D broadphases.
Removed alternative broadphase implementations which are not meant to be
used anymore since they are much slower.
Includes changes in Rect2, Vector2, Vector3 that help with the template
implementation of the dynamic BVH by uniformizing the interface between
2D and 3D math.
Co-authored-by: lawnjelly <lawnjelly@gmail.com>
See discussion in #43811, it was only implemented on iOS and even that
implementation was fairly limited. This would best be provided as plugins
for Android and iOS without cluttering the shared OS API.
- Move most properties from TileMap to TileSet,
- Make TileSet more flexible, supporting more feature (several
collision layers, etc...),
- Fusion both the TileMap and TileSet editor,
- Implement TileSetSources, and thus a new way to index tiles in the TileSet,
- Rework the TileSet and TileMap editors completely,
- Implement an editor zoom widget (and use it in several places)
This can be used to tell Godot to run an executable that will run Godot
rather than running Godot directly. This is useful to make Godot start
on the dedicated GPU when using a NVIDIA Optimus setup on Linux:
`prime-run %command%`
The `editor/run/main_run_args` setting declaration was moved to make it
visible in the ProjectSettings documentation.
This makes it easier to hear sound while setting up the node.
Since this changes the default value, this may break existing projects
slightly.
This also tweaks the Unit Size editor property hint for better usability.
See discussion in #25468.
Fixes#48420, fixes#48421.
The binding was missed when moving GDScript built-in to Global Scope it seems.
Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>