Commit Graph

69 Commits

Author SHA1 Message Date
Haoyu Qiu
dbd2b16a35 Fix NavigationObstacle not registering to default navigation map 2022-10-08 17:04:14 +02:00
kobewi
903c9932e5 Don't store frame of playing AnimatedSprite 2022-10-08 16:33:38 +02:00
67b7c1689f Fix compile. 2022-10-08 16:15:55 +02:00
lawnjelly
cd68b6e1e2 CPUParticles initialize data on set_amount
Fills particle data with zeroes on resize using set_amount(), to prevent garbage data including Nans being sent to VisualServer, which can corrupt the spatial partitioning.
2022-10-08 16:13:50 +02:00
lawnjelly
dae57cd077 Low priority redraw request for AnimatedSprite
Prevents animated sprite from creating continuous redraws in vital_redraws_only mode.
2022-09-17 00:05:36 +02:00
b6dc768e74 Fix build. 2022-09-16 19:47:02 +02:00
Marcin Nowak
a697c239b8 Backport panning strength parameters from 4.0 2022-09-16 19:44:55 +02:00
Yuri Sizov
494dc2f957 Backport fixes to documentation for paths, curves and navigation servers 2022-09-16 13:07:20 +02:00
9b3714a274 Now CanvasItems work with World overrides aswell. 2022-08-30 01:40:03 +02:00
24a1580dbf Renamed the files aswell. 2022-08-29 17:33:10 +02:00
b9f3d3b26a Moved Skeleton2D and it's related classes into a module. 2022-08-28 13:57:25 +02:00
a1865fd1af Now Camera2Ds handle being current properly, and also more intuituvely. 2022-08-24 18:11:10 +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
0438da9841 Ported: [3.x] Add ShapeCast and ShapeCast2D nodes - PrecisionRender
47a62e28ac
2022-08-19 03:12:32 +02:00
45c65911b5 Ported: Allow negative scale in Particles and CPUParticles
This can be used to make 2D particles look more 3D-y with thoughtful use
of scale curve animation.
- Calinou
c4a3560884
2022-08-19 02:42:33 +02:00
521934ff55 Ported from Godot4: New and improved IK system for Skeleton2D
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.
- TwistedTwigleg
8aa3c2f091
2022-08-18 18:47:30 +02:00
9757c39f05 Moved a few more core classes. 2022-08-17 17:43:49 +02:00
99e94b08c4 Moved base input related classes to core/input. 2022-08-17 17:02:24 +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
dc9cc716c7 Moved Object related classes under core/object. 2022-08-17 13:45:14 +02:00
388b88678e Moved container related classes in core under a new containers directory. 2022-08-17 12:53:49 +02:00
0d2fc2e9f2 Moved color to core/math. 2022-08-17 11:38:15 +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
220954cf08 Backported most of the improvements to String from Godot4. 2022-08-15 22:54:03 +02:00
e4cad690a3 Renamed elements in Transform2D to columns. 2022-08-14 15:37:05 +02:00
d9a8497546 Renamed translate in Transform2D to translate_local. 2022-08-14 14:59:46 +02:00
47358bfaab Backported: 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
- verdog
879f84d8f8
- Note that i did not rename the original Camera related methods.
2022-08-12 18:29:04 +02:00
53f274de2f Ported: AnimatedSprite Fix updating inspector when SpriteFrames is modified - kleonc
8ae246f15e
2022-08-07 16:20:57 +02:00
Marcel Admiraal
89737a1ad5 Ensure changes to Camera2D's limits don't affect smoothed_camera_pos 2022-07-30 00:29:44 +02:00
Marcel Admiraal
0d55a30eb1 When Camera2D enters tree, ensure first update is not lost 2022-07-30 00:29:28 +02:00
kleonc
0d8a6b6cdd Fix CanvasItem not exiting its canvas group on canvas exit 2022-07-29 22:01:35 +02:00
Marcel Admiraal
e2987f8914 Update camera position when updating camera limit 2022-07-29 20:55:32 +02:00
Hayden
8e1244c196 Fix crash on NaN offset in path_follower 2d and 3d 2022-07-29 20:52:27 +02:00
Rémi Verschelde
6c004dcad2 SpriteFrames: Sort animations alphabetically
Fixes #62143.
2022-07-29 20:52:11 +02:00
e0e4d0e51d Ported: Fix editor-only visibility for lights
* Update visibility again for editor-only lights if owner changes.
Fixes #26399, supersedes #52327
- reduz
995281ca90
2022-07-29 19:28:33 +02:00
smix8
e037bd3bb6 Group NavigationAgent properties
Groups the ill-defined NavigationAgent properties between pathfinding and avoidance to make it more clear which property affects what.

(cherry picked from commit dde09be302afa08f5744533e82247bb49eff1f83)
2022-07-29 16:30:15 +02:00
6101beb960 Ported: Add NavigationAgent desired path distance - smix8
88e42b2915
2022-07-29 11:36:09 +02:00
kleonc
c1a9c5007b Fix CPUParticles2D.emission_shape enum hint 2022-07-29 10:37:11 +02:00
2e0589f63a Ported: [3.5] Add NavigationAgent2D/3D set_navigation_map() function
Add NavigationAgent2D/3D set_navigation_map() function. Also fixes some bugs from leftover code before the backport update.
- smix8
c6f9627c74
2022-07-29 10:34:10 +02:00
bb5acfd745 Ported: [3.5] Update NavigationServer backport
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.
- smix8
8bd7c6188b
2022-07-28 22:34:28 +02:00
smix8
cce30604e4 Expose get_mesh() for NavigationPolygon Resources
Expose get_mesh() for NavigationPolygon Resources.

(cherry picked from commit 8bcce0ebb2ab5da94cc86f77df4c86f63bc5d22e)
2022-07-28 14:43:47 +02:00
smix8
eaf28297ec Process NavigationAgent2D/3D avoidance on demand only
Changes NavigationAgent avoidance callback to a toggle that is disabled by default.
Also fixes a few missing descriptions / wrong warnings.

(cherry picked from commit 7f3688603cb3662e425cb7a1dce15459162c1dc6)
2022-07-27 23:13:40 +02:00
60b854d657 Ported: Make Navigation Agents and Obstacles respect parent process mode
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.
- smix8
88acb5b798
2022-07-27 20:07:55 +02:00
smix8
1d428ac1c9 Update NavigationPolygonInstance when polygons of NavigationPolygon change
Updates NavigationPolygonInstance polygons on the NavigationServer2D when the NavigationPolygon Resource emits its changed signal due to e.g. polygons altered by script.
2022-07-27 19:45:42 +02:00
Haoyu Qiu
5ceff7f039 Fix AnimatedSprite doesn't emit animation_finished when changing playback direction
(cherry picked from commit d5f5e96e118d6904aaa071fcb8e8f08fa2d4eae5)
2022-07-27 19:14:49 +02:00
smix8
4a5982b9e1 Expose NavigationObstacle2D/3D get_rid() and add config warning
Exposes get_rid() function for scripting.
Adds configuration warning when obstacle is used with not intended static body parent.

(cherry picked from commit 001d89223f1377717d2b3d5ec453ff8dd3604182)
2022-07-27 18:49:00 +02:00
smix8
96b8c4d323 Fix NavigationObstacle2D/3D get_global_transform() error
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 cc707412e909f117ad53ebe53e19bad43acf086a)
2022-07-27 18:48:43 +02:00
b4ed478b6c Ported: Mention that Area2D doesn't support one_way_collision - KoBeWi
bdbbc78da4
2022-07-27 18:32:54 +02:00