This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object.
This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary.
A few small changes also had to be made to other files, due to the changes cascading down all the includes.
Most of the custom logic to handle special keying cases is now inside
the AnimationPlayerEditorPlugin.
The EditorInspector now emits a signal when inspecting a new object.
Primary and secondary handles are no longer differentiated by their ids, so a bool was added to tell them apart in all the handle-related methods.
Includes a minor fix in CollisionPolygon3DEditor, unrelated to editor gizmos.
When using a FOV scale lower than the default (using Alt + mouse wheel),
the mouse sensitivity is now scaled to make it easier to use freelook
to look at distant objects.
This does not affect orbiting and panning.
The initial offset was using the mouse position when the threshold
was reached instead of the initial click position. This was adding
the drag threshold distance as an extra offset to the final
transformation.
Now the offset is calculated from the initial click position.
This prevents the viewport from going upside-down.
This was suggested at:
https://github.com/godotengine/godot/pull/51984#issuecomment-948614191:
> For 3.4, I think we can just clamp the angle value when using the
> camera orbiting shortcuts. We can investigate what to do with panning
> and freelook in 3.5 and 4.0.
Same as what is already done for shape queries, applied to point and ray
queries. Easier to document and more flexible to add more parameters.
Also expose intersect_point method to script in 3D.
Remove intersect_point_on_canvas in 2D, replaced with a parameter.
Sets `AlignOperands` to `DontAlign`.
`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis
Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
- Increase drag-and-drop snapping to 50 units
(from 10 units).
- Increase Snap Object to Floor maximum height to 500 units
(from 20 units).
- Increase Snap Object to Floor negative margin to 1 unit
(from 0.2 units).