Commit graph

13796 commits

Author SHA1 Message Date
Manuel Moos
d5abd4eb75 Add hysteresis to physics timestep count per frame
Add new class _TimerSync to manage timestep calculations.
The new class handles the decisions about simulation progression
previously handled by main::iteration(). It is fed the current timer
ticks and determines how many physics updates are to be run and what
the delta argument to the _process() functions should be.

The new class tries to keep the number of physics updates per frame as
constant as possible from frame to frame. Ideally, it would be N steps
every render frame, but even with perfectly regular rendering, the
general case is that N or N+1 steps are required per frame, for some
fixed N. The best guess for N is stored in typical_physics_steps.

When determining the number of steps to take, no restrictions are
imposed between the choice of typical_physics_steps and
typical_physics_steps+1 steps. Should more or less steps than that be
required, the accumulated remaining time (as before, stored in
time_accum) needs to surpass its boundaries by some minimal threshold.
Once surpassed, typical_physics_steps is updated to allow the new step
count for future updates.

Care is taken that the modified calculation of the number of physics
steps is not observable from game code that only checks the delta
parameters to the _process and _physics_process functions; in addition
to modifying the number of steps, the _process argument is modified as
well to stay in expected bounds. Extra care is taken that the accumulated
steps still sum up to roughly the real elapsed time, up to a maximum
tolerated difference.

To allow the hysteresis code to work correctly on higher refresh
monitors, the number of typical physics steps is not only recorded and
kept consistent for single render frames, but for groups of them.
Currently, up to 12 frames are grouped that way.

The engine parameter physics_jitter_fix controls both the maximum
tolerated difference between wall clock time and summed up _process
arguments and the threshold for changing typical_physics_steps. It is
given in units of the real physics frame slice 1/physics_fps. Set
physics_jitter_fix to 0 to disable the effects of the new code here.
It starts to be effective against the random physics jitter at around
0.02 to 0.05. at values greater than 1 it starts having ill effects on
the engine's ability to react sensibly to dropped frames and framerate
changes.
2018-04-09 22:27:29 +02:00
Rémi Verschelde
ca1312dbe9
Merge pull request #18083 from Noshyaar/tutorial
Add new transform tutorial to the appropriate classes
2018-04-09 22:15:38 +02:00
Rémi Verschelde
e15f2636ea
Merge pull request #18081 from AndreaCatania/arcle
Corrected area overlap cleaning
2018-04-09 22:04:25 +02:00
Rémi Verschelde
07e4556434
Merge pull request #18080 from Alexander-Alekseev/fix_rigidbody_config_warning
Fix of RigidBody's configuration warning for Z axis
2018-04-09 22:01:13 +02:00
Rémi Verschelde
ebeb493dc0
Merge pull request #18079 from Crazy-P/Resolves-Inccorect-Quaternion-Conversion
Resolves Incorrect Quaternion Conversion
2018-04-09 21:58:05 +02:00
Rémi Verschelde
62e5be8651
Merge pull request #18075 from guilhermefelipecgs/fix_3086
Fix custom cursor when it's hidden
2018-04-09 21:47:22 +02:00
Rémi Verschelde
24c2efc0f5
Merge pull request #16473 from ianb96/move_tab
Drag to Rearrange Editor Docks
2018-04-09 21:45:06 +02:00
Rémi Verschelde
93ae37f118
Merge pull request #18069 from mhilbrunner/docs-scenetree
[DOCS] SceneTree
2018-04-09 19:49:44 +02:00
Rémi Verschelde
9101a89510
Merge pull request #18054 from Mintormo/bugfix-inconsistent-sort-in-file-manager
Fixed bug #17929. Inconsistent sort in file manager.
2018-04-09 17:56:43 +02:00
Rémi Verschelde
36552c2c90
Merge pull request #18040 from Paulb23/color_region_cache
Fixed colour regions and added local colour region cache
2018-04-09 16:05:26 +02:00
Guilherme Felipe
62b835a2cd Fix custom cursor when it's hidden
[Linux] Ensures that the custom cursor will be used when changing to
MOUSE_MODE_VISIBLE. Fix #3086

[Windows] Fix cursor flickering when MOUSE_MODE_HIDDEN.

[Mac] Fix possible cursor flicker when MOUSE_MODE_HIDDEN.
2018-04-09 10:28:20 -03:00
Poommetee Ketson
e83af5dfc6 Add new transform tutorial to appropriate classes 2018-04-09 17:44:13 +07:00
Andrea Catania
45b778c7f8 Fixed area overlap cleaning 2018-04-09 09:33:29 +02:00
Ignacio Etcheverry
ea0e73f3c8
Merge pull request #17864 from NikodemL/fix_mono_bottom_panel_issue_activated
Fixed mono bottom panel to select the correct file when messages are filtered
2018-04-09 09:15:43 +02:00
Crazy-P
ae7a9df292 Resolves Inccorect Quaternion Conversion
Fixes https://github.com/godotengine/godot/issues/18025
2018-04-09 14:48:03 +08:00
Alexander Alekseev
6a5ed3a42b Fix RigidBody's configuration warning for Z axis 2018-04-09 09:28:31 +03:00
George Marques
0ee72fbd30
Merge pull request #18072 from AlexHolly/master
expose Tileset TileMode to GDScript
2018-04-08 21:44:07 -03:00
ianb96
9ac3c474b8 Drag to rearrange Tabs and TabContainer 2018-04-08 20:23:37 -04:00
Juan Linietsky
b67bfa3328
Merge pull request #16297 from lpn/master
Fixed wave file importer's broken resampling.
2018-04-08 18:41:46 -03:00
Max Hilbrunner
bc66869d4c [DOCS] SceneTree 2018-04-08 23:34:17 +02:00
Juan Linietsky
cef01f1f49
Merge pull request #16495 from Chaosus/is_point_in_triangle_fix
Fix is_point_in_triangle function
2018-04-08 18:18:19 -03:00
Juan Linietsky
b88a16c7ac
Merge pull request #16503 from Chaosus/particlesfix
Fix invalid particle movement when time_scale is zero
2018-04-08 18:15:32 -03:00
Alexander Holland
f18b74838c expose Tileset TileMode to GDScript 2018-04-08 22:54:02 +02:00
Juan Linietsky
34e367597d
Merge pull request #16556 from aragar/master
For-in loop variable added to autocompletion
2018-04-08 17:25:01 -03:00
Juan Linietsky
3a08f1748b
Merge pull request #16571 from Zylann/find_in_files
Added find & replace in files
2018-04-08 17:24:26 -03:00
Juan Linietsky
b756172bdb
Merge pull request #16705 from Chaosus/generate_normals_flip
Add flip switch to SurfaceTool.generate_normals
2018-04-08 17:18:03 -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
24cf58f917
Merge pull request #16574 from isaacremnant/better_grow_direction
Added GROW_DIRECTION_BOTH for controls
2018-04-08 16:42:16 -03:00
Juan Linietsky
59cdc5eb9d
Merge pull request #16898 from Lerc/master
add Image::bumpmap_to_normalmap conversion function
2018-04-08 15:52:05 -03:00
Poommetee Ketson
9acc199bf8
Merge pull request #18061 from Chaosus/fixbug
Fix crash when click on any inspector entry that takes Resource
2018-04-09 00:23:42 +07:00
Chaosus
56a6d90f36 Fix #18058 regression 2018-04-08 20:01:38 +03:00
Juan Linietsky
2f4f8de459
Merge pull request #16995 from mrcdk/custom_resources_inspector
The inspector will show the custom resources added via plugin
2018-04-08 11:49:34 -03:00
Juan Linietsky
2ba01613a3
Merge pull request #17123 from Jason0214/BugFix_UpdataFavoriteListWhenMoveOrRenameDir
Editor: update favortite_dirs after move or rename a file in filesytem_dock
2018-04-08 11:36:55 -03:00
Juan Linietsky
a6c9ccf007
Merge pull request #17150 from robfram/check-animation-playing-backwards
Added `get_playing_speed` method to AnimationPlayer, returning the actual playing speed of the animation being played
2018-04-08 11:36:15 -03:00
Juan Linietsky
20e68fef85
Merge pull request #17151 from ShyRed/disabled_shapes_2d
Remove disabled shapes from physics 2D calculations
2018-04-08 11:16:55 -03:00
Juan Linietsky
e9e5aa617e
Merge pull request #17227 from Faless/multiplayer_api
[RFC] MultiplayerAPI refactor
2018-04-08 11:04:16 -03:00
Juan Linietsky
1faea81e15
Merge pull request #17232 from playster000/master
enhance mipmaps, non power of 2 textures
2018-04-08 10:49:13 -03:00
Juan Linietsky
4ee3f3251d
Merge pull request #17382 from bojidar-bg/13971-path-array-unsaved
Duplicate Arrays and Dictionaries when instancing scene in editor
2018-04-08 09:39:03 -03:00
Juan Linietsky
8a5fb669ae
Merge pull request #17421 from Chaosus/fixshaderbugs
Fix few bugs in shader definitions
2018-04-08 09:33:12 -03:00
Juan Linietsky
6eb0c74e9d
Merge pull request #17443 from Noshyaar/tilesetcrash
Fix converting to tileset crashes Godot if existing file is not tileset
2018-04-08 09:31:54 -03:00
Juan Linietsky
10448063c4
Merge pull request #17594 from ivodopiviz/float-overflow
Changed debug max distance to avoid overflow
2018-04-08 09:14:29 -03:00
Juan Linietsky
47ffe107e6
Merge pull request #17967 from Nibodhika/all-device-mode
Allows to map an action to all devices.
2018-04-08 09:04:14 -03:00
Juan Linietsky
8a84f9df0d
Merge pull request #17741 from Essojadojef/fix-shortcut-categories
Fix all categories unfold when one key binding is changed
2018-04-08 09:02:44 -03:00
Mintormo
41a3929d25 Fixed bug #17929. Inconsistent sort in file manager.
This commit fix a bug #17929
(https://github.com/godotengine/godot/issues/17929)
in file manager. I'm just added sorting of files list
in method FileSystemDock::_update_files.
2018-04-08 13:18:01 +03:00
Juan Linietsky
9e7cee2ceb Removed strange custom world2d in CanvasLayer, been there since always and not sure why.
Fixes #17524, fixes #17523.
2018-04-07 19:43:09 -03:00
Nibodhika
1e28f63bcf Allows to map an action to all devices.
This is accomplished by setting a special value (-1) to the device variable
in the InputEvent that's being used to compare with the one received from the OS.

This special value is invalid for a regular input, so it should be safe.
Implements #17942
2018-04-07 20:08:09 +00:00
Juan Linietsky
cd7e9d9642
Merge pull request #17583 from RandomShaper/enhance-uri-utils
Enhance uri utils
2018-04-07 17:07:29 -03:00
Juan Linietsky
61d70fe47c Document condition to avoid mistakes (like #17690) 2018-04-07 17:04:12 -03:00
Juan Linietsky
14340efa3c
Merge pull request #17602 from ivodopiviz/tscn-issues
Removed unnecessary newlines from tscn
2018-04-07 16:59:12 -03:00
Juan Linietsky
5a1a90c3db
Merge pull request #17636 from rainerdeyke/fix_issue_17585
Fixes moving files causes scene corruption
2018-04-07 16:56:02 -03:00