Commit graph

143 commits

Author SHA1 Message Date
Rémi Verschelde 47538ef9a4
Merge pull request #44234 from jeffuntildeath/master
fix for snap to floor editor crash bug
2020-12-10 10:52:24 +01:00
jeffuntildeath 52f6e0b5ad fix for snap to floor editor crash bug
fix for issue #44231: snap_selected_nodes_to_floor() results in an editor
crash when a child collisionshape has invalid shape object
2020-12-09 12:09:41 -06:00
Aaron Franke 8c1d94ebae
Fix trying to set grid visibility on an invalid instance 2020-12-09 06:33:20 -05:00
bruvzg 644f739660
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
2020-12-09 10:17:53 +02:00
Aaron Franke 1b348b3c17
Remove connect *_compat methods 2020-12-05 17:56:47 -05:00
Aaron Franke 5ef62e546f
Rename EditorNode3DGizmoPlugin "get_name" to "get_gizmo_name" 2020-12-04 19:34:50 -05:00
Rémi Verschelde a84ad91280
Merge pull request #43896 from RandomShaper/fix_rel_probe_vis
Put misc. 3D tool visible instances on their own layer
2020-12-03 13:29:16 +01:00
reduz 70f5972905 Refactored Mesh internals and formats.
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES.
-Removed compression, it now always uses the most efficient format.
-Added support for custom arrays (up to 8 custom formats)
-Added support for 8 weights in skeleton data.
-Added a simple optional versioning system for imported assets, to reimport if binary is newer
-Fixes #43979 (I needed to test)

WARNING:

-NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change.
-NOT backwards compatible with 3.x scenes, this will be eventually re-added.
-Skeletons not working any longer, will fix in next PR.
2020-12-02 13:07:59 -03:00
Aaron Franke 896a297c1f
Limit the zoom and freelook speed based on camera settings 2020-12-01 16:14:24 -05:00
Rémi Verschelde a09846e015
Merge pull request #42109 from EricEzaM/PR/input-and-shortcuts-rework
Shortcuts rework - fixed issues with input propagation and triggering of unwanted shortcuts.
2020-11-28 09:04:25 +01:00
Pedro J. Estébanez 4eb3286230 Put misc. 3D tool visible instances on their own layer
This makes that visible stuff invisible to ReflectionProbes, whose preview in the editor shouldn't involve them.
2020-11-26 20:11:00 +01:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
Rémi Verschelde 613b76cfd5
Merge pull request #43861 from JFonS/fix_gizmo_defval
Fix binding of default value in EditorSpatialGizmoPlugin::get_material()
2020-11-25 19:28:05 +01:00
jfons e6949dae72 Fix binding of default value in EditorSpatialGizmoPlugin::get_material()
It was commented for some reason I can't remember.
2020-11-25 18:55:07 +01:00
Eric M efe5c250d5 Implement new shortcuts system.
unhandled_key_input changed to unhandled_button_input. Controls can set a 'shortcut_context' which they can then use to determine if their shortcuts should be triggered or not, based on if the viewport's focused GUI control is a child of their 'shortcut context'.
2020-11-23 21:14:26 +10:00
Aaron Franke 71d1909b39
Update the 3D grid when the "View Grid" checkbox is changed 2020-11-19 05:29:37 -05:00
Rémi Verschelde a7d610db16
Merge pull request #43408 from rcorre/path-gizmos-4.0
Make Path3D handles visible and consistent with 2D.
2020-11-12 13:12:49 +01:00
Ryan Roden-Corrent 8458ba0aef
Proposal 1246: Make Path3D handles more visible.
Resolves godotengine/godot-proposals#1246.

It is difficult to tell the difference between the handles for adjusting
curves and the points themselves when looking at a Path gizmo.
This re-uses the icons used for Path2D.

Unlike Path2D, this does not use a different icon for smooth vs sharp
points, as using a potentially different material for each point would
prevent batching the points in add_handles (and adding them out-of-order
messes up other logic based on handle indices).

This includes a public API change to allow specifying a texture for a
handle material. This allows spatial gizmo plugins to customize the way
a handle is rendered, if desired, but does not break existing behavior
(as providing no texture uses the default).

The path handle icons were resized as well.  16x16 is the standard icon
size. These icons were 10x10 rather than 16x16, and appeared rather
small in the editor.

To resize, I:

- Opened the original in Inkscape
- Resized the document to 16x16
- Opened the transform dialog
- Scaled by 160% proportionally
- Used Align/Distribute to center on the page
- Saved the document
- Cleaned with `svgcleaner --multipass`
2020-11-12 06:37:56 -05:00
Hugo Locurcio 8a3a4fa3a0
Improve the 3D editor selection box appearance
- Draw two boxes slightly offset from each other to give the illustion
  of a thicker outline.
- Decrease the offset compared to the 3D node's AABB to give a more
  accurate representation of its size.
- Make the box fully visible instead of only displaying the corners.
- Draw a x-ray version of the box that's more translucent, but visible
  through walls. This helps make the box more visible while still
  having a sense of depth.
- Use an orange color similar to the 2D editor.
2020-11-09 16:24:12 +01:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz f2397809a8 Refactored Variant Operators.
-Using classes to call and a table
-For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
2020-11-06 12:45:50 -03:00
Aaron Franke a4f963f2c9
Move call to update the 3D grid into check for updating the view 2020-11-04 04:03:28 -05:00
David Sichma 5b1ddcbf40 Gizmo handles transparent again 2020-10-25 23:01:22 +01:00
Juan Linietsky 85ebf40b6c
Merge pull request #38097 from Calinou/add-viewport-debanding
Add a debanding property to Viewport
2020-10-19 14:15:44 -03:00
Rémi Verschelde ca2c0b8937
Merge pull request #42568 from DavidSichma/fix-aabb-update
Make AABB change trigger bounding box update
2020-10-10 10:55:52 +02:00
reduz 26f5bd245c Implement GPU Particle Collisions
-Sphere Attractor
-Box Attractor
-Vector Field
-Sphere Collider
-Box Collider
-Baked SDF Collider
-Heightmap Collider
2020-10-09 13:25:47 -03:00
David Sichma 7701889048 aabb change updates bounding box
spatial editor will now update the bounding box if aabb or transform
changes
2020-10-05 12:56:57 +02:00
Duroxxigar 4834e14493 Updated getters and setters names for toplevel 2020-10-02 19:09:01 -04:00
Rémi Verschelde c646768ba2
Merge pull request #40473 from rcorre/gizmo-doc
Fix return type on EditorNode3DGizmoPlugin::get_priority.
2020-10-01 14:28:38 +02:00
Rémi Verschelde b2e07dd308
Merge pull request #42094 from JFonS/rotation_gizmo_improvements
Improve rotation gizmo
2020-09-28 10:36:35 +02:00
JFonS 5cd9e04447 Improve rotation gizmo
Hide the back sides of the rotation gizmo circles and add a white
outline for better visualization of the rotation "sphere".
2020-09-15 17:12:53 +02:00
Hugo Locurcio 3e0226515e
Rename ShortCut to Shortcut which is more grammatically correct
See https://github.com/godotengine/godot/issues/16863#issuecomment-685236980.
2020-09-09 21:54:54 +02:00
bruvzg 80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Hugo Locurcio 2c9d4ef961
Add an editor setting to invert 3D pan/orbit on the X axis
This also makes the invert Y axis option apply to 3D panning.

This closes #28082.
2020-08-15 13:18:57 +02:00
Hugo Locurcio 8891579068
Add a debanding property to Viewport
It can be enabled in the Project Settings
(`rendering/quality/screen_filters/use_debanding`). It's disabled
by default as it has a small performance impact and can make
PNG screenshots much larger (due to how dithering works).
It will also slightly brighten the scene's dark areas.

As a result, it should be enabled only when banding is noticeable enough.

This closes #17006.
2020-08-14 23:12:33 +02:00
Aaron Franke 56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
SkyJJ 280d4e2965 Fix TTR misuse 2020-07-24 15:15:23 +02:00
Andy Maloney 394a7826be [macOS] Fix Maya navigation with ALT + mouse scroll
Methods were being called with InputEventMouseMotion instead of InputEventPanGesture, and they were null.

Fixes godotengine/godot#16181 on the master branch
2020-07-23 10:38:31 -04:00
Ryan Roden-Corrent c6919a13da
Fix bound return type on get_priority.
Also adds a description explaining gizmo priority.

Inferred from:
e4363d001a/editor/plugins/spatial_editor_plugin.cpp (L5867-L5880)
e4363d001a/editor/plugins/spatial_editor_plugin.cpp (L6462-L6470)
2020-07-21 18:18:33 -04:00
Michael Alexsander 26381265b8 Prefer the highlight version of the "GuiTabIcon" icon for buttons, and make their width/height equal 2020-07-11 12:59:25 -03:00
Juan Linietsky 201d606b3d Addition of SDFGI for open world global illumination
Move GI to a deferred pass
2020-06-26 11:06:48 -03:00
Michael Alexsander f167a2b993 Fix regressions in the 3D lock buttons 2020-06-24 12:09:53 -03:00
Aaron Franke ed2bbdbbef
Avoid errors when the editor camera is inside the focused object
Prevent the gizmo distance from being zero by MAX-ing it with CMP_EPSILON
2020-06-22 04:53:29 -04:00
Vorblen 29e901c342 Fix "Fully Axis-Locked" Freelook Navigation Scheme
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2020-06-20 10:05:43 +01:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Hugo Locurcio 4a542e0007
Restore previous mouse position when leaving the editor freelook mode
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes https://github.com/godotengine/godot-proposals/issues/1076.
2020-06-17 20:02:46 +02:00
Hugo Locurcio eaae50fe4a Display freelook speed and zoom in units in the 3D editor viewport
Now that the 3D editor grid is infinite and adjusts its step automatically,
this helps people get a better sense of scale when moving around in the
3D viewport.

This also fixes the indicator bar drawing on hiDPI displays.
2020-06-16 10:46:01 +02:00
Rémi Verschelde ae21b5ddad
Merge pull request #39372 from aaronfranke/editor-cam-rot
Change the default editor camera rotation to position it in +X +Y +Z
2020-06-09 14:11:30 +02:00
Rémi Verschelde 67f56ff73a
Merge pull request #39365 from Calinou/editor-gizmos-visibility-tooltip
Add an editor tooltip to document gizmo visibility options
2020-06-08 08:24:55 +02:00
Marcus Brummer 41af859c68 Re-apply basis of newly added node (via drag-n-drop) in editor viewport 2020-06-07 22:09:41 +02:00
Aaron Franke 6c2df6792b
Change the default editor camera rotation to position it in +X +Y +Z 2020-06-07 13:36:04 -04:00
Hugo Locurcio 138a4eecb3
Add an editor tooltip to document gizmo visibility options
See discussion in
https://github.com/godotengine/godot-proposals/issues/716.
2020-06-07 18:31:17 +02:00
Rémi Verschelde 1620669f4e
Merge pull request #39051 from Xrayez/geometry-split
Split `Geometry` singleton into `Geometry2D` and `Geometry3D`
2020-05-29 12:10:37 +02:00
Andrii Doroshenko (Xrayez) 69d5de632e Split Geometry singleton into Geometry2D and Geometry3D
Extra `_2d` suffixes are removed from 2D methods accoringly.
2020-05-27 14:28:34 +03:00
Aaron Franke 8879625879
Dynamic infinite 3D grid
Well, infinite for all intents and purposes.
2020-05-22 19:43:59 -04:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde dcd1151d77 Enforce use of bool literals instead of integers
Using clang-tidy's `modernize-use-bool-literals`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
2020-05-14 13:45:01 +02:00
Juan Linietsky 1bea8e1eac New lightmapper
-Added LocalVector (needed it)
-Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too)
-Fixes and changes all around the place
-Added library for 128 bits fixed point (required for Delaunay3D)
2020-05-10 15:59:09 -03:00
Rémi Verschelde 94721f5ab8 Revert "Renamed plane's d to distance"
This reverts commit ec7b481170.

This was wrong, `d` is not a distance but the `d` constant in the
parametric equation `ax + by + cz = d` describing the plane.
2020-05-10 16:47:11 +02:00
Rémi Verschelde 69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Marcus Elg ec7b481170 Renamed plane's d to distance 2020-05-10 12:12:51 +02:00
Rémi Verschelde b9f2e57d62
Merge pull request #38555 from ThakeeNathees/rotation-gizmo-visible-fix
rotation gizmo visible = false; when camera preview
2020-05-08 12:59:31 +02:00
Thakee Nathees 60d67f13da rotation gizmo visible = false; when camera preview 2020-05-08 06:44:24 +05:30
JFonS 051f02a3a0 Keep mouse inside 3D viewport rotation widget
Hide and keep the mouse in place when the user oribts the scene via the 3D
rotation widget.
2020-05-07 19:19:54 +02:00
Rémi Verschelde 878adb22b7
Merge pull request #37717 from qarmin/world_fix
Change non-existent World to World3D
2020-05-04 16:37:40 +02:00
Rémi Verschelde bd8d5e1b65
Merge pull request #38325 from Calinou/editor-no-focus-on-align-with-view
Don't focus the selection after using Align Transform With View
2020-04-30 10:03:29 +02:00
Kiri Jolly 87ba4daf4b Fixed false positives in the culling system.
This fixes numerous false positives coming out of the culling system.

AABB checks are now a full separating-axis check against the frustum, with the points of the frustum being compared to the planes of the box just as the points of the box were being compared to the planes of the frustum. This fixes large objects behind the camera not being culled correctly.

Some systems that used frustums that were (sometimes mistakenly?) unbounded on one or more side have been modified to be fully enclosed.
2020-04-29 19:33:42 -07:00
Rémi Verschelde 58435b0c91
Merge pull request #20371 from aaronfranke/vector-lerp
[Core] [Mono] [GDNative] Rename "linear_interpolate" methods to "lerp"
2020-04-29 15:50:00 +02:00
Hugo Locurcio a636631e33 Don't focus the selection after using Align Transform With View
It made minor adjustments difficult as the camera moved every time
Align Transform With View was used.

This closes #36738.
2020-04-29 15:39:33 +02:00
Aaron Franke 540156b387
[Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
1abinitio1 712a5aff1d Add option for editor freelook camera sensitivity 2020-04-29 09:36:29 +02:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Hugo Locurcio 8a48fb3517
Add editor freelook navigation scheme settings
Depending on what one is trying to achieve, a different freelook mode
may be more desirable.

This closes #34034.
2020-04-18 16:24:12 +02:00
qarmin 559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
Rémi Verschelde 5e5103f460
Merge pull request #37861 from reduz/implement-decals
Implement decals
2020-04-14 17:13:20 +02:00
Juan Linietsky 5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
qarmin c937fe5237 Fixed crash caused by unitialized variable 2020-04-13 12:11:55 +02:00
Juan Linietsky a57dc398db Implement MSAA 2020-04-12 15:33:57 -03:00
Juan Linietsky 16ae2cc1bf Add screen space AA option, with FXAA implementation. 2020-04-12 10:57:18 -03:00
Juan Linietsky d06f8ef75a Shows proper scene render time in editor info
Also fixed GPU profiler, which was not working on nvidia hardware.
2020-04-10 14:19:30 -03:00
Kiri Jolly cc27b4560f Othographic camera in-editor now uses Z near/far settings instead of a hardcoded value
Fixes #18809.

The in-editor ortho camera used a far clipping plane of 8192 units, and was
placed 4096 units away from the camera cursor.

This was far enough to cause culling issues from floating point precision loss
on objects smaller than one unit.

This change modifies the near/far clipping planes of the ortho camera to use
those specified in the editor (and currently used by the perspective camera).
The frustum is still centered around the camera cursor location, as it was
before.

(cherry picked from commit 26912c15e6)
2020-04-10 17:19:49 +02:00
Juan Linietsky 26ecd924cc
Merge pull request #37678 from reduz/refactor-shadowmapping
Refactored shadowmapping.
2020-04-08 13:59:10 -03:00
Juan Linietsky 4ffc0d6b3f Refactored shadowmapping.
- Made shadow bias size independent, so it will remain when changing light or camera size.
- Implemented normal offset bias, which greatly enhances quality.
- Added transmission to subsurface scattering
- Reimplemented shadow filter modes

Closes #17260
2020-04-08 11:19:43 -03:00
jfons 3841a64703 Rename all gizmo classes, using the 4.0 node names. 2020-04-07 10:02:18 +02:00
Rémi Verschelde 59d44ee872
Merge pull request #37505 from YeldhamDev/viewcont_rename
Rename ViewportContainer to SubViewportContainer
2020-04-03 15:53:35 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Michael Alexsander 0c6851ae53 Rename ViewportContainer to SubViewportContainer 2020-04-01 16:11:44 -03:00
Rémi Verschelde eaaee63b62 doc: Update classref with node renames
A few extra renames for classes which were missed in last week's PRs.
2020-03-30 18:23:02 +02:00
Juan Linietsky a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
Rémi Verschelde d1acbbce7f Rename more 2D and 3D nodes to follow convention
Rename editor plugins to match the new node names.
2020-03-27 16:26:34 +01:00
Renamed from editor/plugins/spatial_editor_plugin.cpp (Browse further)