Renamed fixed_process to physics_process
This commit is contained in:
parent
4f39ce32b9
commit
4537977d6d
|
@ -2557,8 +2557,8 @@ Dictionary _Engine::get_version_info() const {
|
||||||
return Engine::get_singleton()->get_version_info();
|
return Engine::get_singleton()->get_version_info();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _Engine::is_in_fixed_frame() const {
|
bool _Engine::is_in_physics_frame() const {
|
||||||
return Engine::get_singleton()->is_in_fixed_frame();
|
return Engine::get_singleton()->is_in_physics_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _Engine::set_editor_hint(bool p_enabled) {
|
void _Engine::set_editor_hint(bool p_enabled) {
|
||||||
|
@ -2588,7 +2588,7 @@ void _Engine::_bind_methods() {
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_version_info"), &_Engine::get_version_info);
|
ClassDB::bind_method(D_METHOD("get_version_info"), &_Engine::get_version_info);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("is_in_fixed_frame"), &_Engine::is_in_fixed_frame);
|
ClassDB::bind_method(D_METHOD("is_in_physics_frame"), &_Engine::is_in_physics_frame);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_editor_hint", "enabled"), &_Engine::set_editor_hint);
|
ClassDB::bind_method(D_METHOD("set_editor_hint", "enabled"), &_Engine::set_editor_hint);
|
||||||
ClassDB::bind_method(D_METHOD("is_editor_hint"), &_Engine::is_editor_hint);
|
ClassDB::bind_method(D_METHOD("is_editor_hint"), &_Engine::is_editor_hint);
|
||||||
|
|
|
@ -661,7 +661,7 @@ public:
|
||||||
|
|
||||||
Dictionary get_version_info() const;
|
Dictionary get_version_info() const;
|
||||||
|
|
||||||
bool is_in_fixed_frame() const;
|
bool is_in_physics_frame() const;
|
||||||
|
|
||||||
void set_editor_hint(bool p_enabled);
|
void set_editor_hint(bool p_enabled);
|
||||||
bool is_editor_hint() const;
|
bool is_editor_hint() const;
|
||||||
|
|
|
@ -116,9 +116,9 @@ Engine::Engine() {
|
||||||
_target_fps = 0;
|
_target_fps = 0;
|
||||||
_time_scale = 1.0;
|
_time_scale = 1.0;
|
||||||
_pixel_snap = false;
|
_pixel_snap = false;
|
||||||
_fixed_frames = 0;
|
_physics_frames = 0;
|
||||||
_idle_frames = 0;
|
_idle_frames = 0;
|
||||||
_in_fixed = false;
|
_in_physics = false;
|
||||||
_frame_ticks = 0;
|
_frame_ticks = 0;
|
||||||
_frame_step = 0;
|
_frame_step = 0;
|
||||||
editor_hint = false;
|
editor_hint = false;
|
||||||
|
|
|
@ -49,10 +49,10 @@ class Engine {
|
||||||
int _target_fps;
|
int _target_fps;
|
||||||
float _time_scale;
|
float _time_scale;
|
||||||
bool _pixel_snap;
|
bool _pixel_snap;
|
||||||
uint64_t _fixed_frames;
|
uint64_t _physics_frames;
|
||||||
|
|
||||||
uint64_t _idle_frames;
|
uint64_t _idle_frames;
|
||||||
bool _in_fixed;
|
bool _in_physics;
|
||||||
|
|
||||||
bool editor_hint;
|
bool editor_hint;
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ public:
|
||||||
|
|
||||||
uint64_t get_frames_drawn();
|
uint64_t get_frames_drawn();
|
||||||
|
|
||||||
uint64_t get_fixed_frames() const { return _fixed_frames; }
|
uint64_t get_physics_frames() const { return _physics_frames; }
|
||||||
uint64_t get_idle_frames() const { return _idle_frames; }
|
uint64_t get_idle_frames() const { return _idle_frames; }
|
||||||
bool is_in_fixed_frame() const { return _in_fixed; }
|
bool is_in_physics_frame() const { return _in_physics; }
|
||||||
uint64_t get_idle_frame_ticks() const { return _frame_ticks; }
|
uint64_t get_idle_frame_ticks() const { return _frame_ticks; }
|
||||||
float get_idle_frame_step() const { return _frame_step; }
|
float get_idle_frame_step() const { return _frame_step; }
|
||||||
|
|
||||||
|
|
|
@ -186,12 +186,12 @@ struct _ScriptDebuggerLocalProfileInfoSort {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ScriptDebuggerLocal::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time) {
|
void ScriptDebuggerLocal::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) {
|
||||||
|
|
||||||
frame_time = p_frame_time;
|
frame_time = p_frame_time;
|
||||||
idle_time = p_idle_time;
|
idle_time = p_idle_time;
|
||||||
fixed_time = p_fixed_time;
|
physics_time = p_physics_time;
|
||||||
fixed_frame_time = p_fixed_frame_time;
|
physics_frame_time = p_physics_frame_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptDebuggerLocal::idle_poll() {
|
void ScriptDebuggerLocal::idle_poll() {
|
||||||
|
@ -250,9 +250,9 @@ void ScriptDebuggerLocal::profiling_start() {
|
||||||
profiling = true;
|
profiling = true;
|
||||||
pinfo.resize(32768);
|
pinfo.resize(32768);
|
||||||
frame_time = 0;
|
frame_time = 0;
|
||||||
fixed_time = 0;
|
physics_time = 0;
|
||||||
idle_time = 0;
|
idle_time = 0;
|
||||||
fixed_frame_time = 0;
|
physics_frame_time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptDebuggerLocal::profiling_end() {
|
void ScriptDebuggerLocal::profiling_end() {
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
class ScriptDebuggerLocal : public ScriptDebugger {
|
class ScriptDebuggerLocal : public ScriptDebugger {
|
||||||
|
|
||||||
bool profiling;
|
bool profiling;
|
||||||
float frame_time, idle_time, fixed_time, fixed_frame_time;
|
float frame_time, idle_time, physics_time, physics_frame_time;
|
||||||
uint64_t idle_accum;
|
uint64_t idle_accum;
|
||||||
|
|
||||||
Vector<ScriptLanguage::ProfilingInfo> pinfo;
|
Vector<ScriptLanguage::ProfilingInfo> pinfo;
|
||||||
|
@ -51,7 +51,7 @@ public:
|
||||||
|
|
||||||
virtual void profiling_start();
|
virtual void profiling_start();
|
||||||
virtual void profiling_end();
|
virtual void profiling_end();
|
||||||
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time);
|
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time);
|
||||||
|
|
||||||
ScriptDebuggerLocal();
|
ScriptDebuggerLocal();
|
||||||
};
|
};
|
||||||
|
|
|
@ -647,8 +647,8 @@ void ScriptDebuggerRemote::_poll_events() {
|
||||||
profiling = true;
|
profiling = true;
|
||||||
frame_time = 0;
|
frame_time = 0;
|
||||||
idle_time = 0;
|
idle_time = 0;
|
||||||
fixed_time = 0;
|
physics_time = 0;
|
||||||
fixed_frame_time = 0;
|
physics_frame_time = 0;
|
||||||
|
|
||||||
print_line("PROFILING ALRIGHT!");
|
print_line("PROFILING ALRIGHT!");
|
||||||
|
|
||||||
|
@ -727,8 +727,8 @@ void ScriptDebuggerRemote::_send_profiling_data(bool p_for_frame) {
|
||||||
packet_peer_stream->put_var(Engine::get_singleton()->get_frames_drawn()); //total frame time
|
packet_peer_stream->put_var(Engine::get_singleton()->get_frames_drawn()); //total frame time
|
||||||
packet_peer_stream->put_var(frame_time); //total frame time
|
packet_peer_stream->put_var(frame_time); //total frame time
|
||||||
packet_peer_stream->put_var(idle_time); //idle frame time
|
packet_peer_stream->put_var(idle_time); //idle frame time
|
||||||
packet_peer_stream->put_var(fixed_time); //fixed frame time
|
packet_peer_stream->put_var(physics_time); //fixed frame time
|
||||||
packet_peer_stream->put_var(fixed_frame_time); //fixed frame time
|
packet_peer_stream->put_var(physics_frame_time); //fixed frame time
|
||||||
|
|
||||||
packet_peer_stream->put_var(USEC_TO_SEC(total_script_time)); //total script execution time
|
packet_peer_stream->put_var(USEC_TO_SEC(total_script_time)); //total script execution time
|
||||||
|
|
||||||
|
@ -917,12 +917,12 @@ void ScriptDebuggerRemote::profiling_end() {
|
||||||
//ignores this, uses it via connnection
|
//ignores this, uses it via connnection
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time) {
|
void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) {
|
||||||
|
|
||||||
frame_time = p_frame_time;
|
frame_time = p_frame_time;
|
||||||
idle_time = p_idle_time;
|
idle_time = p_idle_time;
|
||||||
fixed_time = p_fixed_time;
|
physics_time = p_physics_time;
|
||||||
fixed_frame_time = p_fixed_frame_time;
|
physics_frame_time = p_physics_frame_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
|
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ScriptDebuggerRemote : public ScriptDebugger {
|
||||||
Vector<ScriptLanguage::ProfilingInfo *> profile_info_ptrs;
|
Vector<ScriptLanguage::ProfilingInfo *> profile_info_ptrs;
|
||||||
|
|
||||||
Map<StringName, int> profiler_function_signature_map;
|
Map<StringName, int> profiler_function_signature_map;
|
||||||
float frame_time, idle_time, fixed_time, fixed_frame_time;
|
float frame_time, idle_time, physics_time, physics_frame_time;
|
||||||
|
|
||||||
bool profiling;
|
bool profiling;
|
||||||
int max_frame_functions;
|
int max_frame_functions;
|
||||||
|
@ -161,7 +161,7 @@ public:
|
||||||
|
|
||||||
virtual void profiling_start();
|
virtual void profiling_start();
|
||||||
virtual void profiling_end();
|
virtual void profiling_end();
|
||||||
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time);
|
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time);
|
||||||
|
|
||||||
ScriptDebuggerRemote();
|
ScriptDebuggerRemote();
|
||||||
~ScriptDebuggerRemote();
|
~ScriptDebuggerRemote();
|
||||||
|
|
|
@ -397,7 +397,7 @@ public:
|
||||||
virtual void add_profiling_frame_data(const StringName &p_name, const Array &p_data) = 0;
|
virtual void add_profiling_frame_data(const StringName &p_name, const Array &p_data) = 0;
|
||||||
virtual void profiling_start() = 0;
|
virtual void profiling_start() = 0;
|
||||||
virtual void profiling_end() = 0;
|
virtual void profiling_end() = 0;
|
||||||
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time) = 0;
|
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) = 0;
|
||||||
|
|
||||||
ScriptDebugger();
|
ScriptDebugger();
|
||||||
virtual ~ScriptDebugger() { singleton = NULL; }
|
virtual ~ScriptDebugger() { singleton = NULL; }
|
||||||
|
|
|
@ -89,7 +89,7 @@ void EditorProfiler::clear() {
|
||||||
variables->clear();
|
variables->clear();
|
||||||
//activate->set_pressed(false);
|
//activate->set_pressed(false);
|
||||||
plot_sigs.clear();
|
plot_sigs.clear();
|
||||||
plot_sigs.insert("fixed_frame_time");
|
plot_sigs.insert("physics_frame_time");
|
||||||
plot_sigs.insert("category_frame_time");
|
plot_sigs.insert("category_frame_time");
|
||||||
|
|
||||||
updating_frame = true;
|
updating_frame = true;
|
||||||
|
@ -120,9 +120,9 @@ String EditorProfiler::_get_time_as_text(Metric &m, float p_time, int p_calls) {
|
||||||
return rtos(p_time / p_calls);
|
return rtos(p_time / p_calls);
|
||||||
} else if (dmode == DISPLAY_FRAME_PERCENT) {
|
} else if (dmode == DISPLAY_FRAME_PERCENT) {
|
||||||
return _get_percent_txt(p_time, m.frame_time);
|
return _get_percent_txt(p_time, m.frame_time);
|
||||||
} else if (dmode == DISPLAY_FIXED_FRAME_PERCENT) {
|
} else if (dmode == DISPLAY_PHYSICS_FRAME_PERCENT) {
|
||||||
|
|
||||||
return _get_percent_txt(p_time, m.fixed_frame_time);
|
return _get_percent_txt(p_time, m.physics_frame_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "err";
|
return "err";
|
||||||
|
@ -714,7 +714,7 @@ EditorProfiler::EditorProfiler() {
|
||||||
add_child(plot_delay);
|
add_child(plot_delay);
|
||||||
plot_delay->connect("timeout", this, "_update_plot");
|
plot_delay->connect("timeout", this, "_update_plot");
|
||||||
|
|
||||||
plot_sigs.insert("fixed_frame_time");
|
plot_sigs.insert("physics_frame_time");
|
||||||
plot_sigs.insert("category_frame_time");
|
plot_sigs.insert("category_frame_time");
|
||||||
|
|
||||||
seeking = false;
|
seeking = false;
|
||||||
|
|
|
@ -51,8 +51,8 @@ public:
|
||||||
int frame_number;
|
int frame_number;
|
||||||
float frame_time;
|
float frame_time;
|
||||||
float idle_time;
|
float idle_time;
|
||||||
float fixed_time;
|
float physics_time;
|
||||||
float fixed_frame_time;
|
float physics_frame_time;
|
||||||
|
|
||||||
struct Category {
|
struct Category {
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public:
|
||||||
DISPLAY_FRAME_TIME,
|
DISPLAY_FRAME_TIME,
|
||||||
DISPLAY_AVERAGE_TIME,
|
DISPLAY_AVERAGE_TIME,
|
||||||
DISPLAY_FRAME_PERCENT,
|
DISPLAY_FRAME_PERCENT,
|
||||||
DISPLAY_FIXED_FRAME_PERCENT,
|
DISPLAY_PHYSICS_FRAME_PERCENT,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DisplayTime {
|
enum DisplayTime {
|
||||||
|
|
|
@ -1419,13 +1419,13 @@ void AnimationTreeEditorPlugin::make_visible(bool p_visible) {
|
||||||
//editor->animation_panel_make_visible(true);
|
//editor->animation_panel_make_visible(true);
|
||||||
button->show();
|
button->show();
|
||||||
editor->make_bottom_panel_item_visible(anim_tree_editor);
|
editor->make_bottom_panel_item_visible(anim_tree_editor);
|
||||||
anim_tree_editor->set_fixed_process(true);
|
anim_tree_editor->set_physics_process(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (anim_tree_editor->is_visible_in_tree())
|
if (anim_tree_editor->is_visible_in_tree())
|
||||||
editor->hide_bottom_panel();
|
editor->hide_bottom_panel();
|
||||||
button->hide();
|
button->hide();
|
||||||
anim_tree_editor->set_fixed_process(false);
|
anim_tree_editor->set_physics_process(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2708,7 +2708,7 @@ void CanvasItemEditor::_draw_viewport() {
|
||||||
|
|
||||||
void CanvasItemEditor::_notification(int p_what) {
|
void CanvasItemEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
|
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
|
||||||
|
|
||||||
|
@ -4032,14 +4032,14 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) {
|
||||||
|
|
||||||
if (p_visible) {
|
if (p_visible) {
|
||||||
canvas_item_editor->show();
|
canvas_item_editor->show();
|
||||||
canvas_item_editor->set_fixed_process(true);
|
canvas_item_editor->set_physics_process(true);
|
||||||
VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
|
VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
|
||||||
canvas_item_editor->viewport_base->grab_focus();
|
canvas_item_editor->viewport_base->grab_focus();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
canvas_item_editor->hide();
|
canvas_item_editor->hide();
|
||||||
canvas_item_editor->set_fixed_process(false);
|
canvas_item_editor->set_physics_process(false);
|
||||||
VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
|
VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ void CollisionPolygon2DEditor::_notification(int p_what) {
|
||||||
get_tree()->connect("node_removed", this, "_node_removed");
|
get_tree()->connect("node_removed", this, "_node_removed");
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ void LightOccluder2DEditor::_notification(int p_what) {
|
||||||
create_poly->connect("confirmed", this, "_create_poly");
|
create_poly->connect("confirmed", this, "_create_poly");
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ void MaterialEditor::_gui_input(InputEvent p_event) {
|
||||||
|
|
||||||
void MaterialEditor::_notification(int p_what) {
|
void MaterialEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what==NOTIFICATION_FIXED_PROCESS) {
|
if (p_what==NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ void MeshEditor::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
void MeshEditor::_notification(int p_what) {
|
void MeshEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_READY) {
|
if (p_what == NOTIFICATION_READY) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ void NavigationPolygonEditor::_notification(int p_what) {
|
||||||
create_nav->connect("confirmed", this, "_create_nav");
|
create_nav->connect("confirmed", this, "_create_nav");
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ void Path2DEditor::_notification(int p_what) {
|
||||||
//button_edit->set_pressed(true);
|
//button_edit->set_pressed(true);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ void Polygon2DEditor::_notification(int p_what) {
|
||||||
get_tree()->connect("node_removed", this, "_node_removed");
|
get_tree()->connect("node_removed", this, "_node_removed");
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
void ResourcePreloaderEditor::_notification(int p_what) {
|
void ResourcePreloaderEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
|
@ -248,7 +248,7 @@ void ResourcePreloaderEditor::edit(ResourcePreloader *p_preloader) {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1850,7 +1850,7 @@ void SpatialEditorViewport::_notification(int p_what) {
|
||||||
last_message = message;
|
last_message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
message_time -= get_fixed_process_delta_time();
|
message_time -= get_physics_process_delta_time();
|
||||||
if (message_time < 0)
|
if (message_time < 0)
|
||||||
surface->update();
|
surface->update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ void SpriteFramesEditor::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
void SpriteFramesEditor::_notification(int p_what) {
|
void SpriteFramesEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||||
|
@ -535,7 +535,7 @@ void SpriteFramesEditor::edit(SpriteFrames *p_frames) {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
//set_fixed_process(false);
|
//set_physics_process(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ void TextureEditor::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
void TextureEditor::_notification(int p_what) {
|
void TextureEditor::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_READY) {
|
if (p_what == NOTIFICATION_READY) {
|
||||||
|
|
|
@ -2585,10 +2585,10 @@ void PropertyEditor::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
if (refresh_countdown > 0) {
|
if (refresh_countdown > 0) {
|
||||||
refresh_countdown -= get_fixed_process_delta_time();
|
refresh_countdown -= get_physics_process_delta_time();
|
||||||
if (refresh_countdown <= 0) {
|
if (refresh_countdown <= 0) {
|
||||||
TreeItem *root = tree->get_root();
|
TreeItem *root = tree->get_root();
|
||||||
_refresh_item(root);
|
_refresh_item(root);
|
||||||
|
@ -4227,7 +4227,7 @@ PropertyEditor::PropertyEditor() {
|
||||||
|
|
||||||
tree->set_drag_forwarding(this);
|
tree->set_drag_forwarding(this);
|
||||||
|
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
|
|
||||||
custom_editor = memnew(CustomPropertyEditor);
|
custom_editor = memnew(CustomPropertyEditor);
|
||||||
add_child(custom_editor);
|
add_child(custom_editor);
|
||||||
|
|
|
@ -649,8 +649,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
||||||
metric.frame_number = p_data[0];
|
metric.frame_number = p_data[0];
|
||||||
metric.frame_time = p_data[1];
|
metric.frame_time = p_data[1];
|
||||||
metric.idle_time = p_data[2];
|
metric.idle_time = p_data[2];
|
||||||
metric.fixed_time = p_data[3];
|
metric.physics_time = p_data[3];
|
||||||
metric.fixed_frame_time = p_data[4];
|
metric.physics_frame_time = p_data[4];
|
||||||
int frame_data_amount = p_data[6];
|
int frame_data_amount = p_data[6];
|
||||||
int frame_function_amount = p_data[7];
|
int frame_function_amount = p_data[7];
|
||||||
|
|
||||||
|
@ -664,9 +664,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
||||||
item.calls = 1;
|
item.calls = 1;
|
||||||
item.line = 0;
|
item.line = 0;
|
||||||
item.name = "Fixed Time";
|
item.name = "Fixed Time";
|
||||||
item.total = metric.fixed_time;
|
item.total = metric.physics_time;
|
||||||
item.self = item.total;
|
item.self = item.total;
|
||||||
item.signature = "fixed_time";
|
item.signature = "physics_time";
|
||||||
|
|
||||||
frame_time.items.push_back(item);
|
frame_time.items.push_back(item);
|
||||||
|
|
||||||
|
@ -678,9 +678,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
||||||
frame_time.items.push_back(item);
|
frame_time.items.push_back(item);
|
||||||
|
|
||||||
item.name = "Fixed Frame Time";
|
item.name = "Fixed Frame Time";
|
||||||
item.total = metric.fixed_frame_time;
|
item.total = metric.physics_frame_time;
|
||||||
item.self = item.total;
|
item.self = item.total;
|
||||||
item.signature = "fixed_frame_time";
|
item.signature = "physics_frame_time";
|
||||||
|
|
||||||
frame_time.items.push_back(item);
|
frame_time.items.push_back(item);
|
||||||
|
|
||||||
|
|
|
@ -105,8 +105,8 @@ bool InputDefault::is_action_just_pressed(const StringName &p_action) const {
|
||||||
if (!E)
|
if (!E)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Engine::get_singleton()->is_in_fixed_frame()) {
|
if (Engine::get_singleton()->is_in_physics_frame()) {
|
||||||
return E->get().pressed && E->get().fixed_frame == Engine::get_singleton()->get_fixed_frames();
|
return E->get().pressed && E->get().physics_frame == Engine::get_singleton()->get_physics_frames();
|
||||||
} else {
|
} else {
|
||||||
return E->get().pressed && E->get().idle_frame == Engine::get_singleton()->get_idle_frames();
|
return E->get().pressed && E->get().idle_frame == Engine::get_singleton()->get_idle_frames();
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,8 @@ bool InputDefault::is_action_just_released(const StringName &p_action) const {
|
||||||
if (!E)
|
if (!E)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Engine::get_singleton()->is_in_fixed_frame()) {
|
if (Engine::get_singleton()->is_in_physics_frame()) {
|
||||||
return !E->get().pressed && E->get().fixed_frame == Engine::get_singleton()->get_fixed_frames();
|
return !E->get().pressed && E->get().physics_frame == Engine::get_singleton()->get_physics_frames();
|
||||||
} else {
|
} else {
|
||||||
return !E->get().pressed && E->get().idle_frame == Engine::get_singleton()->get_idle_frames();
|
return !E->get().pressed && E->get().idle_frame == Engine::get_singleton()->get_idle_frames();
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
|
||||||
|
|
||||||
if (InputMap::get_singleton()->event_is_action(p_event, E->key()) && is_action_pressed(E->key()) != p_event->is_pressed()) {
|
if (InputMap::get_singleton()->event_is_action(p_event, E->key()) && is_action_pressed(E->key()) != p_event->is_pressed()) {
|
||||||
Action action;
|
Action action;
|
||||||
action.fixed_frame = Engine::get_singleton()->get_fixed_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = p_event->is_pressed();
|
action.pressed = p_event->is_pressed();
|
||||||
action_state[E->key()] = action;
|
action_state[E->key()] = action;
|
||||||
|
@ -460,7 +460,7 @@ void InputDefault::action_press(const StringName &p_action) {
|
||||||
|
|
||||||
Action action;
|
Action action;
|
||||||
|
|
||||||
action.fixed_frame = Engine::get_singleton()->get_fixed_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = true;
|
action.pressed = true;
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ void InputDefault::action_release(const StringName &p_action) {
|
||||||
|
|
||||||
Action action;
|
Action action;
|
||||||
|
|
||||||
action.fixed_frame = Engine::get_singleton()->get_fixed_frames();
|
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||||
action.pressed = false;
|
action.pressed = false;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class InputDefault : public Input {
|
||||||
MainLoop *main_loop;
|
MainLoop *main_loop;
|
||||||
|
|
||||||
struct Action {
|
struct Action {
|
||||||
uint64_t fixed_frame;
|
uint64_t physics_frame;
|
||||||
uint64_t idle_frame;
|
uint64_t idle_frame;
|
||||||
bool pressed;
|
bool pressed;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1574,7 +1574,7 @@ uint32_t Main::frame = 0;
|
||||||
bool Main::force_redraw_requested = false;
|
bool Main::force_redraw_requested = false;
|
||||||
|
|
||||||
//for performance metrics
|
//for performance metrics
|
||||||
static uint64_t fixed_process_max = 0;
|
static uint64_t physics_process_max = 0;
|
||||||
static uint64_t idle_process_max = 0;
|
static uint64_t idle_process_max = 0;
|
||||||
|
|
||||||
bool Main::iteration() {
|
bool Main::iteration() {
|
||||||
|
@ -1597,7 +1597,7 @@ bool Main::iteration() {
|
||||||
return false;
|
return false;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint64_t fixed_process_ticks = 0;
|
uint64_t physics_process_ticks = 0;
|
||||||
uint64_t idle_process_ticks = 0;
|
uint64_t idle_process_ticks = 0;
|
||||||
|
|
||||||
frame += ticks_elapsed;
|
frame += ticks_elapsed;
|
||||||
|
@ -1615,7 +1615,7 @@ bool Main::iteration() {
|
||||||
|
|
||||||
int iters = 0;
|
int iters = 0;
|
||||||
|
|
||||||
Engine::get_singleton()->_in_fixed = true;
|
Engine::get_singleton()->_in_physics = true;
|
||||||
|
|
||||||
while (time_accum > frame_slice) {
|
while (time_accum > frame_slice) {
|
||||||
|
|
||||||
|
@ -1642,13 +1642,13 @@ bool Main::iteration() {
|
||||||
time_accum -= frame_slice;
|
time_accum -= frame_slice;
|
||||||
message_queue->flush();
|
message_queue->flush();
|
||||||
|
|
||||||
fixed_process_ticks = MAX(fixed_process_ticks, OS::get_singleton()->get_ticks_usec() - fixed_begin); // keep the largest one for reference
|
physics_process_ticks = MAX(physics_process_ticks, OS::get_singleton()->get_ticks_usec() - fixed_begin); // keep the largest one for reference
|
||||||
fixed_process_max = MAX(OS::get_singleton()->get_ticks_usec() - fixed_begin, fixed_process_max);
|
physics_process_max = MAX(OS::get_singleton()->get_ticks_usec() - fixed_begin, physics_process_max);
|
||||||
iters++;
|
iters++;
|
||||||
Engine::get_singleton()->_fixed_frames++;
|
Engine::get_singleton()->_physics_frames++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Engine::get_singleton()->_in_fixed = false;
|
Engine::get_singleton()->_in_physics = false;
|
||||||
|
|
||||||
uint64_t idle_begin = OS::get_singleton()->get_ticks_usec();
|
uint64_t idle_begin = OS::get_singleton()->get_ticks_usec();
|
||||||
|
|
||||||
|
@ -1684,7 +1684,7 @@ bool Main::iteration() {
|
||||||
|
|
||||||
if (script_debugger) {
|
if (script_debugger) {
|
||||||
if (script_debugger->is_profiling()) {
|
if (script_debugger->is_profiling()) {
|
||||||
script_debugger->profiling_set_frame_times(USEC_TO_SEC(frame_time), USEC_TO_SEC(idle_process_ticks), USEC_TO_SEC(fixed_process_ticks), frame_slice);
|
script_debugger->profiling_set_frame_times(USEC_TO_SEC(frame_time), USEC_TO_SEC(idle_process_ticks), USEC_TO_SEC(physics_process_ticks), frame_slice);
|
||||||
}
|
}
|
||||||
script_debugger->idle_poll();
|
script_debugger->idle_poll();
|
||||||
}
|
}
|
||||||
|
@ -1700,9 +1700,9 @@ bool Main::iteration() {
|
||||||
|
|
||||||
Engine::get_singleton()->_fps = frames;
|
Engine::get_singleton()->_fps = frames;
|
||||||
performance->set_process_time(USEC_TO_SEC(idle_process_max));
|
performance->set_process_time(USEC_TO_SEC(idle_process_max));
|
||||||
performance->set_fixed_process_time(USEC_TO_SEC(fixed_process_max));
|
performance->set_physics_process_time(USEC_TO_SEC(physics_process_max));
|
||||||
idle_process_max = 0;
|
idle_process_max = 0;
|
||||||
fixed_process_max = 0;
|
physics_process_max = 0;
|
||||||
|
|
||||||
frame %= 1000000;
|
frame %= 1000000;
|
||||||
frames = 0;
|
frames = 0;
|
||||||
|
|
|
@ -42,7 +42,7 @@ void Performance::_bind_methods() {
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(TIME_FPS);
|
BIND_ENUM_CONSTANT(TIME_FPS);
|
||||||
BIND_ENUM_CONSTANT(TIME_PROCESS);
|
BIND_ENUM_CONSTANT(TIME_PROCESS);
|
||||||
BIND_ENUM_CONSTANT(TIME_FIXED_PROCESS);
|
BIND_ENUM_CONSTANT(TIME_PHYSICS_PROCESS);
|
||||||
BIND_ENUM_CONSTANT(MEMORY_STATIC);
|
BIND_ENUM_CONSTANT(MEMORY_STATIC);
|
||||||
BIND_ENUM_CONSTANT(MEMORY_DYNAMIC);
|
BIND_ENUM_CONSTANT(MEMORY_DYNAMIC);
|
||||||
BIND_ENUM_CONSTANT(MEMORY_STATIC_MAX);
|
BIND_ENUM_CONSTANT(MEMORY_STATIC_MAX);
|
||||||
|
@ -78,7 +78,7 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
|
||||||
|
|
||||||
"time/fps",
|
"time/fps",
|
||||||
"time/process",
|
"time/process",
|
||||||
"time/fixed_process",
|
"time/physics_process",
|
||||||
"memory/static",
|
"memory/static",
|
||||||
"memory/dynamic",
|
"memory/dynamic",
|
||||||
"memory/static_max",
|
"memory/static_max",
|
||||||
|
@ -114,7 +114,7 @@ float Performance::get_monitor(Monitor p_monitor) const {
|
||||||
switch (p_monitor) {
|
switch (p_monitor) {
|
||||||
case TIME_FPS: return Engine::get_singleton()->get_frames_per_second();
|
case TIME_FPS: return Engine::get_singleton()->get_frames_per_second();
|
||||||
case TIME_PROCESS: return _process_time;
|
case TIME_PROCESS: return _process_time;
|
||||||
case TIME_FIXED_PROCESS: return _fixed_process_time;
|
case TIME_PHYSICS_PROCESS: return _physics_process_time;
|
||||||
case MEMORY_STATIC: return Memory::get_mem_usage();
|
case MEMORY_STATIC: return Memory::get_mem_usage();
|
||||||
case MEMORY_DYNAMIC: return MemoryPool::total_memory;
|
case MEMORY_DYNAMIC: return MemoryPool::total_memory;
|
||||||
case MEMORY_STATIC_MAX: return Memory::get_mem_max_usage();
|
case MEMORY_STATIC_MAX: return Memory::get_mem_max_usage();
|
||||||
|
@ -158,14 +158,14 @@ void Performance::set_process_time(float p_pt) {
|
||||||
_process_time = p_pt;
|
_process_time = p_pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Performance::set_fixed_process_time(float p_pt) {
|
void Performance::set_physics_process_time(float p_pt) {
|
||||||
|
|
||||||
_fixed_process_time = p_pt;
|
_physics_process_time = p_pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
Performance::Performance() {
|
Performance::Performance() {
|
||||||
|
|
||||||
_process_time = 0;
|
_process_time = 0;
|
||||||
_fixed_process_time = 0;
|
_physics_process_time = 0;
|
||||||
singleton = this;
|
singleton = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,14 @@ class Performance : public Object {
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
float _process_time;
|
float _process_time;
|
||||||
float _fixed_process_time;
|
float _physics_process_time;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Monitor {
|
enum Monitor {
|
||||||
|
|
||||||
TIME_FPS,
|
TIME_FPS,
|
||||||
TIME_PROCESS,
|
TIME_PROCESS,
|
||||||
TIME_FIXED_PROCESS,
|
TIME_PHYSICS_PROCESS,
|
||||||
MEMORY_STATIC,
|
MEMORY_STATIC,
|
||||||
MEMORY_DYNAMIC,
|
MEMORY_DYNAMIC,
|
||||||
MEMORY_STATIC_MAX,
|
MEMORY_STATIC_MAX,
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
String get_monitor_name(Monitor p_monitor) const;
|
String get_monitor_name(Monitor p_monitor) const;
|
||||||
|
|
||||||
void set_process_time(float p_pt);
|
void set_process_time(float p_pt);
|
||||||
void set_fixed_process_time(float p_pt);
|
void set_physics_process_time(float p_pt);
|
||||||
|
|
||||||
static Performance *get_singleton() { return singleton; }
|
static Performance *get_singleton() { return singleton; }
|
||||||
|
|
||||||
|
|
|
@ -2008,8 +2008,8 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o
|
||||||
Node *node = Object::cast_to<Node>(p_owner);
|
Node *node = Object::cast_to<Node>(p_owner);
|
||||||
if (p_script->functions.has("_process"))
|
if (p_script->functions.has("_process"))
|
||||||
node->set_process(true);
|
node->set_process(true);
|
||||||
if (p_script->functions.has("_fixed_process"))
|
if (p_script->functions.has("_physics_process"))
|
||||||
node->set_fixed_process(true);
|
node->set_physics_process(true);
|
||||||
if (p_script->functions.has("_input"))
|
if (p_script->functions.has("_input"))
|
||||||
node->set_process_input(true);
|
node->set_process_input(true);
|
||||||
if (p_script->functions.has("_unhandled_input"))
|
if (p_script->functions.has("_unhandled_input"))
|
||||||
|
|
|
@ -82,7 +82,7 @@ String VisualScriptYield::get_text() const {
|
||||||
switch (yield_mode) {
|
switch (yield_mode) {
|
||||||
case YIELD_RETURN: return ""; break;
|
case YIELD_RETURN: return ""; break;
|
||||||
case YIELD_FRAME: return "Next Frame"; break;
|
case YIELD_FRAME: return "Next Frame"; break;
|
||||||
case YIELD_FIXED_FRAME: return "Next Fixed Frame"; break;
|
case YIELD_PHYSICS_FRAME: return "Next Fixed Frame"; break;
|
||||||
case YIELD_WAIT: return rtos(wait_time) + " sec(s)"; break;
|
case YIELD_WAIT: return rtos(wait_time) + " sec(s)"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public:
|
||||||
ret = STEP_EXIT_FUNCTION_BIT;
|
ret = STEP_EXIT_FUNCTION_BIT;
|
||||||
break; //return the yield
|
break; //return the yield
|
||||||
case VisualScriptYield::YIELD_FRAME: state->connect_to_signal(tree, "idle_frame", Array()); break;
|
case VisualScriptYield::YIELD_FRAME: state->connect_to_signal(tree, "idle_frame", Array()); break;
|
||||||
case VisualScriptYield::YIELD_FIXED_FRAME: state->connect_to_signal(tree, "fixed_frame", Array()); break;
|
case VisualScriptYield::YIELD_PHYSICS_FRAME: state->connect_to_signal(tree, "physics_frame", Array()); break;
|
||||||
case VisualScriptYield::YIELD_WAIT: state->connect_to_signal(tree->create_timer(wait_time).ptr(), "timeout", Array()); break;
|
case VisualScriptYield::YIELD_WAIT: state->connect_to_signal(tree->create_timer(wait_time).ptr(), "timeout", Array()); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ void VisualScriptYield::_bind_methods() {
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time");
|
ADD_PROPERTY(PropertyInfo(Variant::REAL, "wait_time"), "set_wait_time", "get_wait_time");
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(YIELD_FRAME);
|
BIND_ENUM_CONSTANT(YIELD_FRAME);
|
||||||
BIND_ENUM_CONSTANT(YIELD_FIXED_FRAME);
|
BIND_ENUM_CONSTANT(YIELD_PHYSICS_FRAME);
|
||||||
BIND_ENUM_CONSTANT(YIELD_WAIT);
|
BIND_ENUM_CONSTANT(YIELD_WAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ static Ref<VisualScriptNode> create_yield_signal_node(const String &p_name) {
|
||||||
void register_visual_script_yield_nodes() {
|
void register_visual_script_yield_nodes() {
|
||||||
|
|
||||||
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_frame", create_yield_node<VisualScriptYield::YIELD_FRAME>);
|
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_frame", create_yield_node<VisualScriptYield::YIELD_FRAME>);
|
||||||
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_fixed_frame", create_yield_node<VisualScriptYield::YIELD_FIXED_FRAME>);
|
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_physics_frame", create_yield_node<VisualScriptYield::YIELD_PHYSICS_FRAME>);
|
||||||
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_time", create_yield_node<VisualScriptYield::YIELD_WAIT>);
|
VisualScriptLanguage::singleton->add_register_func("functions/wait/wait_time", create_yield_node<VisualScriptYield::YIELD_WAIT>);
|
||||||
|
|
||||||
VisualScriptLanguage::singleton->add_register_func("functions/yield", create_yield_node<VisualScriptYield::YIELD_RETURN>);
|
VisualScriptLanguage::singleton->add_register_func("functions/yield", create_yield_node<VisualScriptYield::YIELD_RETURN>);
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
enum YieldMode {
|
enum YieldMode {
|
||||||
YIELD_RETURN,
|
YIELD_RETURN,
|
||||||
YIELD_FRAME,
|
YIELD_FRAME,
|
||||||
YIELD_FIXED_FRAME,
|
YIELD_PHYSICS_FRAME,
|
||||||
YIELD_WAIT
|
YIELD_WAIT
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -113,7 +113,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
|
||||||
AudioServer::get_singleton()->remove_callback(_mix_audios, this);
|
AudioServer::get_singleton()->remove_callback(_mix_audios, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_INTERNAL_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
//update anything related to position first, if possible of course
|
//update anything related to position first, if possible of course
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
|
||||||
|
|
||||||
//stop playing if no longer active
|
//stop playing if no longer active
|
||||||
if (!active) {
|
if (!active) {
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
//do not update, this makes it easier to animate (will shut off otherise)
|
//do not update, this makes it easier to animate (will shut off otherise)
|
||||||
//_change_notify("playing"); //update property in editor
|
//_change_notify("playing"); //update property in editor
|
||||||
emit_signal("finished");
|
emit_signal("finished");
|
||||||
|
@ -255,7 +255,7 @@ void AudioStreamPlayer2D::play(float p_from_pos) {
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
setplay = p_from_pos;
|
setplay = p_from_pos;
|
||||||
output_ready = false;
|
output_ready = false;
|
||||||
set_fixed_process_internal(true);
|
set_physics_process_internal(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ void AudioStreamPlayer2D::stop() {
|
||||||
|
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
active = false;
|
active = false;
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
setplay = -1;
|
setplay = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ Transform2D Camera2D::get_camera_transform() {
|
||||||
|
|
||||||
if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) {
|
if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
|
||||||
float c = smoothing * get_fixed_process_delta_time();
|
float c = smoothing * get_physics_process_delta_time();
|
||||||
smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos;
|
smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos;
|
||||||
ret_camera_pos = smoothed_camera_pos;
|
ret_camera_pos = smoothed_camera_pos;
|
||||||
//camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing;
|
//camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing;
|
||||||
|
@ -212,14 +212,14 @@ void Camera2D::_notification(int p_what) {
|
||||||
|
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
|
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
_update_scroll();
|
_update_scroll();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||||
|
|
||||||
if (!is_fixed_processing())
|
if (!is_physics_processing())
|
||||||
_update_scroll();
|
_update_scroll();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
@ -241,7 +241,7 @@ void Camera2D::_notification(int p_what) {
|
||||||
add_to_group(canvas_group_name);
|
add_to_group(canvas_group_name);
|
||||||
|
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_update_scroll();
|
_update_scroll();
|
||||||
|
@ -498,9 +498,9 @@ void Camera2D::set_follow_smoothing(float p_speed) {
|
||||||
|
|
||||||
smoothing = p_speed;
|
smoothing = p_speed;
|
||||||
if (smoothing > 0 && !(is_inside_tree() && Engine::get_singleton()->is_editor_hint()))
|
if (smoothing > 0 && !(is_inside_tree() && Engine::get_singleton()->is_editor_hint()))
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
else
|
else
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Camera2D::get_follow_smoothing() const {
|
float Camera2D::get_follow_smoothing() const {
|
||||||
|
|
|
@ -999,7 +999,7 @@ bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, Collision &r_col
|
||||||
|
|
||||||
Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_slides, float p_floor_max_angle) {
|
Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_slides, float p_floor_max_angle) {
|
||||||
|
|
||||||
Vector2 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time();
|
Vector2 motion = (floor_velocity + p_linear_velocity) * get_physics_process_delta_time();
|
||||||
Vector2 lv = p_linear_velocity;
|
Vector2 lv = p_linear_velocity;
|
||||||
|
|
||||||
on_floor = false;
|
on_floor = false;
|
||||||
|
|
|
@ -95,7 +95,7 @@ void RayCast2D::set_enabled(bool p_enabled) {
|
||||||
|
|
||||||
enabled = p_enabled;
|
enabled = p_enabled;
|
||||||
if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint())
|
if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint())
|
||||||
set_fixed_process(p_enabled);
|
set_physics_process(p_enabled);
|
||||||
if (!p_enabled)
|
if (!p_enabled)
|
||||||
collided = false;
|
collided = false;
|
||||||
}
|
}
|
||||||
|
@ -135,9 +135,9 @@ void RayCast2D::_notification(int p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
|
||||||
if (enabled && !Engine::get_singleton()->is_editor_hint())
|
if (enabled && !Engine::get_singleton()->is_editor_hint())
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
else
|
else
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
|
|
||||||
if (Object::cast_to<PhysicsBody2D>(get_parent())) {
|
if (Object::cast_to<PhysicsBody2D>(get_parent())) {
|
||||||
if (exclude_parent_body)
|
if (exclude_parent_body)
|
||||||
|
@ -149,7 +149,7 @@ void RayCast2D::_notification(int p_what) {
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ void RayCast2D::_notification(int p_what) {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -154,8 +154,8 @@ void VisibilityEnabler2D::_screen_enter() {
|
||||||
_change_node_state(E->key(), true);
|
_change_node_state(E->key(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent())
|
||||||
get_parent()->set_fixed_process(true);
|
get_parent()->set_physics_process(true);
|
||||||
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
||||||
get_parent()->set_process(true);
|
get_parent()->set_process(true);
|
||||||
|
|
||||||
|
@ -169,8 +169,8 @@ void VisibilityEnabler2D::_screen_exit() {
|
||||||
_change_node_state(E->key(), false);
|
_change_node_state(E->key(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent())
|
||||||
get_parent()->set_fixed_process(false);
|
get_parent()->set_physics_process(false);
|
||||||
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
||||||
get_parent()->set_process(false);
|
get_parent()->set_process(false);
|
||||||
|
|
||||||
|
@ -246,8 +246,8 @@ void VisibilityEnabler2D::_notification(int p_what) {
|
||||||
|
|
||||||
_find_nodes(from);
|
_find_nodes(from);
|
||||||
|
|
||||||
if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent())
|
||||||
get_parent()->set_fixed_process(false);
|
get_parent()->set_physics_process(false);
|
||||||
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
if (enabler[ENABLER_PARENT_PROCESS] && get_parent())
|
||||||
get_parent()->set_process(false);
|
get_parent()->set_process(false);
|
||||||
}
|
}
|
||||||
|
@ -339,14 +339,14 @@ void VisibilityEnabler2D::_bind_methods() {
|
||||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_particles"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_PARTICLES);
|
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_particles"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_PARTICLES);
|
||||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_animated_sprites"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_ANIMATED_SPRITES);
|
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_animated_sprites"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_ANIMATED_SPRITES);
|
||||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "process_parent"), "set_enabler", "is_enabler_enabled", ENABLER_PARENT_PROCESS);
|
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "process_parent"), "set_enabler", "is_enabler_enabled", ENABLER_PARENT_PROCESS);
|
||||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "fixed_process_parent"), "set_enabler", "is_enabler_enabled", ENABLER_PARENT_FIXED_PROCESS);
|
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "physics_process_parent"), "set_enabler", "is_enabler_enabled", ENABLER_PARENT_PHYSICS_PROCESS);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(ENABLER_FREEZE_BODIES);
|
BIND_ENUM_CONSTANT(ENABLER_FREEZE_BODIES);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATIONS);
|
BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATIONS);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_PAUSE_PARTICLES);
|
BIND_ENUM_CONSTANT(ENABLER_PAUSE_PARTICLES);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATED_SPRITES);
|
BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATED_SPRITES);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_PARENT_PROCESS);
|
BIND_ENUM_CONSTANT(ENABLER_PARENT_PROCESS);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_PARENT_FIXED_PROCESS);
|
BIND_ENUM_CONSTANT(ENABLER_PARENT_PHYSICS_PROCESS);
|
||||||
BIND_ENUM_CONSTANT(ENABLER_MAX);
|
BIND_ENUM_CONSTANT(ENABLER_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ VisibilityEnabler2D::VisibilityEnabler2D() {
|
||||||
for (int i = 0; i < ENABLER_MAX; i++)
|
for (int i = 0; i < ENABLER_MAX; i++)
|
||||||
enabler[i] = true;
|
enabler[i] = true;
|
||||||
enabler[ENABLER_PARENT_PROCESS] = false;
|
enabler[ENABLER_PARENT_PROCESS] = false;
|
||||||
enabler[ENABLER_PARENT_FIXED_PROCESS] = false;
|
enabler[ENABLER_PARENT_PHYSICS_PROCESS] = false;
|
||||||
|
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public:
|
||||||
ENABLER_FREEZE_BODIES,
|
ENABLER_FREEZE_BODIES,
|
||||||
ENABLER_PAUSE_PARTICLES,
|
ENABLER_PAUSE_PARTICLES,
|
||||||
ENABLER_PARENT_PROCESS,
|
ENABLER_PARENT_PROCESS,
|
||||||
ENABLER_PARENT_FIXED_PROCESS,
|
ENABLER_PARENT_PHYSICS_PROCESS,
|
||||||
ENABLER_PAUSE_ANIMATED_SPRITES,
|
ENABLER_PAUSE_ANIMATED_SPRITES,
|
||||||
ENABLER_MAX
|
ENABLER_MAX
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,7 +214,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_INTERNAL_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
//update anything related to position first, if possible of course
|
//update anything related to position first, if possible of course
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
|
||||||
|
|
||||||
//stop playing if no longer active
|
//stop playing if no longer active
|
||||||
if (!active) {
|
if (!active) {
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
//do not update, this makes it easier to animate (will shut off otherise)
|
//do not update, this makes it easier to animate (will shut off otherise)
|
||||||
//_change_notify("playing"); //update property in editor
|
//_change_notify("playing"); //update property in editor
|
||||||
emit_signal("finished");
|
emit_signal("finished");
|
||||||
|
@ -582,7 +582,7 @@ void AudioStreamPlayer3D::play(float p_from_pos) {
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
setplay = p_from_pos;
|
setplay = p_from_pos;
|
||||||
output_ready = false;
|
output_ready = false;
|
||||||
set_fixed_process_internal(true);
|
set_physics_process_internal(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ void AudioStreamPlayer3D::stop() {
|
||||||
|
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
active = false;
|
active = false;
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
setplay = -1;
|
setplay = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) {
|
||||||
|
|
||||||
if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
|
if (doppler_tracking != DOPPLER_TRACKING_DISABLED) {
|
||||||
set_notify_transform(true);
|
set_notify_transform(true);
|
||||||
velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP);
|
velocity_tracker->set_track_physics_step(doppler_tracking == DOPPLER_TRACKING_PHYSICS_STEP);
|
||||||
velocity_tracker->reset(get_global_transform().origin);
|
velocity_tracker->reset(get_global_transform().origin);
|
||||||
} else {
|
} else {
|
||||||
set_notify_transform(false);
|
set_notify_transform(false);
|
||||||
|
@ -880,7 +880,7 @@ void AudioStreamPlayer3D::_bind_methods() {
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED);
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED);
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_IDLE_STEP);
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_IDLE_STEP);
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_FIXED_STEP);
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_PHYSICS_STEP);
|
||||||
|
|
||||||
ADD_SIGNAL(MethodInfo("finished"));
|
ADD_SIGNAL(MethodInfo("finished"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
enum DopplerTracking {
|
enum DopplerTracking {
|
||||||
DOPPLER_TRACKING_DISABLED,
|
DOPPLER_TRACKING_DISABLED,
|
||||||
DOPPLER_TRACKING_IDLE_STEP,
|
DOPPLER_TRACKING_IDLE_STEP,
|
||||||
DOPPLER_TRACKING_FIXED_STEP
|
DOPPLER_TRACKING_PHYSICS_STEP
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -507,7 +507,7 @@ void Camera::set_doppler_tracking(DopplerTracking p_tracking) {
|
||||||
|
|
||||||
doppler_tracking = p_tracking;
|
doppler_tracking = p_tracking;
|
||||||
if (p_tracking != DOPPLER_TRACKING_DISABLED) {
|
if (p_tracking != DOPPLER_TRACKING_DISABLED) {
|
||||||
velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP);
|
velocity_tracker->set_track_physics_step(doppler_tracking == DOPPLER_TRACKING_PHYSICS_STEP);
|
||||||
velocity_tracker->reset(get_global_transform().origin);
|
velocity_tracker->reset(get_global_transform().origin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ void Camera::_bind_methods() {
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED)
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED)
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_IDLE_STEP)
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_IDLE_STEP)
|
||||||
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_FIXED_STEP)
|
BIND_ENUM_CONSTANT(DOPPLER_TRACKING_PHYSICS_STEP)
|
||||||
}
|
}
|
||||||
|
|
||||||
float Camera::get_fov() const {
|
float Camera::get_fov() const {
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
enum DopplerTracking {
|
enum DopplerTracking {
|
||||||
DOPPLER_TRACKING_DISABLED,
|
DOPPLER_TRACKING_DISABLED,
|
||||||
DOPPLER_TRACKING_IDLE_STEP,
|
DOPPLER_TRACKING_IDLE_STEP,
|
||||||
DOPPLER_TRACKING_FIXED_STEP
|
DOPPLER_TRACKING_PHYSICS_STEP
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -37,7 +37,7 @@ void InterpolatedCamera::_notification(int p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
|
||||||
if (Engine::get_singleton()->is_editor_hint() && enabled)
|
if (Engine::get_singleton()->is_editor_hint() && enabled)
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_PROCESS: {
|
case NOTIFICATION_PROCESS: {
|
||||||
|
|
|
@ -960,7 +960,7 @@ bool KinematicBody::move_and_collide(const Vector3 &p_motion, Collision &r_colli
|
||||||
|
|
||||||
Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_slides, float p_floor_max_angle) {
|
Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_slides, float p_floor_max_angle) {
|
||||||
|
|
||||||
Vector3 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time();
|
Vector3 motion = (floor_velocity + p_linear_velocity) * get_physics_process_delta_time();
|
||||||
Vector3 lv = p_linear_velocity;
|
Vector3 lv = p_linear_velocity;
|
||||||
|
|
||||||
on_floor = false;
|
on_floor = false;
|
||||||
|
|
|
@ -97,7 +97,7 @@ void RayCast::set_enabled(bool p_enabled) {
|
||||||
|
|
||||||
enabled = p_enabled;
|
enabled = p_enabled;
|
||||||
if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint())
|
if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint())
|
||||||
set_fixed_process(p_enabled);
|
set_physics_process(p_enabled);
|
||||||
if (!p_enabled)
|
if (!p_enabled)
|
||||||
collided = false;
|
collided = false;
|
||||||
|
|
||||||
|
@ -121,25 +121,25 @@ void RayCast::_notification(int p_what) {
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
|
||||||
if (enabled && !Engine::get_singleton()->is_editor_hint()) {
|
if (enabled && !Engine::get_singleton()->is_editor_hint()) {
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
|
|
||||||
if (get_tree()->is_debugging_collisions_hint())
|
if (get_tree()->is_debugging_collisions_hint())
|
||||||
_update_debug_shape();
|
_update_debug_shape();
|
||||||
} else
|
} else
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug_shape)
|
if (debug_shape)
|
||||||
_clear_debug_shape();
|
_clear_debug_shape();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
#include "spatial_velocity_tracker.h"
|
#include "spatial_velocity_tracker.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
void SpatialVelocityTracker::set_track_fixed_step(bool p_track_fixed_step) {
|
void SpatialVelocityTracker::set_track_physics_step(bool p_track_physics_step) {
|
||||||
|
|
||||||
fixed_step = p_track_fixed_step;
|
physics_step = p_track_physics_step;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpatialVelocityTracker::is_tracking_fixed_step() const {
|
bool SpatialVelocityTracker::is_tracking_physics_step() const {
|
||||||
|
|
||||||
return fixed_step;
|
return physics_step;
|
||||||
}
|
}
|
||||||
void SpatialVelocityTracker::update_position(const Vector3 &p_position) {
|
void SpatialVelocityTracker::update_position(const Vector3 &p_position) {
|
||||||
|
|
||||||
PositionHistory ph;
|
PositionHistory ph;
|
||||||
ph.position = p_position;
|
ph.position = p_position;
|
||||||
if (fixed_step) {
|
if (physics_step) {
|
||||||
ph.frame = Engine::get_singleton()->get_fixed_frames();
|
ph.frame = Engine::get_singleton()->get_physics_frames();
|
||||||
} else {
|
} else {
|
||||||
ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
|
ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ Vector3 SpatialVelocityTracker::get_tracked_linear_velocity() const {
|
||||||
float base_time = 0.0;
|
float base_time = 0.0;
|
||||||
|
|
||||||
if (position_history_len) {
|
if (position_history_len) {
|
||||||
if (fixed_step) {
|
if (physics_step) {
|
||||||
uint64_t base = Engine::get_singleton()->get_fixed_frames();
|
uint64_t base = Engine::get_singleton()->get_physics_frames();
|
||||||
base_time = float(base - position_history[0].frame) / Engine::get_singleton()->get_iterations_per_second();
|
base_time = float(base - position_history[0].frame) / Engine::get_singleton()->get_iterations_per_second();
|
||||||
} else {
|
} else {
|
||||||
uint64_t base = Engine::get_singleton()->get_idle_frame_ticks();
|
uint64_t base = Engine::get_singleton()->get_idle_frame_ticks();
|
||||||
|
@ -54,7 +54,7 @@ Vector3 SpatialVelocityTracker::get_tracked_linear_velocity() const {
|
||||||
uint64_t diff = position_history[i].frame - position_history[i + 1].frame;
|
uint64_t diff = position_history[i].frame - position_history[i + 1].frame;
|
||||||
Vector3 distance = position_history[i].position - position_history[i + 1].position;
|
Vector3 distance = position_history[i].position - position_history[i + 1].position;
|
||||||
|
|
||||||
if (fixed_step) {
|
if (physics_step) {
|
||||||
delta = float(diff) / Engine::get_singleton()->get_iterations_per_second();
|
delta = float(diff) / Engine::get_singleton()->get_iterations_per_second();
|
||||||
} else {
|
} else {
|
||||||
delta = double(diff) / 1000000.0;
|
delta = double(diff) / 1000000.0;
|
||||||
|
@ -78,8 +78,8 @@ void SpatialVelocityTracker::reset(const Vector3 &p_new_pos) {
|
||||||
|
|
||||||
PositionHistory ph;
|
PositionHistory ph;
|
||||||
ph.position = p_new_pos;
|
ph.position = p_new_pos;
|
||||||
if (fixed_step) {
|
if (physics_step) {
|
||||||
ph.frame = Engine::get_singleton()->get_fixed_frames();
|
ph.frame = Engine::get_singleton()->get_physics_frames();
|
||||||
} else {
|
} else {
|
||||||
ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
|
ph.frame = Engine::get_singleton()->get_idle_frame_ticks();
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,8 @@ void SpatialVelocityTracker::reset(const Vector3 &p_new_pos) {
|
||||||
|
|
||||||
void SpatialVelocityTracker::_bind_methods() {
|
void SpatialVelocityTracker::_bind_methods() {
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_track_fixed_step", "enable"), &SpatialVelocityTracker::set_track_fixed_step);
|
ClassDB::bind_method(D_METHOD("set_track_physics_step", "enable"), &SpatialVelocityTracker::set_track_physics_step);
|
||||||
ClassDB::bind_method(D_METHOD("is_tracking_fixed_step"), &SpatialVelocityTracker::is_tracking_fixed_step);
|
ClassDB::bind_method(D_METHOD("is_tracking_physics_step"), &SpatialVelocityTracker::is_tracking_physics_step);
|
||||||
ClassDB::bind_method(D_METHOD("update_position", "position"), &SpatialVelocityTracker::update_position);
|
ClassDB::bind_method(D_METHOD("update_position", "position"), &SpatialVelocityTracker::update_position);
|
||||||
ClassDB::bind_method(D_METHOD("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity);
|
ClassDB::bind_method(D_METHOD("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity);
|
||||||
ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset);
|
ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset);
|
||||||
|
@ -100,5 +100,5 @@ void SpatialVelocityTracker::_bind_methods() {
|
||||||
SpatialVelocityTracker::SpatialVelocityTracker() {
|
SpatialVelocityTracker::SpatialVelocityTracker() {
|
||||||
position_history.resize(4); // should be configurable
|
position_history.resize(4); // should be configurable
|
||||||
position_history_len = 0;
|
position_history_len = 0;
|
||||||
fixed_step = false;
|
physics_step = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ class SpatialVelocityTracker : public Reference {
|
||||||
Vector3 position;
|
Vector3 position;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool fixed_step;
|
bool physics_step;
|
||||||
Vector<PositionHistory> position_history;
|
Vector<PositionHistory> position_history;
|
||||||
int position_history_len;
|
int position_history_len;
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void reset(const Vector3 &p_new_pos);
|
void reset(const Vector3 &p_new_pos);
|
||||||
void set_track_fixed_step(bool p_track_fixed_step);
|
void set_track_physics_step(bool p_track_physics_step);
|
||||||
bool is_tracking_fixed_step() const;
|
bool is_tracking_physics_step() const;
|
||||||
void update_position(const Vector3 &p_position);
|
void update_position(const Vector3 &p_position);
|
||||||
Vector3 get_tracked_linear_velocity() const;
|
Vector3 get_tracked_linear_velocity() const;
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ void AnimationPlayer::_notification(int p_what) {
|
||||||
if (!processing) {
|
if (!processing) {
|
||||||
//make sure that a previous process state was not saved
|
//make sure that a previous process state was not saved
|
||||||
//only process if "processing" is set
|
//only process if "processing" is set
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
set_process(false);
|
set_process(false);
|
||||||
}
|
}
|
||||||
//_set_process(false);
|
//_set_process(false);
|
||||||
|
@ -207,19 +207,19 @@ void AnimationPlayer::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||||
if (animation_process_mode == ANIMATION_PROCESS_FIXED)
|
if (animation_process_mode == ANIMATION_PROCESS_PHYSICS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_animation_process(get_process_delta_time());
|
_animation_process(get_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
|
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (animation_process_mode == ANIMATION_PROCESS_IDLE)
|
if (animation_process_mode == ANIMATION_PROCESS_IDLE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_animation_process(get_fixed_process_delta_time());
|
_animation_process(get_physics_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|
||||||
|
@ -1140,7 +1140,7 @@ void AnimationPlayer::_set_process(bool p_process, bool p_force) {
|
||||||
|
|
||||||
switch (animation_process_mode) {
|
switch (animation_process_mode) {
|
||||||
|
|
||||||
case ANIMATION_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break;
|
case ANIMATION_PROCESS_PHYSICS: set_physics_process_internal(p_process && active); break;
|
||||||
case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1262,7 +1262,7 @@ void AnimationPlayer::_bind_methods() {
|
||||||
ADD_SIGNAL(MethodInfo("animation_changed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name")));
|
ADD_SIGNAL(MethodInfo("animation_changed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name")));
|
||||||
ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING, "name")));
|
ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING, "name")));
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_FIXED);
|
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS);
|
||||||
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
|
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class AnimationPlayer : public Node {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum AnimationProcessMode {
|
enum AnimationProcessMode {
|
||||||
ANIMATION_PROCESS_FIXED,
|
ANIMATION_PROCESS_PHYSICS,
|
||||||
ANIMATION_PROCESS_IDLE,
|
ANIMATION_PROCESS_IDLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void AnimationTreePlayer::_set_process(bool p_process, bool p_force) {
|
||||||
|
|
||||||
switch (animation_process_mode) {
|
switch (animation_process_mode) {
|
||||||
|
|
||||||
case ANIMATION_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break;
|
case ANIMATION_PROCESS_PHYSICS: set_physics_process_internal(p_process && active); break;
|
||||||
case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ void AnimationTreePlayer::_notification(int p_what) {
|
||||||
if (!processing) {
|
if (!processing) {
|
||||||
//make sure that a previous process state was not saved
|
//make sure that a previous process state was not saved
|
||||||
//only process if "processing" is set
|
//only process if "processing" is set
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
set_process_internal(false);
|
set_process_internal(false);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -416,19 +416,19 @@ void AnimationTreePlayer::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||||
if (animation_process_mode == ANIMATION_PROCESS_FIXED)
|
if (animation_process_mode == ANIMATION_PROCESS_PHYSICS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_process_animation(get_process_delta_time());
|
_process_animation(get_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
|
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (animation_process_mode == ANIMATION_PROCESS_IDLE)
|
if (animation_process_mode == ANIMATION_PROCESS_IDLE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_process_animation(get_fixed_process_delta_time());
|
_process_animation(get_physics_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1809,7 +1809,7 @@ void AnimationTreePlayer::_bind_methods() {
|
||||||
BIND_ENUM_CONSTANT(NODE_TIMESEEK);
|
BIND_ENUM_CONSTANT(NODE_TIMESEEK);
|
||||||
BIND_ENUM_CONSTANT(NODE_TRANSITION);
|
BIND_ENUM_CONSTANT(NODE_TRANSITION);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_FIXED);
|
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS);
|
||||||
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
|
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class AnimationTreePlayer : public Node {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum AnimationProcessMode {
|
enum AnimationProcessMode {
|
||||||
ANIMATION_PROCESS_FIXED,
|
ANIMATION_PROCESS_PHYSICS,
|
||||||
ANIMATION_PROCESS_IDLE,
|
ANIMATION_PROCESS_IDLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ void Tween::_notification(int p_what) {
|
||||||
if (!processing) {
|
if (!processing) {
|
||||||
//make sure that a previous process state was not saved
|
//make sure that a previous process state was not saved
|
||||||
//only process if "processing" is set
|
//only process if "processing" is set
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
set_process_internal(false);
|
set_process_internal(false);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -160,19 +160,19 @@ void Tween::_notification(int p_what) {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||||
if (tween_process_mode == TWEEN_PROCESS_FIXED)
|
if (tween_process_mode == TWEEN_PROCESS_PHYSICS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_tween_process(get_process_delta_time());
|
_tween_process(get_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
|
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (tween_process_mode == TWEEN_PROCESS_IDLE)
|
if (tween_process_mode == TWEEN_PROCESS_IDLE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (processing)
|
if (processing)
|
||||||
_tween_process(get_fixed_process_delta_time());
|
_tween_process(get_physics_process_delta_time());
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ void Tween::_bind_methods() {
|
||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_tween_process_mode", "get_tween_process_mode");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_tween_process_mode", "get_tween_process_mode");
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(TWEEN_PROCESS_FIXED);
|
BIND_ENUM_CONSTANT(TWEEN_PROCESS_PHYSICS);
|
||||||
BIND_ENUM_CONSTANT(TWEEN_PROCESS_IDLE);
|
BIND_ENUM_CONSTANT(TWEEN_PROCESS_IDLE);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(TRANS_LINEAR);
|
BIND_ENUM_CONSTANT(TRANS_LINEAR);
|
||||||
|
@ -642,7 +642,7 @@ void Tween::_set_process(bool p_process, bool p_force) {
|
||||||
|
|
||||||
switch (tween_process_mode) {
|
switch (tween_process_mode) {
|
||||||
|
|
||||||
case TWEEN_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break;
|
case TWEEN_PROCESS_PHYSICS: set_physics_process_internal(p_process && active); break;
|
||||||
case TWEEN_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
case TWEEN_PROCESS_IDLE: set_process_internal(p_process && active); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Tween : public Node {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TweenProcessMode {
|
enum TweenProcessMode {
|
||||||
TWEEN_PROCESS_FIXED,
|
TWEEN_PROCESS_PHYSICS,
|
||||||
TWEEN_PROCESS_IDLE,
|
TWEEN_PROCESS_IDLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
if (smooth_scroll_enabled) {
|
if (smooth_scroll_enabled) {
|
||||||
scrolling = true;
|
scrolling = true;
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
} else {
|
} else {
|
||||||
set_value(target_scroll);
|
set_value(target_scroll);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
|
||||||
|
|
||||||
if (smooth_scroll_enabled) {
|
if (smooth_scroll_enabled) {
|
||||||
scrolling = true;
|
scrolling = true;
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
} else {
|
} else {
|
||||||
set_value(target_scroll);
|
set_value(target_scroll);
|
||||||
}
|
}
|
||||||
|
@ -335,13 +335,13 @@ void ScrollBar::_notification(int p_what) {
|
||||||
drag_slave = NULL;
|
drag_slave = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
if (scrolling) {
|
if (scrolling) {
|
||||||
if (get_value() != target_scroll) {
|
if (get_value() != target_scroll) {
|
||||||
double target = target_scroll - get_value();
|
double target = target_scroll - get_value();
|
||||||
double dist = sqrt(target * target);
|
double dist = sqrt(target * target);
|
||||||
double vel = ((target / dist) * 500) * get_fixed_process_delta_time();
|
double vel = ((target / dist) * 500) * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (Math::abs(vel) >= dist) {
|
if (Math::abs(vel) >= dist) {
|
||||||
set_value(target_scroll);
|
set_value(target_scroll);
|
||||||
|
@ -350,14 +350,14 @@ void ScrollBar::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scrolling = false;
|
scrolling = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
} else if (drag_slave_touching) {
|
} else if (drag_slave_touching) {
|
||||||
|
|
||||||
if (drag_slave_touching_deaccel) {
|
if (drag_slave_touching_deaccel) {
|
||||||
|
|
||||||
Vector2 pos = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
|
Vector2 pos = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
|
||||||
pos += drag_slave_speed * get_fixed_process_delta_time();
|
pos += drag_slave_speed * get_physics_process_delta_time();
|
||||||
|
|
||||||
bool turnoff = false;
|
bool turnoff = false;
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ void ScrollBar::_notification(int p_what) {
|
||||||
|
|
||||||
float sgn_x = drag_slave_speed.x < 0 ? -1 : 1;
|
float sgn_x = drag_slave_speed.x < 0 ? -1 : 1;
|
||||||
float val_x = Math::abs(drag_slave_speed.x);
|
float val_x = Math::abs(drag_slave_speed.x);
|
||||||
val_x -= 1000 * get_fixed_process_delta_time();
|
val_x -= 1000 * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (val_x < 0) {
|
if (val_x < 0) {
|
||||||
turnoff = true;
|
turnoff = true;
|
||||||
|
@ -401,7 +401,7 @@ void ScrollBar::_notification(int p_what) {
|
||||||
|
|
||||||
float sgn_y = drag_slave_speed.y < 0 ? -1 : 1;
|
float sgn_y = drag_slave_speed.y < 0 ? -1 : 1;
|
||||||
float val_y = Math::abs(drag_slave_speed.y);
|
float val_y = Math::abs(drag_slave_speed.y);
|
||||||
val_y -= 1000 * get_fixed_process_delta_time();
|
val_y -= 1000 * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (val_y < 0) {
|
if (val_y < 0) {
|
||||||
turnoff = true;
|
turnoff = true;
|
||||||
|
@ -410,7 +410,7 @@ void ScrollBar::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (turnoff) {
|
if (turnoff) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_slave_touching = false;
|
drag_slave_touching = false;
|
||||||
drag_slave_touching_deaccel = false;
|
drag_slave_touching_deaccel = false;
|
||||||
}
|
}
|
||||||
|
@ -421,10 +421,10 @@ void ScrollBar::_notification(int p_what) {
|
||||||
|
|
||||||
Vector2 diff = drag_slave_accum - last_drag_slave_accum;
|
Vector2 diff = drag_slave_accum - last_drag_slave_accum;
|
||||||
last_drag_slave_accum = drag_slave_accum;
|
last_drag_slave_accum = drag_slave_accum;
|
||||||
drag_slave_speed = diff / get_fixed_process_delta_time();
|
drag_slave_speed = diff / get_physics_process_delta_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
time_since_motion += get_fixed_process_delta_time();
|
time_since_motion += get_physics_process_delta_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -579,7 +579,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
|
||||||
if (mb->is_pressed()) {
|
if (mb->is_pressed()) {
|
||||||
|
|
||||||
if (drag_slave_touching) {
|
if (drag_slave_touching) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_slave_touching_deaccel = false;
|
drag_slave_touching_deaccel = false;
|
||||||
drag_slave_touching = false;
|
drag_slave_touching = false;
|
||||||
drag_slave_speed = Vector2();
|
drag_slave_speed = Vector2();
|
||||||
|
@ -599,7 +599,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
|
||||||
drag_slave_touching_deaccel = false;
|
drag_slave_touching_deaccel = false;
|
||||||
time_since_motion = 0;
|
time_since_motion = 0;
|
||||||
if (drag_slave_touching) {
|
if (drag_slave_touching) {
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
time_since_motion = 0;
|
time_since_motion = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -611,7 +611,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
|
||||||
if (drag_slave_speed == Vector2()) {
|
if (drag_slave_speed == Vector2()) {
|
||||||
drag_slave_touching_deaccel = false;
|
drag_slave_touching_deaccel = false;
|
||||||
drag_slave_touching = false;
|
drag_slave_touching = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
drag_slave_touching_deaccel = true;
|
drag_slave_touching_deaccel = true;
|
||||||
|
|
|
@ -67,7 +67,7 @@ Size2 ScrollContainer::get_minimum_size() const {
|
||||||
};
|
};
|
||||||
|
|
||||||
void ScrollContainer::_cancel_drag() {
|
void ScrollContainer::_cancel_drag() {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_speed = Vector2();
|
drag_speed = Vector2();
|
||||||
|
@ -121,7 +121,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||||
if (mb->is_pressed()) {
|
if (mb->is_pressed()) {
|
||||||
|
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_speed = Vector2();
|
drag_speed = Vector2();
|
||||||
|
@ -139,7 +139,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
time_since_motion = 0;
|
time_since_motion = 0;
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
time_since_motion = 0;
|
time_since_motion = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||||
if (drag_speed == Vector2()) {
|
if (drag_speed == Vector2()) {
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
drag_touching_deaccel = true;
|
drag_touching_deaccel = true;
|
||||||
|
@ -257,14 +257,14 @@ void ScrollContainer::_notification(int p_what) {
|
||||||
update_scrollbars();
|
update_scrollbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
|
|
||||||
if (drag_touching_deaccel) {
|
if (drag_touching_deaccel) {
|
||||||
|
|
||||||
Vector2 pos = Vector2(h_scroll->get_value(), v_scroll->get_value());
|
Vector2 pos = Vector2(h_scroll->get_value(), v_scroll->get_value());
|
||||||
pos += drag_speed * get_fixed_process_delta_time();
|
pos += drag_speed * get_physics_process_delta_time();
|
||||||
|
|
||||||
bool turnoff_h = false;
|
bool turnoff_h = false;
|
||||||
bool turnoff_v = false;
|
bool turnoff_v = false;
|
||||||
|
@ -294,7 +294,7 @@ void ScrollContainer::_notification(int p_what) {
|
||||||
|
|
||||||
float sgn_x = drag_speed.x < 0 ? -1 : 1;
|
float sgn_x = drag_speed.x < 0 ? -1 : 1;
|
||||||
float val_x = Math::abs(drag_speed.x);
|
float val_x = Math::abs(drag_speed.x);
|
||||||
val_x -= 1000 * get_fixed_process_delta_time();
|
val_x -= 1000 * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (val_x < 0) {
|
if (val_x < 0) {
|
||||||
turnoff_h = true;
|
turnoff_h = true;
|
||||||
|
@ -302,7 +302,7 @@ void ScrollContainer::_notification(int p_what) {
|
||||||
|
|
||||||
float sgn_y = drag_speed.y < 0 ? -1 : 1;
|
float sgn_y = drag_speed.y < 0 ? -1 : 1;
|
||||||
float val_y = Math::abs(drag_speed.y);
|
float val_y = Math::abs(drag_speed.y);
|
||||||
val_y -= 1000 * get_fixed_process_delta_time();
|
val_y -= 1000 * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (val_y < 0) {
|
if (val_y < 0) {
|
||||||
turnoff_v = true;
|
turnoff_v = true;
|
||||||
|
@ -311,7 +311,7 @@ void ScrollContainer::_notification(int p_what) {
|
||||||
drag_speed = Vector2(sgn_x * val_x, sgn_y * val_y);
|
drag_speed = Vector2(sgn_x * val_x, sgn_y * val_y);
|
||||||
|
|
||||||
if (turnoff_h && turnoff_v) {
|
if (turnoff_h && turnoff_v) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
}
|
}
|
||||||
|
@ -322,10 +322,10 @@ void ScrollContainer::_notification(int p_what) {
|
||||||
|
|
||||||
Vector2 diff = drag_accum - last_drag_accum;
|
Vector2 diff = drag_accum - last_drag_accum;
|
||||||
last_drag_accum = drag_accum;
|
last_drag_accum = drag_accum;
|
||||||
drag_speed = diff / get_fixed_process_delta_time();
|
drag_speed = diff / get_physics_process_delta_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
time_since_motion += get_fixed_process_delta_time();
|
time_since_motion += get_physics_process_delta_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,22 +428,22 @@ void TextEdit::_notification(int p_what) {
|
||||||
draw_caret = false;
|
draw_caret = false;
|
||||||
update();
|
update();
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
if (scrolling && v_scroll->get_value() != target_v_scroll) {
|
if (scrolling && v_scroll->get_value() != target_v_scroll) {
|
||||||
double target_y = target_v_scroll - v_scroll->get_value();
|
double target_y = target_v_scroll - v_scroll->get_value();
|
||||||
double dist = sqrt(target_y * target_y);
|
double dist = sqrt(target_y * target_y);
|
||||||
double vel = ((target_y / dist) * v_scroll_speed) * get_fixed_process_delta_time();
|
double vel = ((target_y / dist) * v_scroll_speed) * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (Math::abs(vel) >= dist) {
|
if (Math::abs(vel) >= dist) {
|
||||||
v_scroll->set_value(target_v_scroll);
|
v_scroll->set_value(target_v_scroll);
|
||||||
scrolling = false;
|
scrolling = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
} else {
|
} else {
|
||||||
v_scroll->set_value(v_scroll->get_value() + vel);
|
v_scroll->set_value(v_scroll->get_value() + vel);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scrolling = false;
|
scrolling = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_DRAW: {
|
case NOTIFICATION_DRAW: {
|
||||||
|
@ -1611,7 +1611,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||||
target_v_scroll = 0;
|
target_v_scroll = 0;
|
||||||
}
|
}
|
||||||
scrolling = true;
|
scrolling = true;
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
} else {
|
} else {
|
||||||
v_scroll->set_value(target_v_scroll);
|
v_scroll->set_value(target_v_scroll);
|
||||||
}
|
}
|
||||||
|
@ -1633,7 +1633,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||||
target_v_scroll = max_v_scroll;
|
target_v_scroll = max_v_scroll;
|
||||||
}
|
}
|
||||||
scrolling = true;
|
scrolling = true;
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
} else {
|
} else {
|
||||||
v_scroll->set_value(target_v_scroll);
|
v_scroll->set_value(target_v_scroll);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2492,7 +2492,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
||||||
if (drag_speed == 0) {
|
if (drag_speed == 0) {
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
drag_touching_deaccel = true;
|
drag_touching_deaccel = true;
|
||||||
|
@ -2558,7 +2558,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_speed = 0;
|
drag_speed = 0;
|
||||||
|
@ -2573,7 +2573,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
||||||
drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
|
drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2764,7 +2764,7 @@ void Tree::_notification(int p_what) {
|
||||||
|
|
||||||
drop_mode_flags = 0;
|
drop_mode_flags = 0;
|
||||||
scrolling = false;
|
scrolling = false;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
if (p_what == NOTIFICATION_DRAG_BEGIN) {
|
if (p_what == NOTIFICATION_DRAG_BEGIN) {
|
||||||
|
@ -2772,23 +2772,23 @@ void Tree::_notification(int p_what) {
|
||||||
single_select_defer = NULL;
|
single_select_defer = NULL;
|
||||||
if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_position() - get_global_position())) {
|
if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_position() - get_global_position())) {
|
||||||
scrolling = true;
|
scrolling = true;
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p_what == NOTIFICATION_FIXED_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
|
|
||||||
if (drag_touching) {
|
if (drag_touching) {
|
||||||
|
|
||||||
if (drag_touching_deaccel) {
|
if (drag_touching_deaccel) {
|
||||||
|
|
||||||
float pos = v_scroll->get_value();
|
float pos = v_scroll->get_value();
|
||||||
pos += drag_speed * get_fixed_process_delta_time();
|
pos += drag_speed * get_physics_process_delta_time();
|
||||||
|
|
||||||
bool turnoff = false;
|
bool turnoff = false;
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = 0;
|
pos = 0;
|
||||||
turnoff = true;
|
turnoff = true;
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
}
|
}
|
||||||
|
@ -2800,7 +2800,7 @@ void Tree::_notification(int p_what) {
|
||||||
v_scroll->set_value(pos);
|
v_scroll->set_value(pos);
|
||||||
float sgn = drag_speed < 0 ? -1 : 1;
|
float sgn = drag_speed < 0 ? -1 : 1;
|
||||||
float val = Math::abs(drag_speed);
|
float val = Math::abs(drag_speed);
|
||||||
val -= 1000 * get_fixed_process_delta_time();
|
val -= 1000 * get_physics_process_delta_time();
|
||||||
|
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
turnoff = true;
|
turnoff = true;
|
||||||
|
@ -2808,7 +2808,7 @@ void Tree::_notification(int p_what) {
|
||||||
drag_speed = sgn * val;
|
drag_speed = sgn * val;
|
||||||
|
|
||||||
if (turnoff) {
|
if (turnoff) {
|
||||||
set_fixed_process(false);
|
set_physics_process(false);
|
||||||
drag_touching = false;
|
drag_touching = false;
|
||||||
drag_touching_deaccel = false;
|
drag_touching_deaccel = false;
|
||||||
}
|
}
|
||||||
|
@ -2833,7 +2833,7 @@ void Tree::_notification(int p_what) {
|
||||||
} else {
|
} else {
|
||||||
point.y = 0;
|
point.y = 0;
|
||||||
}
|
}
|
||||||
point *= cache.scroll_speed * get_fixed_process_delta_time();
|
point *= cache.scroll_speed * get_physics_process_delta_time();
|
||||||
point += get_scroll();
|
point += get_scroll();
|
||||||
h_scroll->set_value(point.x);
|
h_scroll->set_value(point.x);
|
||||||
v_scroll->set_value(point.y);
|
v_scroll->set_value(point.y);
|
||||||
|
|
|
@ -54,13 +54,13 @@ void Node::_notification(int p_notification) {
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
|
|
||||||
Variant time = get_fixed_process_delta_time();
|
Variant time = get_physics_process_delta_time();
|
||||||
const Variant *ptr[1] = { &time };
|
const Variant *ptr[1] = { &time };
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_fixed_process, ptr, 1);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_physics_process, ptr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
@ -129,8 +129,8 @@ void Node::_notification(int p_notification) {
|
||||||
set_process(true);
|
set_process(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_fixed_process)) {
|
if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_physics_process)) {
|
||||||
set_fixed_process(true);
|
set_physics_process(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0);
|
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0);
|
||||||
|
@ -367,46 +367,46 @@ void Node::move_child_notify(Node *p_child) {
|
||||||
// to be used when not wanted
|
// to be used when not wanted
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::set_fixed_process(bool p_process) {
|
void Node::set_physics_process(bool p_process) {
|
||||||
|
|
||||||
if (data.fixed_process == p_process)
|
if (data.physics_process == p_process)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
data.fixed_process = p_process;
|
data.physics_process = p_process;
|
||||||
|
|
||||||
if (data.fixed_process)
|
if (data.physics_process)
|
||||||
add_to_group("fixed_process", false);
|
add_to_group("physics_process", false);
|
||||||
else
|
else
|
||||||
remove_from_group("fixed_process");
|
remove_from_group("physics_process");
|
||||||
|
|
||||||
data.fixed_process = p_process;
|
data.physics_process = p_process;
|
||||||
_change_notify("fixed_process");
|
_change_notify("physics_process");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Node::is_fixed_processing() const {
|
bool Node::is_physics_processing() const {
|
||||||
|
|
||||||
return data.fixed_process;
|
return data.physics_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::set_fixed_process_internal(bool p_process_internal) {
|
void Node::set_physics_process_internal(bool p_process_internal) {
|
||||||
|
|
||||||
if (data.fixed_process_internal == p_process_internal)
|
if (data.physics_process_internal == p_process_internal)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
data.fixed_process_internal = p_process_internal;
|
data.physics_process_internal = p_process_internal;
|
||||||
|
|
||||||
if (data.fixed_process_internal)
|
if (data.physics_process_internal)
|
||||||
add_to_group("fixed_process_internal", false);
|
add_to_group("physics_process_internal", false);
|
||||||
else
|
else
|
||||||
remove_from_group("fixed_process_internal");
|
remove_from_group("physics_process_internal");
|
||||||
|
|
||||||
data.fixed_process_internal = p_process_internal;
|
data.physics_process_internal = p_process_internal;
|
||||||
_change_notify("fixed_process_internal");
|
_change_notify("physics_process_internal");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Node::is_fixed_processing_internal() const {
|
bool Node::is_physics_processing_internal() const {
|
||||||
|
|
||||||
return data.fixed_process_internal;
|
return data.physics_process_internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::set_pause_mode(PauseMode p_mode) {
|
void Node::set_pause_mode(PauseMode p_mode) {
|
||||||
|
@ -1010,10 +1010,10 @@ bool Node::can_process() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Node::get_fixed_process_delta_time() const {
|
float Node::get_physics_process_delta_time() const {
|
||||||
|
|
||||||
if (data.tree)
|
if (data.tree)
|
||||||
return data.tree->get_fixed_process_time();
|
return data.tree->get_physics_process_time();
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2719,9 +2719,9 @@ void Node::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_filename"), &Node::get_filename);
|
ClassDB::bind_method(D_METHOD("get_filename"), &Node::get_filename);
|
||||||
ClassDB::bind_method(D_METHOD("propagate_notification", "what"), &Node::propagate_notification);
|
ClassDB::bind_method(D_METHOD("propagate_notification", "what"), &Node::propagate_notification);
|
||||||
ClassDB::bind_method(D_METHOD("propagate_call", "method", "args", "parent_first"), &Node::propagate_call, DEFVAL(Array()), DEFVAL(false));
|
ClassDB::bind_method(D_METHOD("propagate_call", "method", "args", "parent_first"), &Node::propagate_call, DEFVAL(Array()), DEFVAL(false));
|
||||||
ClassDB::bind_method(D_METHOD("set_fixed_process", "enable"), &Node::set_fixed_process);
|
ClassDB::bind_method(D_METHOD("set_physics_process", "enable"), &Node::set_physics_process);
|
||||||
ClassDB::bind_method(D_METHOD("get_fixed_process_delta_time"), &Node::get_fixed_process_delta_time);
|
ClassDB::bind_method(D_METHOD("get_physics_process_delta_time"), &Node::get_physics_process_delta_time);
|
||||||
ClassDB::bind_method(D_METHOD("is_fixed_processing"), &Node::is_fixed_processing);
|
ClassDB::bind_method(D_METHOD("is_physics_processing"), &Node::is_physics_processing);
|
||||||
ClassDB::bind_method(D_METHOD("get_process_delta_time"), &Node::get_process_delta_time);
|
ClassDB::bind_method(D_METHOD("get_process_delta_time"), &Node::get_process_delta_time);
|
||||||
ClassDB::bind_method(D_METHOD("set_process", "enable"), &Node::set_process);
|
ClassDB::bind_method(D_METHOD("set_process", "enable"), &Node::set_process);
|
||||||
ClassDB::bind_method(D_METHOD("is_processing"), &Node::is_processing);
|
ClassDB::bind_method(D_METHOD("is_processing"), &Node::is_processing);
|
||||||
|
@ -2742,8 +2742,8 @@ void Node::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("set_process_internal", "enable"), &Node::set_process_internal);
|
ClassDB::bind_method(D_METHOD("set_process_internal", "enable"), &Node::set_process_internal);
|
||||||
ClassDB::bind_method(D_METHOD("is_processing_internal"), &Node::is_processing_internal);
|
ClassDB::bind_method(D_METHOD("is_processing_internal"), &Node::is_processing_internal);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_fixed_process_internal", "enable"), &Node::set_fixed_process_internal);
|
ClassDB::bind_method(D_METHOD("set_physics_process_internal", "enable"), &Node::set_physics_process_internal);
|
||||||
ClassDB::bind_method(D_METHOD("is_fixed_processing_internal"), &Node::is_fixed_processing_internal);
|
ClassDB::bind_method(D_METHOD("is_physics_processing_internal"), &Node::is_physics_processing_internal);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_tree"), &Node::get_tree);
|
ClassDB::bind_method(D_METHOD("get_tree"), &Node::get_tree);
|
||||||
|
|
||||||
|
@ -2801,7 +2801,7 @@ void Node::_bind_methods() {
|
||||||
BIND_CONSTANT(NOTIFICATION_EXIT_TREE);
|
BIND_CONSTANT(NOTIFICATION_EXIT_TREE);
|
||||||
BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT);
|
BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT);
|
||||||
BIND_CONSTANT(NOTIFICATION_READY);
|
BIND_CONSTANT(NOTIFICATION_READY);
|
||||||
BIND_CONSTANT(NOTIFICATION_FIXED_PROCESS);
|
BIND_CONSTANT(NOTIFICATION_PHYSICS_PROCESS);
|
||||||
BIND_CONSTANT(NOTIFICATION_PROCESS);
|
BIND_CONSTANT(NOTIFICATION_PROCESS);
|
||||||
BIND_CONSTANT(NOTIFICATION_PARENTED);
|
BIND_CONSTANT(NOTIFICATION_PARENTED);
|
||||||
BIND_CONSTANT(NOTIFICATION_UNPARENTED);
|
BIND_CONSTANT(NOTIFICATION_UNPARENTED);
|
||||||
|
@ -2813,7 +2813,7 @@ void Node::_bind_methods() {
|
||||||
BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
|
BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
|
||||||
BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED);
|
BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED);
|
||||||
BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
|
BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
|
||||||
BIND_CONSTANT(NOTIFICATION_INTERNAL_FIXED_PROCESS);
|
BIND_CONSTANT(NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(RPC_MODE_DISABLED);
|
BIND_ENUM_CONSTANT(RPC_MODE_DISABLED);
|
||||||
BIND_ENUM_CONSTANT(RPC_MODE_REMOTE);
|
BIND_ENUM_CONSTANT(RPC_MODE_REMOTE);
|
||||||
|
@ -2835,7 +2835,7 @@ void Node::_bind_methods() {
|
||||||
ADD_SIGNAL(MethodInfo("tree_exited"));
|
ADD_SIGNAL(MethodInfo("tree_exited"));
|
||||||
|
|
||||||
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),"set_process","is_processing") ;
|
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),"set_process","is_processing") ;
|
||||||
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), "set_fixed_process","is_fixed_processing") ;
|
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/physics_process" ), "set_physics_process","is_physics_processing") ;
|
||||||
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), "set_process_input","is_processing_input" ) ;
|
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), "set_process_input","is_processing_input" ) ;
|
||||||
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), "set_process_unhandled_input","is_processing_unhandled_input" ) ;
|
//ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), "set_process_unhandled_input","is_processing_unhandled_input" ) ;
|
||||||
ADD_GROUP("Pause", "pause_");
|
ADD_GROUP("Pause", "pause_");
|
||||||
|
@ -2843,7 +2843,7 @@ void Node::_bind_methods() {
|
||||||
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "editor/display_folded", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_display_folded", "is_displayed_folded");
|
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "editor/display_folded", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_display_folded", "is_displayed_folded");
|
||||||
|
|
||||||
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
|
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
|
||||||
BIND_VMETHOD(MethodInfo("_fixed_process", PropertyInfo(Variant::REAL, "delta")));
|
BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta")));
|
||||||
BIND_VMETHOD(MethodInfo("_enter_tree"));
|
BIND_VMETHOD(MethodInfo("_enter_tree"));
|
||||||
BIND_VMETHOD(MethodInfo("_exit_tree"));
|
BIND_VMETHOD(MethodInfo("_exit_tree"));
|
||||||
BIND_VMETHOD(MethodInfo("_ready"));
|
BIND_VMETHOD(MethodInfo("_ready"));
|
||||||
|
@ -2872,9 +2872,9 @@ Node::Node() {
|
||||||
data.blocked = 0;
|
data.blocked = 0;
|
||||||
data.parent = NULL;
|
data.parent = NULL;
|
||||||
data.tree = NULL;
|
data.tree = NULL;
|
||||||
data.fixed_process = false;
|
data.physics_process = false;
|
||||||
data.idle_process = false;
|
data.idle_process = false;
|
||||||
data.fixed_process_internal = false;
|
data.physics_process_internal = false;
|
||||||
data.idle_process_internal = false;
|
data.idle_process_internal = false;
|
||||||
data.inside_tree = false;
|
data.inside_tree = false;
|
||||||
data.ready_notified = false;
|
data.ready_notified = false;
|
||||||
|
|
|
@ -121,10 +121,10 @@ private:
|
||||||
|
|
||||||
// variables used to properly sort the node when processing, ignored otherwise
|
// variables used to properly sort the node when processing, ignored otherwise
|
||||||
//should move all the stuff below to bits
|
//should move all the stuff below to bits
|
||||||
bool fixed_process;
|
bool physics_process;
|
||||||
bool idle_process;
|
bool idle_process;
|
||||||
|
|
||||||
bool fixed_process_internal;
|
bool physics_process_internal;
|
||||||
bool idle_process_internal;
|
bool idle_process_internal;
|
||||||
|
|
||||||
bool input;
|
bool input;
|
||||||
|
@ -213,7 +213,7 @@ public:
|
||||||
NOTIFICATION_READY = 13,
|
NOTIFICATION_READY = 13,
|
||||||
NOTIFICATION_PAUSED = 14,
|
NOTIFICATION_PAUSED = 14,
|
||||||
NOTIFICATION_UNPAUSED = 15,
|
NOTIFICATION_UNPAUSED = 15,
|
||||||
NOTIFICATION_FIXED_PROCESS = 16,
|
NOTIFICATION_PHYSICS_PROCESS = 16,
|
||||||
NOTIFICATION_PROCESS = 17,
|
NOTIFICATION_PROCESS = 17,
|
||||||
NOTIFICATION_PARENTED = 18,
|
NOTIFICATION_PARENTED = 18,
|
||||||
NOTIFICATION_UNPARENTED = 19,
|
NOTIFICATION_UNPARENTED = 19,
|
||||||
|
@ -223,7 +223,7 @@ public:
|
||||||
NOTIFICATION_PATH_CHANGED = 23,
|
NOTIFICATION_PATH_CHANGED = 23,
|
||||||
NOTIFICATION_TRANSLATION_CHANGED = 24,
|
NOTIFICATION_TRANSLATION_CHANGED = 24,
|
||||||
NOTIFICATION_INTERNAL_PROCESS = 25,
|
NOTIFICATION_INTERNAL_PROCESS = 25,
|
||||||
NOTIFICATION_INTERNAL_FIXED_PROCESS = 26,
|
NOTIFICATION_INTERNAL_PHYSICS_PROCESS = 26,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,16 +299,16 @@ public:
|
||||||
void propagate_call(const StringName &p_method, const Array &p_args = Array(), const bool p_parent_first = false);
|
void propagate_call(const StringName &p_method, const Array &p_args = Array(), const bool p_parent_first = false);
|
||||||
|
|
||||||
/* PROCESSING */
|
/* PROCESSING */
|
||||||
void set_fixed_process(bool p_process);
|
void set_physics_process(bool p_process);
|
||||||
float get_fixed_process_delta_time() const;
|
float get_physics_process_delta_time() const;
|
||||||
bool is_fixed_processing() const;
|
bool is_physics_processing() const;
|
||||||
|
|
||||||
void set_process(bool p_idle_process);
|
void set_process(bool p_idle_process);
|
||||||
float get_process_delta_time() const;
|
float get_process_delta_time() const;
|
||||||
bool is_processing() const;
|
bool is_processing() const;
|
||||||
|
|
||||||
void set_fixed_process_internal(bool p_process_internal);
|
void set_physics_process_internal(bool p_process_internal);
|
||||||
bool is_fixed_processing_internal() const;
|
bool is_physics_processing_internal() const;
|
||||||
|
|
||||||
void set_process_internal(bool p_idle_process_internal);
|
void set_process_internal(bool p_idle_process_internal);
|
||||||
bool is_processing_internal() const;
|
bool is_processing_internal() const;
|
||||||
|
|
|
@ -446,12 +446,12 @@ bool SceneTree::iteration(float p_time) {
|
||||||
_flush_transform_notifications();
|
_flush_transform_notifications();
|
||||||
|
|
||||||
MainLoop::iteration(p_time);
|
MainLoop::iteration(p_time);
|
||||||
fixed_process_time = p_time;
|
physics_process_time = p_time;
|
||||||
|
|
||||||
emit_signal("fixed_frame");
|
emit_signal("physics_frame");
|
||||||
|
|
||||||
_notify_group_pause("fixed_process_internal", Node::NOTIFICATION_INTERNAL_FIXED_PROCESS);
|
_notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
|
||||||
_notify_group_pause("fixed_process", Node::NOTIFICATION_FIXED_PROCESS);
|
_notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS);
|
||||||
_flush_ugc();
|
_flush_ugc();
|
||||||
MessageQueue::get_singleton()->flush(); //small little hack
|
MessageQueue::get_singleton()->flush(); //small little hack
|
||||||
_flush_transform_notifications();
|
_flush_transform_notifications();
|
||||||
|
@ -2194,7 +2194,7 @@ void SceneTree::_bind_methods() {
|
||||||
ADD_SIGNAL(MethodInfo("node_configuration_warning_changed", PropertyInfo(Variant::OBJECT, "node")));
|
ADD_SIGNAL(MethodInfo("node_configuration_warning_changed", PropertyInfo(Variant::OBJECT, "node")));
|
||||||
|
|
||||||
ADD_SIGNAL(MethodInfo("idle_frame"));
|
ADD_SIGNAL(MethodInfo("idle_frame"));
|
||||||
ADD_SIGNAL(MethodInfo("fixed_frame"));
|
ADD_SIGNAL(MethodInfo("physics_frame"));
|
||||||
|
|
||||||
ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen")));
|
ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen")));
|
||||||
ADD_SIGNAL(MethodInfo("network_peer_connected", PropertyInfo(Variant::INT, "id")));
|
ADD_SIGNAL(MethodInfo("network_peer_connected", PropertyInfo(Variant::INT, "id")));
|
||||||
|
@ -2254,7 +2254,7 @@ SceneTree::SceneTree() {
|
||||||
collision_debug_contacts = GLOBAL_DEF("debug/shapes/collision/max_contacts_displayed", 10000);
|
collision_debug_contacts = GLOBAL_DEF("debug/shapes/collision/max_contacts_displayed", 10000);
|
||||||
|
|
||||||
tree_version = 1;
|
tree_version = 1;
|
||||||
fixed_process_time = 1;
|
physics_process_time = 1;
|
||||||
idle_process_time = 1;
|
idle_process_time = 1;
|
||||||
last_id = 1;
|
last_id = 1;
|
||||||
root = NULL;
|
root = NULL;
|
||||||
|
|
|
@ -105,7 +105,7 @@ private:
|
||||||
Viewport *root;
|
Viewport *root;
|
||||||
|
|
||||||
uint64_t tree_version;
|
uint64_t tree_version;
|
||||||
float fixed_process_time;
|
float physics_process_time;
|
||||||
float idle_process_time;
|
float idle_process_time;
|
||||||
bool accept_quit;
|
bool accept_quit;
|
||||||
bool quit_on_go_back;
|
bool quit_on_go_back;
|
||||||
|
@ -358,7 +358,7 @@ public:
|
||||||
|
|
||||||
void set_input_as_handled();
|
void set_input_as_handled();
|
||||||
bool is_input_handled();
|
bool is_input_handled();
|
||||||
_FORCE_INLINE_ float get_fixed_process_time() const { return fixed_process_time; }
|
_FORCE_INLINE_ float get_physics_process_time() const { return physics_process_time; }
|
||||||
_FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; }
|
_FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; }
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
|
|
@ -47,7 +47,7 @@ void Timer::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_PROCESS: {
|
case NOTIFICATION_INTERNAL_PROCESS: {
|
||||||
if (timer_process_mode == TIMER_PROCESS_FIXED || !is_processing_internal())
|
if (timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal())
|
||||||
return;
|
return;
|
||||||
time_left -= get_process_delta_time();
|
time_left -= get_process_delta_time();
|
||||||
|
|
||||||
|
@ -61,10 +61,10 @@ void Timer::_notification(int p_what) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
|
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
|
||||||
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing_internal())
|
if (timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal())
|
||||||
return;
|
return;
|
||||||
time_left -= get_fixed_process_delta_time();
|
time_left -= get_physics_process_delta_time();
|
||||||
|
|
||||||
if (time_left < 0) {
|
if (time_left < 0) {
|
||||||
if (!one_shot)
|
if (!one_shot)
|
||||||
|
@ -144,16 +144,16 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (timer_process_mode) {
|
switch (timer_process_mode) {
|
||||||
case TIMER_PROCESS_FIXED:
|
case TIMER_PROCESS_PHYSICS:
|
||||||
if (is_fixed_processing_internal()) {
|
if (is_physics_processing_internal()) {
|
||||||
set_fixed_process_internal(false);
|
set_physics_process_internal(false);
|
||||||
set_process_internal(true);
|
set_process_internal(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TIMER_PROCESS_IDLE:
|
case TIMER_PROCESS_IDLE:
|
||||||
if (is_processing_internal()) {
|
if (is_processing_internal()) {
|
||||||
set_process_internal(false);
|
set_process_internal(false);
|
||||||
set_fixed_process_internal(true);
|
set_physics_process_internal(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ Timer::TimerProcessMode Timer::get_timer_process_mode() const {
|
||||||
|
|
||||||
void Timer::_set_process(bool p_process, bool p_force) {
|
void Timer::_set_process(bool p_process, bool p_force) {
|
||||||
switch (timer_process_mode) {
|
switch (timer_process_mode) {
|
||||||
case TIMER_PROCESS_FIXED: set_fixed_process_internal(p_process && !paused); break;
|
case TIMER_PROCESS_PHYSICS: set_physics_process_internal(p_process && !paused); break;
|
||||||
case TIMER_PROCESS_IDLE: set_process_internal(p_process && !paused); break;
|
case TIMER_PROCESS_IDLE: set_process_internal(p_process && !paused); break;
|
||||||
}
|
}
|
||||||
processing = p_process;
|
processing = p_process;
|
||||||
|
@ -204,7 +204,7 @@ void Timer::_bind_methods() {
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot");
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart");
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart");
|
||||||
|
|
||||||
BIND_ENUM_CONSTANT(TIMER_PROCESS_FIXED);
|
BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS);
|
||||||
BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE);
|
BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TimerProcessMode {
|
enum TimerProcessMode {
|
||||||
TIMER_PROCESS_FIXED,
|
TIMER_PROCESS_PHYSICS,
|
||||||
TIMER_PROCESS_IDLE,
|
TIMER_PROCESS_IDLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -456,10 +456,10 @@ void Viewport::_notification(int p_what) {
|
||||||
VS::get_singleton()->viewport_set_active(viewport, false);
|
VS::get_singleton()->viewport_set_active(viewport, false);
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_FIXED_PROCESS: {
|
case NOTIFICATION_PHYSICS_PROCESS: {
|
||||||
|
|
||||||
if (gui.tooltip_timer >= 0) {
|
if (gui.tooltip_timer >= 0) {
|
||||||
gui.tooltip_timer -= get_fixed_process_delta_time();
|
gui.tooltip_timer -= get_physics_process_delta_time();
|
||||||
if (gui.tooltip_timer < 0) {
|
if (gui.tooltip_timer < 0) {
|
||||||
_gui_show_tooltip();
|
_gui_show_tooltip();
|
||||||
}
|
}
|
||||||
|
@ -2453,7 +2453,7 @@ Rect2 Viewport::get_attach_to_screen_rect() const {
|
||||||
void Viewport::set_physics_object_picking(bool p_enable) {
|
void Viewport::set_physics_object_picking(bool p_enable) {
|
||||||
|
|
||||||
physics_object_picking = p_enable;
|
physics_object_picking = p_enable;
|
||||||
set_fixed_process(physics_object_picking);
|
set_physics_process(physics_object_picking);
|
||||||
if (!physics_object_picking)
|
if (!physics_object_picking)
|
||||||
physics_picking_events.clear();
|
physics_picking_events.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ SceneStringNames::SceneStringNames() {
|
||||||
_get_gizmo_geometry = StaticCString::create("_get_gizmo_geometry");
|
_get_gizmo_geometry = StaticCString::create("_get_gizmo_geometry");
|
||||||
_can_gizmo_scale = StaticCString::create("_can_gizmo_scale");
|
_can_gizmo_scale = StaticCString::create("_can_gizmo_scale");
|
||||||
|
|
||||||
_fixed_process = StaticCString::create("_fixed_process");
|
_physics_process = StaticCString::create("_physics_process");
|
||||||
_process = StaticCString::create("_process");
|
_process = StaticCString::create("_process");
|
||||||
|
|
||||||
_enter_tree = StaticCString::create("_enter_tree");
|
_enter_tree = StaticCString::create("_enter_tree");
|
||||||
|
|
|
@ -106,7 +106,7 @@ public:
|
||||||
StringName _get_gizmo_geometry;
|
StringName _get_gizmo_geometry;
|
||||||
StringName _can_gizmo_scale;
|
StringName _can_gizmo_scale;
|
||||||
|
|
||||||
StringName _fixed_process;
|
StringName _physics_process;
|
||||||
StringName _process;
|
StringName _process;
|
||||||
StringName _enter_world;
|
StringName _enter_world;
|
||||||
StringName _exit_world;
|
StringName _exit_world;
|
||||||
|
|
|
@ -183,7 +183,7 @@ PhysicsDirectSpaceState *PhysicsServerSW::space_get_direct_state(RID p_space) {
|
||||||
ERR_FAIL_COND_V(!space, NULL);
|
ERR_FAIL_COND_V(!space, NULL);
|
||||||
if (!doing_sync || space->is_locked()) {
|
if (!doing_sync || space->is_locked()) {
|
||||||
|
|
||||||
ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or fixed process notification.");
|
ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or physics process notification.");
|
||||||
ERR_FAIL_V(NULL);
|
ERR_FAIL_V(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ public:
|
||||||
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value);
|
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value);
|
||||||
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const;
|
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const;
|
||||||
|
|
||||||
// this function only works on fixed process, errors and returns null otherwise
|
// this function only works on physics process, errors and returns null otherwise
|
||||||
virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space);
|
virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space);
|
||||||
|
|
||||||
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts);
|
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts);
|
||||||
|
|
|
@ -270,7 +270,7 @@ Physics2DDirectSpaceState *Physics2DServerSW::space_get_direct_state(RID p_space
|
||||||
ERR_FAIL_COND_V(!space, NULL);
|
ERR_FAIL_COND_V(!space, NULL);
|
||||||
if ((using_threads && !doing_sync) || space->is_locked()) {
|
if ((using_threads && !doing_sync) || space->is_locked()) {
|
||||||
|
|
||||||
ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or fixed process notification.");
|
ERR_EXPLAIN("Space state is inaccessible right now, wait for iteration or physics process notification.");
|
||||||
ERR_FAIL_V(NULL);
|
ERR_FAIL_V(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ public:
|
||||||
virtual Vector<Vector2> space_get_contacts(RID p_space) const;
|
virtual Vector<Vector2> space_get_contacts(RID p_space) const;
|
||||||
virtual int space_get_contact_count(RID p_space) const;
|
virtual int space_get_contact_count(RID p_space) const;
|
||||||
|
|
||||||
// this function only works on fixed process, errors and returns null otherwise
|
// this function only works on physics process, errors and returns null otherwise
|
||||||
virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space);
|
virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space);
|
||||||
|
|
||||||
/* AREA API */
|
/* AREA API */
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
FUNC3(space_set_param, RID, SpaceParameter, real_t);
|
FUNC3(space_set_param, RID, SpaceParameter, real_t);
|
||||||
FUNC2RC(real_t, space_get_param, RID, SpaceParameter);
|
FUNC2RC(real_t, space_get_param, RID, SpaceParameter);
|
||||||
|
|
||||||
// this function only works on fixed process, errors and returns null otherwise
|
// this function only works on physics process, errors and returns null otherwise
|
||||||
Physics2DDirectSpaceState *space_get_direct_state(RID p_space) {
|
Physics2DDirectSpaceState *space_get_direct_state(RID p_space) {
|
||||||
|
|
||||||
ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), NULL);
|
ERR_FAIL_COND_V(main_thread != Thread::get_caller_id(), NULL);
|
||||||
|
|
|
@ -283,7 +283,7 @@ public:
|
||||||
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) = 0;
|
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) = 0;
|
||||||
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
|
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
|
||||||
|
|
||||||
// this function only works on fixed process, errors and returns null otherwise
|
// this function only works on physics process, errors and returns null otherwise
|
||||||
virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space) = 0;
|
virtual Physics2DDirectSpaceState *space_get_direct_state(RID p_space) = 0;
|
||||||
|
|
||||||
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
|
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
|
||||||
|
|
|
@ -276,7 +276,7 @@ public:
|
||||||
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) = 0;
|
virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) = 0;
|
||||||
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
|
virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const = 0;
|
||||||
|
|
||||||
// this function only works on fixed process, errors and returns null otherwise
|
// this function only works on physics process, errors and returns null otherwise
|
||||||
virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space) = 0;
|
virtual PhysicsDirectSpaceState *space_get_direct_state(RID p_space) = 0;
|
||||||
|
|
||||||
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
|
virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) = 0;
|
||||||
|
|
Loading…
Reference in New Issue