Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also _transform to _transform3d
|
|
|
|
|
|
|
|
Also add a GDScript test for this case.
|
|
|
|
|
|
Fixes #48645.
|
|
Add filter, map and reduce to Array
|
|
|
|
|
|
Re-bind posmod, use int64_t instead of int
|
|
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>
|
|
-Up to each scripting language to implement this
-If not supported for the function, it will just error when you try to call
|
|
Don't allow to use in bit shift negative operands
|
|
Add fill method to Arrays and PackedArrays
|
|
Core: Drop custom `copymem`/`zeromem` defines
|
|
|
|
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.
|
|
|
|
Make calls faster with the caveat that the caller needs to make sure
that the return value type is already correct.
|
|
|
|
-Decode/Encode functions for u8,s8,u16,s16,u32,s32,u64,s64,half,float,double,variant
-Improved binder template to allow this
Given in Godot 4.0 PackedByteArray is passed as reference, it is now possible to have these functions there, which makes the most sense.
|
|
|
|
Rename Array.invert() to Array.reverse()
|
|
GDScript typed arrays
|
|
Does the same internally for List and Vector<>, which includes all
PackedArray types.
|
|
|
|
This ensure that typed arrays are properly checked when setting an
element.
Moved the macro to a straight declaration since the macro was only used
for Array and it now is quite specific to the Array class.
|
|
|
|
The array should just assimilate the type of the other one since
assignment in this case means a change in the reference.
This also adds a `typed_assign` function for the cases where type
validation is wanted.
|
|
Add static method support to core Variant types
|
|
* Properly exposed, including validated and variant call
* Bound static functions in String and Color
* Did not add support for scripting languages, will have to be added manually.
|
|
|
|
Relaxes node name sanitization in gltf documents.
|
|
Other functions in the same file validate parameters using the ERR_FAIL
macros. This validation was missing for Variant::construct resulting in
a crash when called with invalid data (p_type < 0).
fix #46067
|
|
|
|
|
|
It's the only enum in math_defs.h not bound, and it's used by Plane.
|
|
|
|
|
|
|
|
|