summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rwxr-xr-xscene/main/node.cpp76
-rw-r--r--scene/main/node.h18
-rw-r--r--scene/main/scene_tree.cpp12
-rw-r--r--scene/main/scene_tree.h4
-rwxr-xr-xscene/main/timer.cpp20
-rwxr-xr-xscene/main/timer.h2
-rw-r--r--scene/main/viewport.cpp6
7 files changed, 69 insertions, 69 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 658701dcc7..c2a31b4a8b 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -54,13 +54,13 @@ void Node::_notification(int p_notification) {
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1);
}
} break;
- case NOTIFICATION_FIXED_PROCESS: {
+ case NOTIFICATION_PHYSICS_PROCESS: {
if (get_script_instance()) {
- Variant time = get_fixed_process_delta_time();
+ Variant time = get_physics_process_delta_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;
@@ -129,8 +129,8 @@ void Node::_notification(int p_notification) {
set_process(true);
}
- if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_fixed_process)) {
- set_fixed_process(true);
+ if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_physics_process)) {
+ set_physics_process(true);
}
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
}
-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;
- data.fixed_process = p_process;
+ data.physics_process = p_process;
- if (data.fixed_process)
- add_to_group("fixed_process", false);
+ if (data.physics_process)
+ add_to_group("physics_process", false);
else
- remove_from_group("fixed_process");
+ remove_from_group("physics_process");
- data.fixed_process = p_process;
- _change_notify("fixed_process");
+ data.physics_process = p_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;
- data.fixed_process_internal = p_process_internal;
+ data.physics_process_internal = p_process_internal;
- if (data.fixed_process_internal)
- add_to_group("fixed_process_internal", false);
+ if (data.physics_process_internal)
+ add_to_group("physics_process_internal", false);
else
- remove_from_group("fixed_process_internal");
+ remove_from_group("physics_process_internal");
- data.fixed_process_internal = p_process_internal;
- _change_notify("fixed_process_internal");
+ data.physics_process_internal = p_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) {
@@ -1010,10 +1010,10 @@ bool Node::can_process() const {
return true;
}
-float Node::get_fixed_process_delta_time() const {
+float Node::get_physics_process_delta_time() const {
if (data.tree)
- return data.tree->get_fixed_process_time();
+ return data.tree->get_physics_process_time();
else
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("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("set_fixed_process", "enable"), &Node::set_fixed_process);
- ClassDB::bind_method(D_METHOD("get_fixed_process_delta_time"), &Node::get_fixed_process_delta_time);
- ClassDB::bind_method(D_METHOD("is_fixed_processing"), &Node::is_fixed_processing);
+ ClassDB::bind_method(D_METHOD("set_physics_process", "enable"), &Node::set_physics_process);
+ ClassDB::bind_method(D_METHOD("get_physics_process_delta_time"), &Node::get_physics_process_delta_time);
+ 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("set_process", "enable"), &Node::set_process);
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("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("is_fixed_processing_internal"), &Node::is_fixed_processing_internal);
+ ClassDB::bind_method(D_METHOD("set_physics_process_internal", "enable"), &Node::set_physics_process_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);
@@ -2801,7 +2801,7 @@ void Node::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_EXIT_TREE);
BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT);
BIND_CONSTANT(NOTIFICATION_READY);
- BIND_CONSTANT(NOTIFICATION_FIXED_PROCESS);
+ BIND_CONSTANT(NOTIFICATION_PHYSICS_PROCESS);
BIND_CONSTANT(NOTIFICATION_PROCESS);
BIND_CONSTANT(NOTIFICATION_PARENTED);
BIND_CONSTANT(NOTIFICATION_UNPARENTED);
@@ -2813,7 +2813,7 @@ void Node::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED);
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_REMOTE);
@@ -2835,7 +2835,7 @@ void Node::_bind_methods() {
ADD_SIGNAL(MethodInfo("tree_exited"));
//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/unhandled_input" ), "set_process_unhandled_input","is_processing_unhandled_input" ) ;
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");
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("_exit_tree"));
BIND_VMETHOD(MethodInfo("_ready"));
@@ -2872,9 +2872,9 @@ Node::Node() {
data.blocked = 0;
data.parent = NULL;
data.tree = NULL;
- data.fixed_process = false;
+ data.physics_process = false;
data.idle_process = false;
- data.fixed_process_internal = false;
+ data.physics_process_internal = false;
data.idle_process_internal = false;
data.inside_tree = false;
data.ready_notified = false;
diff --git a/scene/main/node.h b/scene/main/node.h
index 12d6310062..c43e96063f 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -121,10 +121,10 @@ private:
// variables used to properly sort the node when processing, ignored otherwise
//should move all the stuff below to bits
- bool fixed_process;
+ bool physics_process;
bool idle_process;
- bool fixed_process_internal;
+ bool physics_process_internal;
bool idle_process_internal;
bool input;
@@ -213,7 +213,7 @@ public:
NOTIFICATION_READY = 13,
NOTIFICATION_PAUSED = 14,
NOTIFICATION_UNPAUSED = 15,
- NOTIFICATION_FIXED_PROCESS = 16,
+ NOTIFICATION_PHYSICS_PROCESS = 16,
NOTIFICATION_PROCESS = 17,
NOTIFICATION_PARENTED = 18,
NOTIFICATION_UNPARENTED = 19,
@@ -223,7 +223,7 @@ public:
NOTIFICATION_PATH_CHANGED = 23,
NOTIFICATION_TRANSLATION_CHANGED = 24,
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);
/* PROCESSING */
- void set_fixed_process(bool p_process);
- float get_fixed_process_delta_time() const;
- bool is_fixed_processing() const;
+ void set_physics_process(bool p_process);
+ float get_physics_process_delta_time() const;
+ bool is_physics_processing() const;
void set_process(bool p_idle_process);
float get_process_delta_time() const;
bool is_processing() const;
- void set_fixed_process_internal(bool p_process_internal);
- bool is_fixed_processing_internal() const;
+ void set_physics_process_internal(bool p_process_internal);
+ bool is_physics_processing_internal() const;
void set_process_internal(bool p_idle_process_internal);
bool is_processing_internal() const;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 5a1388458b..7a28e2a6f8 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -446,12 +446,12 @@ bool SceneTree::iteration(float p_time) {
_flush_transform_notifications();
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("fixed_process", Node::NOTIFICATION_FIXED_PROCESS);
+ _notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
+ _notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS);
_flush_ugc();
MessageQueue::get_singleton()->flush(); //small little hack
_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("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("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);
tree_version = 1;
- fixed_process_time = 1;
+ physics_process_time = 1;
idle_process_time = 1;
last_id = 1;
root = NULL;
diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h
index c116bec4fc..f3e689adab 100644
--- a/scene/main/scene_tree.h
+++ b/scene/main/scene_tree.h
@@ -105,7 +105,7 @@ private:
Viewport *root;
uint64_t tree_version;
- float fixed_process_time;
+ float physics_process_time;
float idle_process_time;
bool accept_quit;
bool quit_on_go_back;
@@ -358,7 +358,7 @@ public:
void set_input_as_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; }
#ifdef TOOLS_ENABLED
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index df7d609ac0..23854b5f59 100755
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -47,7 +47,7 @@ void Timer::_notification(int p_what) {
}
} break;
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;
time_left -= get_process_delta_time();
@@ -61,10 +61,10 @@ void Timer::_notification(int p_what) {
}
} break;
- case NOTIFICATION_INTERNAL_FIXED_PROCESS: {
- if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing_internal())
+ case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
+ if (timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal())
return;
- time_left -= get_fixed_process_delta_time();
+ time_left -= get_physics_process_delta_time();
if (time_left < 0) {
if (!one_shot)
@@ -144,16 +144,16 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) {
return;
switch (timer_process_mode) {
- case TIMER_PROCESS_FIXED:
- if (is_fixed_processing_internal()) {
- set_fixed_process_internal(false);
+ case TIMER_PROCESS_PHYSICS:
+ if (is_physics_processing_internal()) {
+ set_physics_process_internal(false);
set_process_internal(true);
}
break;
case TIMER_PROCESS_IDLE:
if (is_processing_internal()) {
set_process_internal(false);
- set_fixed_process_internal(true);
+ set_physics_process_internal(true);
}
break;
}
@@ -167,7 +167,7 @@ Timer::TimerProcessMode Timer::get_timer_process_mode() const {
void Timer::_set_process(bool p_process, bool p_force) {
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;
}
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, "autostart"), "set_autostart", "has_autostart");
- BIND_ENUM_CONSTANT(TIMER_PROCESS_FIXED);
+ BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS);
BIND_ENUM_CONSTANT(TIMER_PROCESS_IDLE);
}
diff --git a/scene/main/timer.h b/scene/main/timer.h
index 0cd92f12de..a02adbb0a3 100755
--- a/scene/main/timer.h
+++ b/scene/main/timer.h
@@ -50,7 +50,7 @@ protected:
public:
enum TimerProcessMode {
- TIMER_PROCESS_FIXED,
+ TIMER_PROCESS_PHYSICS,
TIMER_PROCESS_IDLE,
};
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index e19f2031dd..37a393b55b 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -456,10 +456,10 @@ void Viewport::_notification(int p_what) {
VS::get_singleton()->viewport_set_active(viewport, false);
} break;
- case NOTIFICATION_FIXED_PROCESS: {
+ case NOTIFICATION_PHYSICS_PROCESS: {
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) {
_gui_show_tooltip();
}
@@ -2453,7 +2453,7 @@ Rect2 Viewport::get_attach_to_screen_rect() const {
void Viewport::set_physics_object_picking(bool p_enable) {
physics_object_picking = p_enable;
- set_fixed_process(physics_object_picking);
+ set_physics_process(physics_object_picking);
if (!physics_object_picking)
physics_picking_events.clear();
}