Commit graph

561 commits

Author SHA1 Message Date
Ignacio Etcheverry
7034d48032 Fix binding some core API methods only in tools builds 2018-04-29 19:49:26 +02:00
Juan Linietsky
8d199a9b2c CSG Support for Godot!
-Missing Icons
-Missing freezing option (for baking light and faster load)
-Missing a way to export from Godot (GLTF2?)
-Probably buggy (may freeze editor, can be worked around easily, but let me know if this happens so it's easier to catch bugs)
Happy testing!
2018-04-27 21:55:10 -03:00
Crazy-P
e6deba8d19 Fixes logically dead code (Coverity)
Fixes reported logically dead codes by Coverity

* image.cpp: Doesn't really need any modification. But to remove the bug
report then we have to move the MAX call away from the for loop
statement.

* rasterizer_gles3.cpp: Removes unnecessary elif condition since it is
checked earlier in the function

* collada.cpp: If stamement never reached due to macro ERR_CONTINUE does
the same.

* navigation_mesh.cpp: Variables should always be null - however, also
checked for the very same condition in their function call. Leaving this
for review (whether the function call is necessary or not)

* path_editor_plugin.cpp: If cancel is true, then it should restore the
edited value to the original provided.
http://docs.godotengine.org/en/3.0/classes/class_editorspatialgizmo.html#class-editorspatialgizmo-commit-handle

* spatial_editor_gizmos.cpp: the very condition of i >= 3 is
predetermined in the if case right before it. Thus case 1 is always '1'
and case 2 is always '-1'

* grid_map_editor.cpp: Same as above in spatial_editor_gizmos.cpp

* voxel_light_baker.cpp: Same as above in spatial_editor_gizmos.cpp

* visual_server.cpp: Same as above in spatial_editor_gizmos.cpp

* visual_script_expression.cpp: char '-' is already true in the switch
case mechanism. Thus it can never reach to default case.

* particles.cpp: Case 'PARAM_MAX' is unreachable due to index checking
right before the switch execution.

* shader_language.cpp: Invalid index is handled in switch default case.
`type < TYPE_FLOAT && type > TYPE_VEC4` -> `(type < TYPE_FLOAT || type > TYPE_VEC4`)
Fixes the "always false problem" in TODO comment.
2018-04-21 22:35:23 +08:00
tagcup
a5e0bb447c Avoid converting Quat to Euler angles when not necessary.
Also ensure that get_scale doesn't arbitrarlity change the signs of scales, ensuring that the combination of get_rotation and get_scale gives the correct basis.

Added various missing functions and constructors.

Should close #17968.
2018-04-14 15:53:25 -04:00
Rémi Verschelde
fbc61374ca Use internal physics processing for Nodes' internal logic 2018-04-11 09:28:14 +02:00
Alexander Alekseev
6a5ed3a42b Fix RigidBody's configuration warning for Z axis 2018-04-09 09:28:31 +03:00
Juan Linietsky
217a95868a
Merge pull request #16707 from Web-eWorks/atlasfixes
Fix Sprite3D's incorrect behavior when using AtlasTextures.
2018-04-08 17:11:16 -03:00
Juan Linietsky
fdfbff3cef
Merge pull request #17642 from brendor/master
Particles 2D and 3D - fix hue variation not working
2018-04-07 16:55:10 -03:00
Bastiaan Olij
a36e5951ff Improve side impulse calculation 2018-03-30 09:30:38 +11:00
Rémi Verschelde
f720d86b0b
Merge pull request #17555 from poke1024/add-worldenv-warning
Warn about WorldEnvironment being ignored
2018-03-23 11:27:03 +01:00
brendor
7061c28df7
Particles 2D and 3D - fix hue variation not working by transposing the hue matrix
The hue variation matrix is hardcoded as transposed and thus the multiplication always yielded the original color value.
I wanted to keep the matrix and get the same result by switching the operands (getting a result as if the matrix was transposed).
2018-03-20 01:28:41 +01:00
Jakub Grzesik
f78c7353ea a way to ensure that camera is disabled 2018-03-17 10:57:04 +01:00
ShyRed
bc1522e268 Use fake audio playing property in editor
It appears that some time ago users were supposed to be able to include the playback of sound effects in their animations by placing keys on the "playing" property. Back then the key frame editor took the value of the checkbox in the property_editor.

Somewhere / Sometime this behaviour changed and the key frame editor is now reading the actual value from the object instead of relying on the property editor.

This commit introduces a fake active field that is returned when reading the playing property in the editor. While the actual active flag is changed when playback is finished the fake one will stay the same thus allowing the user to take their time with setting the key in the animation editor.
2018-03-16 15:26:23 +01:00
Geoffrey
09c887f38e Implemented interface for bullet joint motors 2018-03-16 13:37:15 +01:00
Bernhard Liebl
29d305599d Warn about WorldEnvironment being ignored 2018-03-16 11:21:57 +01:00
Poommetee Ketson
6b22ec5f6c InterpolatedCamera: use internal_process 2018-03-16 05:15:26 +07:00
Hein-Pieter van Braam
555eebf3f4 Don't crash when trying to add an invalid navmesh
It is possible to try to add an invalid object as a navmesh through
GDScript which results in an engine crash. This creates a debug message
that should help the user figure out what's wrong.
2018-03-02 09:37:32 +01:00
JFonS
99d740c46e Fix visibility of gizmos on scene load 2018-02-24 12:05:43 +01:00
Poommetee Ketson
38865345d9 Particles: fix corrupted scene when saved after convert (2nd try) 2018-02-24 15:58:17 +07:00
luz.paz
612ab4bbc6 Fix typos with codespell
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt`
Whitelist consists of:
```
ang
doubleclick
lod
nd
que
te
unselect
```
2018-02-21 19:46:06 +01:00
Rémi Verschelde
497a4e9e25
Merge pull request #16757 from AndreaCatania/kinpush
Improved kinematic body, Now can move rigid body
2018-02-20 15:41:10 +01:00
Andrea Catania
6ed392f47a Improved kinematic body 2D and 3D, Now can move rigid body 2018-02-20 12:43:47 +01:00
Chris Bradfield
a5688ccd90 Improve CollisionObject/CollisionObject2D warning message 2018-02-19 21:48:31 +01:00
Rémi Verschelde
a41c45c335
Merge pull request #16060 from sdfgeoff/apply_torque
Exposed apply_torque_impulse to gdscript
2018-02-19 21:38:33 +01:00
Poommetee Ketson
d2e3607fa0 Fix timer second not zero padded when < 10
Also RTR "Time Left:"
2018-02-19 21:53:39 +07:00
Artem Varaksa
d35e486228 Clean up some bad words from code comments 2018-02-17 16:00:39 +03:00
sdfgeoff
cdd8334585 Exposed apply_torque_impulse to gdscript and added documentation for added apply_torque_impulse method 2018-02-15 16:42:24 +01:00
Webster Sheets
973be3711a Fix Sprite3D's incorrect behavior when using AtlasTextures. 2018-02-15 10:33:58 -05:00
Andrea Catania
a42765dada Added physics API in order to enable/disable collisions between rigidbody attached to a joint with bullet physics bullet
Fixes #16424
2018-02-05 18:54:07 +01:00
Paolo Perkovic
08d4bfacaf Fix inconsistencies and typos in argument names 2018-02-01 16:47:20 +01:00
Rémi Verschelde
ff287d8341
Merge pull request #15254 from mrcdk/pitch_scale
Added pitch scale property to AudioStreamPlayer, AudioStreamPlayer2D and AudioStreamPlayer3D
2018-02-01 14:26:27 +01:00
Rémi Verschelde
37cb029fcc
Merge pull request #15938 from poke1024/fix15904
Fix crash on deleted rigidbodies without contact monitor (issue 15904)
2018-01-22 00:02:14 +01:00
Rémi Verschelde
e1f34249eb Fix typo in CollisionObject warning 2018-01-21 21:32:00 +01:00
Bernhard Liebl
e9237d83c7 Fix crash on deleted rigidbodies without contact monitor (issue 15904) 2018-01-21 12:46:13 +01:00
Rémi Verschelde
9f479f096c Fix typos in code and docs with codespell
Using v1.11.0 from https://github.com/lucasdemarchi/codespell
2018-01-18 22:01:42 +01:00
Juan Linietsky
cc8dfcc9c0 Before I forget, add warnings on areas without children (should not break anything).
Seen too many users misunderstanding the edit rect is the shape.
2018-01-18 14:31:07 -03:00
Unknown
5876457410 modify default param names in couple of signals
'name' default param should not be used since there is problem with name shadowing
2018-01-12 15:45:29 +01:00
Rémi Verschelde
bab9759645
Merge pull request #15606 from RandomShaper/fix-inherited-coll-shapes
Update collision shapes data on tree entered
2018-01-12 13:48:17 +01:00
Rémi Verschelde
2dbd3475a5
Merge pull request #15620 from AndreaCatania/p4
Reset collider on ray node
2018-01-12 12:49:16 +01:00
AndreaCatania
207af6c4f9 Reset collider on ray node 2018-01-12 12:31:02 +01:00
Juan Linietsky
a26e6c8215 Renamed tree_exited to tree_exiting. tree_exited is now used for actual out of tree notification.
Updated doc accordingly.
2018-01-12 08:29:24 -03:00
Bojidar Marinov
9b8e8b2220
Bind many more properties to scripts
Notable potentially breaking changes:
- PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL
- Some properties were renamed, and sometimes even shadowed by new ones
- New getter methods (some virtual) were added
2018-01-12 00:58:14 +02:00
Pedro J. Estébanez
aefedb73fc Update collision shapes data on tree entered
This is needed because the final startup values for shapes may change between parenting and entering the scene tree. For instance, if the collision shape belongs to a inherited scene.

Fixes #13835.
2018-01-11 21:08:58 +01:00
Juan Linietsky
9a62829759
Merge pull request #15531 from AndreaCatania/p2
Fixed crash on duplicate GIProbe baking
2018-01-11 16:44:18 -03:00
Juan Linietsky
5398363572 solved particle memory leak, fixes #15591 2018-01-11 16:04:12 -03:00
AndreaCatania
5ac441131e Fixed crash on duplicate GIProbe baking 2018-01-11 19:50:33 +01:00
Ruslan Mustakov
0d83e20236 Fix registered light_data property type name 2018-01-11 19:53:54 +07:00
Juan Linietsky
c791c1d48e
Merge pull request #14907 from scayze/rigid_vehicle
Added RigidBody functionality to VehicleBody
2018-01-08 11:50:49 -03:00
Scayze
4a201ade76 Added RigidBody functionality to VehicleBody 2018-01-07 00:18:42 +01:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Juan Linietsky
cd63407aa4 Avoid crashes in skeleton 2018-01-03 17:27:31 -03:00
Juan Linietsky
14772d2213
Merge pull request #15083 from tagcup/spatial_rot_fix
Restore the behavior of Spatial rotations recently changed in c1153f5.
2018-01-02 15:02:19 -03:00
MrCdK
5bc010e8ee Added pitch scale property to AudioStreamPlayer, AudioStreamPlayer2D and AudioStreamPlayer3D 2018-01-01 22:23:16 +01:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Juan Linietsky
c595aff4a3 avoid error on setting skeleton from transform changed 2017-12-29 12:36:44 -03:00
Juan Linietsky
2de70698ae Missing transform notification for Skeleton. 2017-12-29 11:55:34 -03:00
Juan Linietsky
448b58ba4c Use a different approach to update skeletons when transform changes 2017-12-29 11:34:36 -03:00
Juan Linietsky
a54e3f72ce Update the skeleton on transform 2017-12-29 10:54:24 -03:00
Juan Linietsky
f11a138505 Added more hacks to GLTF2 importer to support crap exporter (MakeHuman in this case), fixes #13393 2017-12-28 16:07:45 -03:00
tagcup
e9896b17a9 Restore the behavior of Spatial rotations recently changed in c1153f5.
That change was borne out of a confusion regarding the meaning of "local" in #14569.

Affine transformations in Spatial simply correspond to affine operations of its Transform. Such operations take place in a coordinate system that is defined by the parent Spatial. When there is no parent, they correspond to operations in the global coordinate system.
This coordinate system, which is relative to the parent, has been referred to as the local coordinate system in the docs so far, but this sloppy language has apparently confused some users, making them think that the local coordinate system refers to the one whose axes are "painted" on the Spatial node itself.

To avoid such conceptual conflations and misunderstandings in the future, the parent-relative local system is now referred to as "parent-local", and the object-relative local system is called "object-local" in the docs.

This commit adds the functionality "requested" in #14569, not by changing how rotate/scale/translate works, but by adding new rotate_object_local, scale_object_local and translate_object_local functions. Also, for completeness, there is now global_scale.

This commit also updates another part of the docs regarding the rotation property of Spatial, which also leads to confusion among some users.
2017-12-27 16:40:49 -05:00
Noshyaar
5c636875e4
Merge pull request #14971 from mrcdk/particles_emitting
Set particles emitting to false when particles finish emitting with one-shot enabled
2017-12-27 10:45:36 +07:00
Juan Linietsky
c1153f5041 Change the rotate function of Spatial to be local, makes more sense. Closes #14569 2017-12-26 12:45:56 -03:00
Juan Linietsky
02e883713a
Merge pull request #14977 from volzhs/fix-crash-group
Fix crash & error at saving scene
2017-12-26 11:43:02 -03:00
volzhs
ff68b80df7 Fix error if scene has Camera at saving scene 2017-12-25 02:43:37 +09:00
Juan Linietsky
021f3c924b -Removed OpenMP support, replaced by a custom class.
-Disabled Opus, implementation is wrong.
2017-12-24 09:32:12 -03:00
MrCdK
1f609b7a82 Set particles emitting to false when particles finish emitting with one-shot enabled 2017-12-23 05:23:41 +01:00
Rémi Verschelde
7d9b7f9c47
Merge pull request #14897 from BastiaanOlij/arvr_tweaks
Few small tweaks for ARVR
2017-12-23 00:59:09 +01:00
Daniel J. Ramirez
1696db8f00 Fixes 3d camera keep aspect. 2017-12-22 14:24:38 -06:00
Juan Linietsky
7d0cabe9d3 Change skeleton processing to work on global coordinates, should help fix many import problems from Blender, GLTF2, etc. 2017-12-21 17:36:39 -03:00
Bastiaan Olij
6fd51b6a1b Reserved controller ids 1 and 2 for left and right hand controllers and added new center on hmd option 2017-12-22 01:21:23 +11:00
Juan Linietsky
1fa9aac3e4 -Make capture dependent on a cell size, not subdivision.
-Fixed a bug recently introduced when releasing mouse events and calling popups
2017-12-21 11:05:55 -03:00
Hein-Pieter van Braam
0db5123548 Prevent false sharing in lightbaker RNG state
The previous commit corrected the RNG behavior for the lightbaker but
also made it significantly slower on high core count systems. Due to the
vector of states being physically close together in RAM we force a cache
synchronization across all cores whenever we call for the next random
number to be generated.

This will create a temporary local copy of the RNG state before entering
the loop and then saving it back to the global state when done. This
will preserve the per-thread RNG state (and random number quality) while
significantly improving performance.

On my 16 thread box it saves 3 minutes baking the Sponza scene, bringing
performance back in line to before the various RNG fixes were
introduced, being slightly faster than the first implementation.
2017-12-20 14:37:00 +01:00
Hein-Pieter van Braam
ccbb5923ac Fix lightmapper rng
In our previous attempts to fix the lightmapper we may have
inadvertently introduced the same issue we were trying to fix. It
appears that rand() will on some platforms introduce a mutex making it
slower and on others may have a per-thread state that would need to be
initialized with srand() on each thread. This slows down the lightbaking
further.

This sets up a separate rng state for each OpenMP thread by calling
rand() only in the single-threaded part of the code. We then keep a
vector of states.

I believe this solves our problems.
2017-12-20 12:09:09 +01:00
Hein-Pieter van Braam
7a10d3ab78 Correct license headers in main.cpp and voxel_light_baker.cpp
Sorry for the churn
2017-12-20 01:04:30 +01:00
Hein-Pieter van Braam
9fa5a588f0 Fix lightbaker clang-format issue and add license headers 2017-12-20 01:02:03 +01:00
Hein-Pieter van Braam
ff04c07912 Lightbaker: include stdlib.h to fix CI builds 2017-12-20 00:29:27 +01:00
Juan Linietsky
808a3b9c71 Fix randomness in voxel light baker, closes #14841 2017-12-19 19:51:40 -03:00
Juan Linietsky
06dd10b390 Fix raytrace lightmap bake bias 2017-12-19 17:09:05 -03:00
Juan Linietsky
5544b89750 properly plot normal when baking 2017-12-19 15:04:52 -03:00
Juan Linietsky
a714e1a4c7 Fixed bug where all file dialogs requested thumbnails even if hidden. 2017-12-19 12:57:46 -03:00
Rémi Verschelde
abf20709af doc: Sync classref with current source 2017-12-18 08:13:58 +01:00
Juan Linietsky
e96c40f94a Added baked light support for gridmaps. 2017-12-18 00:35:20 -03:00
Stefano Bonicatti
a15721e5c9 Fix Sprite3D alpha_cut member not being initialized 2017-12-17 22:07:43 +01:00
Rémi Verschelde
89a32b4977
Merge pull request #14775 from hpvb/limit-lightmapper-subdiv
Limit the lightmapper subdivide to 1024
2017-12-17 19:59:59 +01:00
Hein-Pieter van Braam
c4c7fa3f5e Limit the lightmapper subdivide to 1024
Due to memory contraints in other places in Godot it is unlikely that
anything higher than 1024 will actually work. When/if we improve memory
management for vectors we can increase  this limit again
2017-12-17 18:00:00 +01:00
Rémi Verschelde
8f25a2dc11 Cleanup some #if 0'd code 2017-12-17 15:40:24 +01:00
Rémi Verschelde
ad3393743c
Merge pull request #14760 from hpvb/add-several-unlikely-macros
Add several unlikely() macros
2017-12-17 14:28:15 +01:00
Rémi Verschelde
539fd14cf5
Merge pull request #14758 from hpvb/optimize-lightbaker-rng
Use a more naive RNG for the lightmapper
2017-12-17 14:27:51 +01:00
Hein-Pieter van Braam
9ba134b463 Add several unlikely() macros
Based off of perf-based prediction misses these seem to be the
lowest-hanging fruit for quick (albeit small) improvements. These are
based on:

* baking a complex lightmap
* running platformer 3d
* running goltorus
2017-12-17 13:10:30 +01:00
Rémi Verschelde
32bc42690c
Merge pull request #14761 from fire/gdnative-lightmapper
Fix gdnative generation for lightmapper.
2017-12-17 11:12:21 +01:00
Hein-Pieter van Braam
a402efeb72 Tweak OpenMP parameters for lightbaker
On higher threadcount systems this allows for better utilization. On my
16 thread box CPU use goes from 10 - 11 threads to a steady 15 threads
on the Sponza scene.

Baking time goes from ~10:00 to ~07:30 for me. On lower threadcount
systems I expect some improvement also but likely a little less.
2017-12-17 03:09:38 +01:00
K. S. Ernest (iFire) Lee
9948da70a0 Fix gdnative generation for lightmapper. 2017-12-16 16:56:54 -08:00
Hein-Pieter van Braam
be4448bd1f Use a more naive RNG for the lightmapper
This speeds up the lightmapper by about 10% with no visible impact. A
comparison is up here:

https://tmm.cx/nextcloud/s/Log1eAXen1dJzBz

AMD Ryzen 7 1700 Eight-Core Processor
Sponza scene

pcg32
256/256/high   00:10:13
256/256/medium 00:02:50
256/256/low    00:01:11

xorshift
256/256/high   00:09:32
256/256/medium 00:02:34
256/256/low    00:01:05
2017-12-17 00:12:45 +01:00
Rémi Verschelde
1c18943e97
Merge pull request #14330 from matrem/particles_spread
Spread should be in degree (see documentation, and flag_disable_z case)
2017-12-16 14:28:25 +01:00
Rémi Verschelde
0f188461c5
Merge pull request #14365 from willnationsdev/camera-docs
[DOCS] Camera property changes
2017-12-16 14:23:44 +01:00
Rémi Verschelde
dcdf9008ae
Merge pull request #14676 from NathanWarden/nav_create_to_add
Renamed navmesh_create to navmesh_add since no navmesh is created.
2017-12-16 00:36:47 +01:00
matrem
641c6de160 particles spread/flatness fixes, pi factorization 2017-12-15 23:53:53 +01:00
Nathan Warden
38caa4126f Renamed navmesh/poly_create to navmesh/poly_add since no navmesh is created. 2017-12-15 15:09:06 -05:00
Andreas Haas
bca97e33ce
BakedLightmap: Update gizmo when setting extents.
Fixes #14696.
2017-12-15 20:39:45 +01:00
Michele Valente
dea5ba3991 fix for compiling the new lightmapper
also changed two calls that were ambiguous
2017-12-14 15:32:53 +01:00