summaryrefslogtreecommitdiff
path: root/core/variant
AgeCommit message (Collapse)Author
2021-06-11Reformat structure string operatorsAaron Franke
The order of numbers is not changed except for Transform2D. All logic is done inside of their structures (and not in Variant). For the number of decimals printed, they now use String::num_real which works best with real_t, except for Color which is fixed at 4 decimals (this is a reliable number of float digits when converting from 16-bpc so it seems like a good choice)
2021-06-11Merge pull request #49279 from Calinou/rename-string-is-abs-path-methodRémi Verschelde
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-10Let var2str display StringName with correct sigilJonathan Gollnick
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-04Rename Quat to QuaternionMarcel Admiraal
2021-06-04Add "Transform" compatibility name for "Transform3D" in VariantParserAaron Franke
2021-06-03Merge pull request #38430 from aaronfranke/transform3dRémi Verschelde
2021-06-03Allow clamping vectors and colorsAaron Franke
2021-06-03Rename Vector2 clamped to limit_length and add limit_length to Vector3Aaron Franke
2021-06-03Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio
This is more consistent with `NodePath.is_absolute()`.
2021-06-03Rename files and the exposed name for Transform3DAaron Franke
2021-06-03Rename Variant TRANSFORM to TRANSFORM3DAaron Franke
Also _transform to _transform3d
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-05-25Return error when decompressing empty PoolByteArrayPaweł Fertyk
2021-05-24Merge pull request #49037 from vnen/fix-callable-freed-crashRémi Verschelde
2021-05-24Make Callable not crash on call when the object has been freedGeorge Marques
Also add a GDScript test for this case.
2021-05-21Remove alloca from loop and use a single fixed size array declarationMarcel Admiraal
2021-05-20Fix #46282 Executing RigidBody3D.get_inverse_inertia_tensor() crashes GodotJohnM666
2021-05-11GDNative: Fix size mismatch on 32-bit platforms for Signal and CallableRémi Verschelde
Fixes #48645.
2021-05-06Merge pull request #38645 from KoBeWi/FMRRémi Verschelde
Add filter, map and reduce to Array
2021-05-06Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio
2021-05-05Add filter, map and reduce to ArrayTomasz Chabora
2021-05-04Merge pull request #48442 from akien-mga/posmod-int64_tRémi Verschelde
Re-bind posmod, use int64_t instead of int
2021-05-04Re-bind posmod, use int64_t instead of intRémi Verschelde
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>
2021-05-03Add RPC to Callablereduz
-Up to each scripting language to implement this -If not supported for the function, it will just error when you try to call
2021-05-03Merge pull request #35245 from qarmin/unsigned_bit_shiftRémi Verschelde
Don't allow to use in bit shift negative operands
2021-04-28Merge pull request #46476 from DarknessCatt/masterRémi Verschelde
Add fill method to Arrays and PackedArrays
2021-04-28Merge pull request #48239 from akien-mga/goodbye-copymemRémi Verschelde
Core: Drop custom `copymem`/`zeromem` defines
2021-04-27Raise error if Resource is of wrong type as function argumentFlorian Kothmeier
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-21Add fill method to Arrays and PackedArraysMatheus Lima Cunha
2021-04-16Remove return value type adjust of builtin method callsGeorge Marques
Make calls faster with the caveat that the caller needs to make sure that the return value type is already correct.
2021-04-12Fix PackedFloat32Array get index not workingJulien Nguyen
2021-04-10Add marshalling to PackedByteArrayreduz
-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.
2021-04-05Style: Apply clang-tidy's `readability-braces-around-statements`Rémi Verschelde
2021-04-01Merge pull request #46991 from madmiraal/rename-invert-reverseRémi Verschelde
Rename Array.invert() to Array.reverse()
2021-03-29Merge pull request #46830 from vnen/gdscript-typed-arraysRémi Verschelde
GDScript typed arrays
2021-03-21Rename Array.invert() to Array.reverse()Marcel Admiraal
Does the same internally for List and Vector<>, which includes all PackedArray types.
2021-03-19Use real_t in GridMap and VariantParserAaron Franke
2021-03-18Make Variant setget use set() method of ArrayGeorge Marques
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.
2021-03-18Add functions to retrieve type of a typed ArrayGeorge Marques
2021-03-18Don't check type when assigning ArrayGeorge Marques
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.
2021-03-16Merge pull request #46378 from reduz/static-method-in-variant-typesRémi Verschelde
Add static method support to core Variant types
2021-03-16Add static method support to core Variant typesreduz
* 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.
2021-03-12Fixes small typos and grammar correctionAnshul7sp1
2021-03-09Merge pull request #45545 from abaire/relaxes_gltf_name_sanitizationRémi Verschelde
Relaxes node name sanitization in gltf documents.
2021-03-04Add missing ERR_FAIL_INDEX check to Variant::constructAlex Hirsch
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
2021-03-04Don't allow to use in bit shift negative operandsRafał Mikrut
2021-02-24Relaxes Node naming constraints in glTF documents to match the Editor.abaire
2021-02-23Bind ClockDirection enumGeorge Marques
It's the only enum in math_defs.h not bound, and it's used by Plane.