Commit graph

65 commits

Author SHA1 Message Date
Rémi Verschelde
3044b8f15a
Merge pull request #40935 from hoontee/master-3
Transform CSGShape collision when necessary
2020-08-11 11:58:36 +02:00
Rémi Verschelde
920f8c86ec
Merge pull request #40919 from hoontee/master-2
Properly handle empty CSGCombiners
2020-08-11 11:57:18 +02:00
hoontee
fc8574fbac Transform CSGShape collision when necessary 2020-08-01 01:45:22 -05:00
hoontee
001b6075cb
Properly handle empty CSGCombiners 2020-07-31 10:11:26 -05:00
Marcel Admiraal
9be7b30f35 Ensure CSG parent's _make_dirty() is called when entering a tree. 2020-07-30 13:34:37 +01: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
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
Marcel Admiraal
b835cfb551 Fix 'physicsw' may be used uninitialized warning in csg_shape.cpp 2020-05-11 12:40:16 +01: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
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
39f7a40925
Merge pull request #37163 from madmiraal/fix-csg-normal
Fix CSG vertex normal calculation.
2020-04-28 14:28:31 +02:00
qarmin
559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Rémi Verschelde
f097511b96 Fix another batch of -Wmaybe-uninitialized warnings
And simplify code in CSGShape.
2020-03-30 18:27:36 +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
Juan Linietsky
eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Martin Liska
c554677c95
Fix various -Wmaybe-uninitialized (#37352). 2020-03-27 13:57:20 +01:00
Marcel Admiraal
9bd305bfe2 Fix CSG vertex normal calculation. 2020-03-19 11:13:35 +00:00
Rémi Verschelde
cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Rémi Verschelde
01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Juan Linietsky
33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Juan Linietsky
69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Juan Linietsky
3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Juan Linietsky
dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rémi Verschelde
dec10dd776
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
2019-09-25 11:51:54 +02:00
qarmin
17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Hugo Locurcio
696a8fb657
Notify changes in properties that can be edited by 3D gizmos
This makes the Inspector always display an up-to-date value
after editing properties using 3D gizmos.
2019-07-10 20:07:48 +02:00
Ibrahn Sahir
4e4697b1c4 Added release function to PoolVector::Access.
For clarity, assign-to-release idiom for PoolVector::Read/Write
replaced with a function call.
Existing uses replaced (or removed if already handled by scope)
2019-07-06 12:04:27 +01:00
Hugo Locurcio
e87e8c0485
Improve the CSG shape gizmo drawing
The gizmo colors now depend on the operation. Subtraction will
result in an inverted gizmo color, whereas intersection is now displayed
as white.

A solid translucent overlay is now drawn over a selected node
to make it easier to distinguish.
2019-07-05 08:13:12 +02:00
qarmin
072e40368e Fix always true/false values 2019-06-20 16:59:48 +02:00
Jason
89a9f4621f Resolve: #24682 CSGPolygon - weird end cap 2019-05-17 20:49:24 +02:00
Leonard Meagher
28b902211f CSGMesh material and CSGShape inherits from GeometryInstance
I left the material on CSGMesh because GeometryInstance's material override prevents the normal material behaviour of the csg meshes

but the material_override is useful, and now you can control the shadow, lod and other properties you get from GeometryInstance
2019-04-11 13:20:09 -07:00
Leonard
209c2d2c80 Apply proper offset to CSGMesh material and smooth group 2019-03-25 21:27:55 -07:00
Andrii Doroshenko (Xrayez)
095f472a0b Fix CSGShape not updating on changing visibility
Hiding CSGShape should force the CSG operation to skip it which is intented
behaviour according to how CSGBrush is created for each shape.
2019-02-10 23:53:31 +02:00
Juan Linietsky
0d438c7b18 Make CSG Shape work with GIProbe, fixes #20465 2019-01-27 18:29:17 -03:00
Rémi Verschelde
053d7f3765 Fix some errors found by static analysis
Fixes items 10, 16 and 19 from PVS-Studio blog post
in #24014.
2019-01-16 10:59:45 +01:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
meditator
0059930644 Add support for collision layers and masks in CSG shapes 2018-12-15 00:36:47 +01:00
Bastiaan Olij
fa63a0fe83 Reverse bitangent on everythings to ensure default normal map behavriour is consistent 2018-12-08 13:43:46 +11:00
Aron Castro
3aeeaa9318 Fix csgshape collider without object id 2018-12-03 16:06:30 -02:00
Rémi Verschelde
477e89a8a2
Merge pull request #23760 from BastiaanOlij/fix_tangent_direction
Fixing tangent and binormal logic
2018-11-20 14:13:36 +01:00
Bastiaan Olij
bcef4b8dc6 Fixing tangent and binormal logic 2018-11-19 22:27:05 +11:00
Bastiaan Olij
9703153396 Adding UVs on end caps 2018-11-19 22:08:49 +11:00
Bastiaan Olij
caf14e77db Adding mikkt tangent support to CSG objects 2018-11-17 00:07:18 +11:00
Juan Linietsky
b9dd095275 Fix CSG shape generation with meshes without indices, fixes #23364 2018-11-01 15:19:47 -03:00
Jean-François Michaud
720f543caa Added a fail condition to prevent a crash 2018-10-15 15:26:02 -04:00