Commit graph

1114 commits

Author SHA1 Message Date
reduz d0bddf53c5 Implement manual particle emission and particle sub emitters. 2020-09-06 10:29:27 -03:00
Marcel Admiraal ce263c4ff6 Ensure assignment operators return by reference to avoid unnecessary copies. 2020-09-04 09:18:19 +01:00
Rémi Verschelde 0864f12f0d
Merge pull request #41044 from hoontee/master-4
Implement CollisionShape3D.make_convex_from_siblings()
2020-09-03 16:29:08 +02:00
Jonathan Vice 28326aec60 Reorder sprite h_frames & v_frames 2020-08-31 14:55:49 +02:00
Marcel Admiraal 91bf9a91dd Ensure node's area tree signals are disconnected when clearing monitoring,
even if nodes are no longer in the tree.
2020-08-23 11:13:02 +01:00
Juan Linietsky 079ca220e1 Added volumetric fog effect. 2020-08-13 11:28:45 -03:00
PouleyKetchoupp 1c231cacb3 Fix 2D Particle velocity with directed emission mask
Changed CPU velocity calculation for EMISSION_SHAPE_DIRECTED_POINTS
to follow the same logic as in the GPU version:
mat2 rotm;
rotm[0] = texelFetch(emission_texture_normal, emission_tex_ofs, 0).xy;
rotm[1] = rotm[0].yx * vec2(1.0, -1.0);
VELOCITY.xy = rotm * VELOCITY.xy;

Now both CPUParticles2D & CPUParticles3D (z disabled) show the same results
as their GPU counterparts and take the initial velocity settings into account.
2020-08-09 18:16:53 +02:00
hoontee 5f86aeffe2 Implement CollisionShape3D.make_convex_from_siblings() 2020-08-05 04:13:33 -05:00
ConorLPBoyle fa4d9c9446 Fixed reload_goal not being called when SkeletonIK3D::start is invoked with p_one_time = true 2020-07-27 20:18:16 +03:00
George Marques 2b9d9bc364
Remove multilevel calls
In general they are more confusing to users because they expect
inheritance to fully override parent methods. This behavior can be
enabled by script writers using a simple super() call.
2020-07-24 14:13:58 -03:00
Rémi Verschelde a5fb445121
Merge pull request #40450 from asmaloney/spelling
Fix spelling & grammar in comments, docs, and messages
2020-07-21 22:14:04 +02:00
Andy Maloney 4dda62f591 Fix spelling & grammar in comments, docs, and messages 2020-07-21 15:17:23 -04:00
Yerik a91103ac89 Add Method get_inverse_inertia_tensor 2020-07-21 11:33:41 -03:00
Juan Linietsky 13e0385702 Properly pass safe margin on initialization.
Fixes jitter.
2020-07-14 10:19:58 -03:00
Marcel Admiraal 26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
Maganty Rushyendra be3a1769fe Fix repeated updates of PathFollow3D Transform
Add optional parameter to specify whether applying rotation to the
PathFollow3D's Transform is necessary, preventing erroneous updates.
2020-07-08 10:06:02 +08:00
Rémi Verschelde 67e4082b1e
Merge pull request #37350 from aaronfranke/force-impulse
Refactor physics force and impulse code to use (force, position) order
2020-07-02 18:39:16 +02:00
Rémi Verschelde 9000e59650
Merge pull request #40016 from akien-mga/environment-code-cleanup
Environment: Refactor code for readability + more
2020-07-01 16:28:48 +02:00
Rémi Verschelde 34e011c8a5
Merge pull request #36307 from Xrayez/raycast-enabled-true
Enable raycast nodes by default
2020-07-01 16:06:16 +02:00
Rémi Verschelde 372136fe75 Environment: Refactor code for readability + more
- Makes all boolean setters/getters consistent.
- Fixes bug where `glow_hdr_bleed_scale` was not used.
- Split CameraEffects to their own source file.
- Reorder all Environment method and properties declarations,
  definitions and bindings to be consistent with each other
  and with the order of property bindings.
- Bind missing enum values added with SDFGI.
- Remove unused SDFGI enhance_ssr boolean.
- Sync doc changes after SDFGI merge and other misc changes.
2020-07-01 14:44:45 +02:00
Adam Reichold b2a204799a Call Node3D::get_global_transform and Vector3::dot only once within Camera3D::is_position_behind to avoid redundant work. 2020-06-27 16:32:11 +02: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
Marcel Admiraal 8ffe905c45 Check for motion in cast_motion() before doing Bullet convexSweepTest().
Also ensure that default closest_safe and closest_unsafe values are
defined in cast_motion() and before cast_motion() is called.
2020-06-21 16:20:26 +01:00
Rémi Verschelde cb9d02a8d1
Merge pull request #38932 from Calinou/increase-light3d-shadow-bias
Increase the default DirectionalLight3D and OmniLight3D shadow biases
2020-06-19 20:02:26 +02:00
Rémi Verschelde 2ad7eb9bb3
Merge pull request #36079 from madmiraal/fix-35744
Normalise p_up_direction vector in move_and_slide()
2020-06-16 12:44:06 +02:00
Marcel Admiraal c4650540d4 Normalise p_up_direction vector in move_and_slide() and
move_and_slide_with_snap() and fix tolerance in
move_and_slide_with_snap() max floor angle.
2020-06-16 09:56:08 +01:00
Rémi Verschelde 8db8577f10
Merge pull request #39126 from TwistedTwigleg/GSOC_2020_Working_Branch
Skeleton and Skeleton inspector low-level changes
2020-06-16 09:30:22 +02:00
TwistedTwigleg 24905becb2 Made low level changes to the Skeleton3D class and Skeleton3D inspector. Changes listed below:
* Added helper functions to Skeleton3D for converting transforms from bone space to global space, and vice versa.
* Updated the Skeleton3D class reference.
* Changed the icon used for bones in the Skeleton3D inspector to use BoneAttachement3D's icon.
* Changed the Skeleton3D inspector to use EditorPropertyTransform and EditorPropertyVector3 when possible.
* Placed the Transform/Matrix for each bone in a sub-section, so it is visually similar to the Node3D inspector.
2020-06-15 17:18:06 -04:00
Rémi Verschelde b3bc5aafc5 Object: Add usage hint to instantiate Object properties in editor
Fixes #36372 as Path2D/Path3D's `curve` property no longer uses a Curve
instance as default value, but instead it gets a (unique) default Curve
instance when created through the editor (CreateDialog).

ClassDB gets a sanity check to ensure that we don't do the same mistake
for other properties in the future, but instead use the dedicated
property usage hint.

Fixes #36372.
Fixes #36650.

Supersedes #36644 and #36656.

Co-authored-by: Thakee Nathees <thakeenathees@gmail.com>
Co-authored-by: simpuid <utkarsh.email@yahoo.com>
2020-06-12 14:30:18 +02:00
Aaron Franke ba27deef06
Refactor physics force and impulse code 2020-06-02 23:18:59 -04:00
Hugo Locurcio b46756c723
Add performance hints to the DirectionalLight shadow mode property hint
This also clarifies some parts in the DirectionalLight documentation.
2020-06-01 01:20:35 +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) 11f367fe02 Enable raycast nodes by default 2020-05-27 15:10:53 +03: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
Hugo Locurcio 971a0deeb6
Increase the default DirectionalLight3D and OmniLight3D shadow biases
This should decrease the amount of visible shadow acne by default.
2020-05-23 14:22:22 +02:00
K. S. Ernest (iFire) Lee f7fdc87789 Custom Skeleton3DEditorPlugin
Co-authored-by: Marios Staikopoulos <marios@staik.net>
2020-05-22 09:54:34 -07:00
Andrea Catania 7c2794b35c Fixed kinematic body axis lock 2020-05-19 13:37:54 +02:00
Rémi Verschelde ca3192d18a Style: Fix unnecessary semicolons that confused clang-format 2020-05-19 11:24:58 +02: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 710b34b702 Style: Fix missing/invalid copyright headers 2020-05-14 16:54:54 +02:00
Rémi Verschelde a1aaed5a84 Remove redundant void argument lists
Using clang-tidy's `modernize-redundant-void-arg`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-redundant-void-arg.html
2020-05-14 13:51:45 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Rémi Verschelde d3bd219362 doc: Sync classref with current source
Adds API changes from the new GPU lightmapper.
2020-05-12 10:10:50 +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