summaryrefslogtreecommitdiff
path: root/scene/2d
AgeCommit message (Collapse)Author
2021-06-05New and improved IK system for Skeleton2DTwistedTwigleg
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.
2021-06-05Deleted YSort, moved its functionality directly into Node2D.andriyDev
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.
2021-06-04Linear velocity cleanupPouleyKetchoupp
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).
2021-06-04Safe margin cleanupPouleyKetchoupp
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.
2021-06-04Support for kinematic_motion in StaticBodyPouleyKetchoupp
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.
2021-06-04More explanatory names for RigidBody modesPouleyKetchoupp
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).
2021-06-04Properties for move_and_slide and remove move_and_slide_with_snapPouleyKetchoupp
- 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
2021-06-04KinematicBody split between new CharacterBody and PhysicsBodyPouleyKetchoupp
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.
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-06-01Merge pull request #49024 from groud/restore_tilemap_show_debugRémi Verschelde
Restore TileMap's debug collision shapes and add navigation.
2021-05-27Tweak Camera2D editor line colors for better visibilityHugo Locurcio
The new color for screen drawing was chosen to be easier to distinguish from the 2D viewport limits. This also makes lines less opaque when the Camera2D has the Current property enabled. The increased line width is enough to spot the camera easily, and the increased opacity on top of that felt obnoxious.
2021-05-25Restore a way to show collsion/navigation on TileMap.Gilles Roudière
Also remove an unused function.
2021-05-25Merge pull request #48955 from Calinou/editor-tweak-property-hintsRémi Verschelde
Tweak dozens of editor property hints for consistency
2021-05-25Tweak dozens of editor property hints for consistencyHugo Locurcio
- Update Viewport MSAA property hints to match the currently exposed values. - Add some performance hints to property hints.
2021-05-24Merge pull request #49033 from groud/fix_deprecated_noRémi Verschelde
Fixes deprecated=no compilation option
2021-05-24Fixes deprecated=no compilation optionGilles Roudière
2021-05-24Merge pull request #48894 from reduz/gpu-particles-2d-2Rémi Verschelde
Support for 2D particles to collide against SDF
2021-05-23Support for 2D particles to collide against SDFreduz
-Added SDF collision support for 2D particles -Changed the SDF generation to be fully signed
2021-05-23Change frame_coords to Vector2ikobewi
2021-05-20Implement scenes tiles in TileMapsGilles Roudière
2021-05-18Merge pull request #42742 from madmiraal/fix-12215Rémi Verschelde
Return RID instead of Object id in area-body_shape_entered-exited signals.
2021-05-18Area: Uncap the range for gravity and change the slider hintsAaron Franke
2021-05-18Merge pull request #36263 from Calinou/increase-default-2d-gravityRémi Verschelde
2021-05-13Merge pull request #39976 from aaronfranke/tilemap-vec2iRémi Verschelde
Update TileMap to use Vector2i
2021-05-11Fixes missng 2D engine bitsreduz
-Mesh2D now works -MultiMesh2D now works -Polygon2D now works -Added hooks for processing 2D particles -Skeleton2D now works 2D particles still not working, but stuff needed for it is now implemented.
2021-05-07Update TileMap to use Vector2i instead of two intsAaron Franke
2021-05-07Rework the TileSet resource and TileMap nodes:Gilles Roudière
- 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)
2021-05-05Increase the default 2D gravity to 980.0Hugo Locurcio
This makes 2D RigidBody physics feel less floaty out of the box. This closes https://github.com/godotengine/godot-proposals/issues/98.
2021-05-02TileMap::world_to_map Ensure half offset is added according to the returned ↵kleonc
value Decide whether half offset should be added based on the value used for calculating the return value of this method.
2021-04-30Prevent setting too big or too small Collision Mask and LayerRafał Mikrut
2021-04-27Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde
We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27Merge pull request #47960 from smix8/issue_47334_navagent2d_target_reachedRémi Verschelde
2021-04-27put distance check to target into functionsmix8
put distance check to target into function
2021-04-23Merge pull request #47485 from rafallus/fix/rigidbody-crashRémi Verschelde
Fix crash on RigidBody _direct_state_changed
2021-04-23Merge pull request #48030 from smix8/issue_47337_broken_navagent2d_callbackRémi Verschelde
2021-04-22Unexpose _direct_state_changed in PhysicsBodyrafallus
Removed _direct_state_changed bindings Affects 2D and 3D nodes Callbacks now use Callable Tests were changed accordingly
2021-04-20Move collision layer and mask into CollisionObject.Marcel Admiraal
2021-04-20Merge pull request #47991 from LightningAA/regroup-area-inspector-4.0Rémi Verschelde
`Area[X]D`: Put physics override parameters in their own group and document that areas can be used to influence audio
2021-04-20Fix broken NavigationAgent2D collision avoidance callbackssmix8
Fix broken NavigationAgent2D collision avoidance callbacks
2021-04-18Put physics override parameters in their own group and document that areas ↵Lightning_A
can be used to influence audio
2021-04-16Fix NavigationAgent2D not emitting "target_reached" Signal reliablysmix8
Fix NavigationAgent2D not emitting "target_reached" Signal reliably
2021-04-11Use Array for node configuration warningsNathan Franke
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-05Re-allow playing AnimatedSprite2D without framesRémi Verschelde
Fixes #47578, partial revert of #47064.
2021-04-05Fix crashes in *_input functionsRafał Mikrut
2021-03-23Merge pull request #45571 from aaronfranke/node2d-real_tRémi Verschelde
Use real_t in 2D nodes
2021-03-20Merge pull request #47001 from madmiraal/rename-sprite_2d-region_enabledRémi Verschelde
Rename Sprite.region_enabled getter and setter methods to match properties
2021-03-19Use real_t in non-physics 2D nodesAaron Franke
2021-03-17Merge pull request #47064 from ↵Rémi Verschelde
jmb462/fix-crash-in-uninitialized-AnimatedSprite2d-play Fix crash on calling play() in a uninitialized AnimatedSprite2D (Fix #46013)
2021-03-17Fix crash on calling play() in a uninitialized AnimatedSprite2Djmb462
When AnimatedSprite2D::play() was called before SpriteFrames has been initialized, a crach occurred (issue #46013). Modification : An error message on null check test has been added to prevent crash. Fix #46013.
2021-03-17Merge pull request #47024 from groud/navigationRémi Verschelde
Allow Navigation to be more flexible