You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Physics interpolation - Move out of Scenario
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios. Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
This commit is contained in:
@@ -507,13 +507,7 @@ void SceneTree::set_physics_interpolation_enabled(bool p_enabled) {
|
||||
}
|
||||
|
||||
_physics_interpolation_enabled = p_enabled;
|
||||
|
||||
if (root->get_world().is_valid()) {
|
||||
RID scenario = root->get_world()->get_scenario();
|
||||
if (scenario.is_valid()) {
|
||||
VisualServer::get_singleton()->scenario_set_physics_interpolation_enabled(scenario, p_enabled);
|
||||
}
|
||||
}
|
||||
VisualServer::get_singleton()->set_physics_interpolation_enabled(p_enabled);
|
||||
}
|
||||
|
||||
bool SceneTree::is_physics_interpolation_enabled() const {
|
||||
@@ -535,11 +529,8 @@ bool SceneTree::iteration(float p_time) {
|
||||
|
||||
current_frame++;
|
||||
|
||||
if (root->get_world().is_valid()) {
|
||||
RID scenario = root->get_world()->get_scenario();
|
||||
if (scenario.is_valid()) {
|
||||
VisualServer::get_singleton()->scenario_tick(scenario);
|
||||
}
|
||||
if (_physics_interpolation_enabled) {
|
||||
VisualServer::get_singleton()->tick();
|
||||
}
|
||||
|
||||
// Any objects performing client physics interpolation
|
||||
@@ -686,11 +677,8 @@ bool SceneTree::idle(float p_time) {
|
||||
|
||||
#endif
|
||||
|
||||
if (root->get_world().is_valid()) {
|
||||
RID scenario = root->get_world()->get_scenario();
|
||||
if (scenario.is_valid()) {
|
||||
VisualServer::get_singleton()->scenario_pre_draw(scenario, true);
|
||||
}
|
||||
if (_physics_interpolation_enabled) {
|
||||
VisualServer::get_singleton()->pre_draw(true);
|
||||
}
|
||||
|
||||
return _quit;
|
||||
|
||||
Reference in New Issue
Block a user