diff options
author | Andreas Haas <Hinsbart@users.noreply.github.com> | 2017-10-02 23:10:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 23:10:36 +0200 |
commit | 5303efb2fabd668bef18b7ac7606426692e5d6bb (patch) | |
tree | b699146047e60501afbfa09c36161d8ae408a223 /scene | |
parent | 1e9465096d9c738057aad81d5046b85777155f87 (diff) | |
parent | 4537977d6dd2a76580d9ab611a18634efab55c74 (diff) |
Merge pull request #11659 from AndreaCatania/prephysics
Renamed fixed_process to physics_process
Diffstat (limited to 'scene')
34 files changed, 194 insertions, 194 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index c40aeb764e..73e633139b 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -113,7 +113,7 @@ void AudioStreamPlayer2D::_notification(int p_what) { 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 @@ -203,7 +203,7 @@ void AudioStreamPlayer2D::_notification(int p_what) { //stop playing if no longer 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) //_change_notify("playing"); //update property in editor emit_signal("finished"); @@ -255,7 +255,7 @@ void AudioStreamPlayer2D::play(float p_from_pos) { if (stream_playback.is_valid()) { setplay = p_from_pos; 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()) { active = false; - set_fixed_process_internal(false); + set_physics_process_internal(false); setplay = -1; } } diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 0d04967f1c..4fcd6893b8 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -138,7 +138,7 @@ Transform2D Camera2D::get_camera_transform() { 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; ret_camera_pos = smoothed_camera_pos; //camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; @@ -212,14 +212,14 @@ void Camera2D::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_PHYSICS_PROCESS: { _update_scroll(); } break; case NOTIFICATION_TRANSFORM_CHANGED: { - if (!is_fixed_processing()) + if (!is_physics_processing()) _update_scroll(); } break; @@ -241,7 +241,7 @@ void Camera2D::_notification(int p_what) { add_to_group(canvas_group_name); if (Engine::get_singleton()->is_editor_hint()) { - set_fixed_process(false); + set_physics_process(false); } _update_scroll(); @@ -498,9 +498,9 @@ void Camera2D::set_follow_smoothing(float p_speed) { smoothing = p_speed; if (smoothing > 0 && !(is_inside_tree() && Engine::get_singleton()->is_editor_hint())) - set_fixed_process(true); + set_physics_process(true); else - set_fixed_process(false); + set_physics_process(false); } float Camera2D::get_follow_smoothing() const { diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index c6cd3677cd..d3b37ae903 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -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 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; on_floor = false; diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index f90331c411..b272da46f8 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -95,7 +95,7 @@ void RayCast2D::set_enabled(bool p_enabled) { enabled = p_enabled; if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) - set_fixed_process(p_enabled); + set_physics_process(p_enabled); if (!p_enabled) collided = false; } @@ -135,9 +135,9 @@ void RayCast2D::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { if (enabled && !Engine::get_singleton()->is_editor_hint()) - set_fixed_process(true); + set_physics_process(true); else - set_fixed_process(false); + set_physics_process(false); if (Object::cast_to<PhysicsBody2D>(get_parent())) { if (exclude_parent_body) @@ -149,7 +149,7 @@ void RayCast2D::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { if (enabled) - set_fixed_process(false); + set_physics_process(false); } break; @@ -177,7 +177,7 @@ void RayCast2D::_notification(int p_what) { } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_PHYSICS_PROCESS: { if (!enabled) break; diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 8fc8b65217..ca7b6aa0e4 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -154,8 +154,8 @@ void VisibilityEnabler2D::_screen_enter() { _change_node_state(E->key(), true); } - if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent()) - get_parent()->set_fixed_process(true); + if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) + get_parent()->set_physics_process(true); if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) get_parent()->set_process(true); @@ -169,8 +169,8 @@ void VisibilityEnabler2D::_screen_exit() { _change_node_state(E->key(), false); } - if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent()) - get_parent()->set_fixed_process(false); + if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) + get_parent()->set_physics_process(false); if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) get_parent()->set_process(false); @@ -246,8 +246,8 @@ void VisibilityEnabler2D::_notification(int p_what) { _find_nodes(from); - if (enabler[ENABLER_PARENT_FIXED_PROCESS] && get_parent()) - get_parent()->set_fixed_process(false); + if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) + get_parent()->set_physics_process(false); if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) 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_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, "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_PAUSE_ANIMATIONS); BIND_ENUM_CONSTANT(ENABLER_PAUSE_PARTICLES); BIND_ENUM_CONSTANT(ENABLER_PAUSE_ANIMATED_SPRITES); 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); } @@ -366,7 +366,7 @@ VisibilityEnabler2D::VisibilityEnabler2D() { for (int i = 0; i < ENABLER_MAX; i++) enabler[i] = true; enabler[ENABLER_PARENT_PROCESS] = false; - enabler[ENABLER_PARENT_FIXED_PROCESS] = false; + enabler[ENABLER_PARENT_PHYSICS_PROCESS] = false; visible = false; } diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h index ef0e1affd3..ee5152978b 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visibility_notifier_2d.h @@ -74,7 +74,7 @@ public: ENABLER_FREEZE_BODIES, ENABLER_PAUSE_PARTICLES, ENABLER_PARENT_PROCESS, - ENABLER_PARENT_FIXED_PROCESS, + ENABLER_PARENT_PHYSICS_PROCESS, ENABLER_PAUSE_ANIMATED_SPRITES, ENABLER_MAX }; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 7bc8c9e89e..3c92814c87 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -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 @@ -512,7 +512,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { //stop playing if no longer 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) //_change_notify("playing"); //update property in editor emit_signal("finished"); @@ -582,7 +582,7 @@ void AudioStreamPlayer3D::play(float p_from_pos) { if (stream_playback.is_valid()) { setplay = p_from_pos; 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()) { active = false; - set_fixed_process_internal(false); + set_physics_process_internal(false); setplay = -1; } } @@ -776,7 +776,7 @@ void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) { if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { 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); } else { set_notify_transform(false); @@ -880,7 +880,7 @@ void AudioStreamPlayer3D::_bind_methods() { BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED); 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")); } diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index 2c2d4610c8..5982d7a3ac 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -26,7 +26,7 @@ public: enum DopplerTracking { DOPPLER_TRACKING_DISABLED, DOPPLER_TRACKING_IDLE_STEP, - DOPPLER_TRACKING_FIXED_STEP + DOPPLER_TRACKING_PHYSICS_STEP }; private: diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 02a7845e0b..7baf9a9deb 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -507,7 +507,7 @@ void Camera::set_doppler_tracking(DopplerTracking p_tracking) { doppler_tracking = p_tracking; 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); } } @@ -557,7 +557,7 @@ void Camera::_bind_methods() { BIND_ENUM_CONSTANT(DOPPLER_TRACKING_DISABLED) 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 { diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 243a7b9b39..3a725eaf66 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -56,7 +56,7 @@ public: enum DopplerTracking { DOPPLER_TRACKING_DISABLED, DOPPLER_TRACKING_IDLE_STEP, - DOPPLER_TRACKING_FIXED_STEP + DOPPLER_TRACKING_PHYSICS_STEP }; private: diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index 0f281b694d..3ff8317732 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -37,7 +37,7 @@ void InterpolatedCamera::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { if (Engine::get_singleton()->is_editor_hint() && enabled) - set_fixed_process(false); + set_physics_process(false); } break; case NOTIFICATION_PROCESS: { diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 005ea1f8d1..d7fdf94d40 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -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 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; on_floor = false; diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 72b7706b77..df6764ee1a 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -97,7 +97,7 @@ void RayCast::set_enabled(bool p_enabled) { enabled = p_enabled; if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) - set_fixed_process(p_enabled); + set_physics_process(p_enabled); if (!p_enabled) collided = false; @@ -121,25 +121,25 @@ void RayCast::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { if (enabled && !Engine::get_singleton()->is_editor_hint()) { - set_fixed_process(true); + set_physics_process(true); if (get_tree()->is_debugging_collisions_hint()) _update_debug_shape(); } else - set_fixed_process(false); + set_physics_process(false); } break; case NOTIFICATION_EXIT_TREE: { if (enabled) { - set_fixed_process(false); + set_physics_process(false); } if (debug_shape) _clear_debug_shape(); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_PHYSICS_PROCESS: { if (!enabled) break; diff --git a/scene/3d/spatial_velocity_tracker.cpp b/scene/3d/spatial_velocity_tracker.cpp index dc822d0446..1c7423e645 100644 --- a/scene/3d/spatial_velocity_tracker.cpp +++ b/scene/3d/spatial_velocity_tracker.cpp @@ -1,21 +1,21 @@ #include "spatial_velocity_tracker.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) { PositionHistory ph; ph.position = p_position; - if (fixed_step) { - ph.frame = Engine::get_singleton()->get_fixed_frames(); + if (physics_step) { + ph.frame = Engine::get_singleton()->get_physics_frames(); } else { 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; if (position_history_len) { - if (fixed_step) { - uint64_t base = Engine::get_singleton()->get_fixed_frames(); + if (physics_step) { + uint64_t base = Engine::get_singleton()->get_physics_frames(); base_time = float(base - position_history[0].frame) / Engine::get_singleton()->get_iterations_per_second(); } else { 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; 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(); } else { delta = double(diff) / 1000000.0; @@ -78,8 +78,8 @@ void SpatialVelocityTracker::reset(const Vector3 &p_new_pos) { PositionHistory ph; ph.position = p_new_pos; - if (fixed_step) { - ph.frame = Engine::get_singleton()->get_fixed_frames(); + if (physics_step) { + ph.frame = Engine::get_singleton()->get_physics_frames(); } else { 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() { - ClassDB::bind_method(D_METHOD("set_track_fixed_step", "enable"), &SpatialVelocityTracker::set_track_fixed_step); - ClassDB::bind_method(D_METHOD("is_tracking_fixed_step"), &SpatialVelocityTracker::is_tracking_fixed_step); + ClassDB::bind_method(D_METHOD("set_track_physics_step", "enable"), &SpatialVelocityTracker::set_track_physics_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("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity); ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset); @@ -100,5 +100,5 @@ void SpatialVelocityTracker::_bind_methods() { SpatialVelocityTracker::SpatialVelocityTracker() { position_history.resize(4); // should be configurable position_history_len = 0; - fixed_step = false; + physics_step = false; } diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h index b8237613a7..c4371ff1f7 100644 --- a/scene/3d/spatial_velocity_tracker.h +++ b/scene/3d/spatial_velocity_tracker.h @@ -11,7 +11,7 @@ class SpatialVelocityTracker : public Reference { Vector3 position; }; - bool fixed_step; + bool physics_step; Vector<PositionHistory> position_history; int position_history_len; @@ -20,8 +20,8 @@ protected: public: void reset(const Vector3 &p_new_pos); - void set_track_fixed_step(bool p_track_fixed_step); - bool is_tracking_fixed_step() const; + void set_track_physics_step(bool p_track_physics_step); + bool is_tracking_physics_step() const; void update_position(const Vector3 &p_position); Vector3 get_tracked_linear_velocity() const; diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index cadbd086bc..a38bee1b43 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -192,7 +192,7 @@ void AnimationPlayer::_notification(int p_what) { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set - set_fixed_process(false); + set_physics_process(false); set_process(false); } //_set_process(false); @@ -207,19 +207,19 @@ void AnimationPlayer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (animation_process_mode == ANIMATION_PROCESS_FIXED) + if (animation_process_mode == ANIMATION_PROCESS_PHYSICS) break; if (processing) _animation_process(get_process_delta_time()); } break; - case NOTIFICATION_INTERNAL_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { if (animation_process_mode == ANIMATION_PROCESS_IDLE) break; if (processing) - _animation_process(get_fixed_process_delta_time()); + _animation_process(get_physics_process_delta_time()); } break; case NOTIFICATION_EXIT_TREE: { @@ -1140,7 +1140,7 @@ void AnimationPlayer::_set_process(bool p_process, bool p_force) { 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; } @@ -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_started", PropertyInfo(Variant::STRING, "name"))); - BIND_ENUM_CONSTANT(ANIMATION_PROCESS_FIXED); + BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE); } diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index bface7aabb..83da3b2e5c 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -44,7 +44,7 @@ class AnimationPlayer : public Node { public: enum AnimationProcessMode { - ANIMATION_PROCESS_FIXED, + ANIMATION_PROCESS_PHYSICS, ANIMATION_PROCESS_IDLE, }; diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index a2a8adb653..d564671bcf 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -56,7 +56,7 @@ void AnimationTreePlayer::_set_process(bool p_process, bool p_force) { 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; } @@ -405,7 +405,7 @@ void AnimationTreePlayer::_notification(int p_what) { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set - set_fixed_process_internal(false); + set_physics_process_internal(false); set_process_internal(false); } } break; @@ -416,19 +416,19 @@ void AnimationTreePlayer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (animation_process_mode == ANIMATION_PROCESS_FIXED) + if (animation_process_mode == ANIMATION_PROCESS_PHYSICS) break; if (processing) _process_animation(get_process_delta_time()); } break; - case NOTIFICATION_INTERNAL_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { if (animation_process_mode == ANIMATION_PROCESS_IDLE) break; if (processing) - _process_animation(get_fixed_process_delta_time()); + _process_animation(get_physics_process_delta_time()); } break; } } @@ -1809,7 +1809,7 @@ void AnimationTreePlayer::_bind_methods() { BIND_ENUM_CONSTANT(NODE_TIMESEEK); BIND_ENUM_CONSTANT(NODE_TRANSITION); - BIND_ENUM_CONSTANT(ANIMATION_PROCESS_FIXED); + BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE); } diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 806a4f6604..3e2bb88198 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -42,7 +42,7 @@ class AnimationTreePlayer : public Node { public: enum AnimationProcessMode { - ANIMATION_PROCESS_FIXED, + ANIMATION_PROCESS_PHYSICS, ANIMATION_PROCESS_IDLE, }; diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index fb61c43d5c..fb327191b9 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -152,7 +152,7 @@ void Tween::_notification(int p_what) { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set - set_fixed_process_internal(false); + set_physics_process_internal(false); set_process_internal(false); } } break; @@ -160,19 +160,19 @@ void Tween::_notification(int p_what) { } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (tween_process_mode == TWEEN_PROCESS_FIXED) + if (tween_process_mode == TWEEN_PROCESS_PHYSICS) break; if (processing) _tween_process(get_process_delta_time()); } break; - case NOTIFICATION_INTERNAL_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { if (tween_process_mode == TWEEN_PROCESS_IDLE) break; if (processing) - _tween_process(get_fixed_process_delta_time()); + _tween_process(get_physics_process_delta_time()); } break; 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"); - BIND_ENUM_CONSTANT(TWEEN_PROCESS_FIXED); + BIND_ENUM_CONSTANT(TWEEN_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(TWEEN_PROCESS_IDLE); BIND_ENUM_CONSTANT(TRANS_LINEAR); @@ -642,7 +642,7 @@ void Tween::_set_process(bool p_process, bool p_force) { 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; } diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 929d63a7fc..fac1d346b4 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -38,7 +38,7 @@ class Tween : public Node { public: enum TweenProcessMode { - TWEEN_PROCESS_FIXED, + TWEEN_PROCESS_PHYSICS, TWEEN_PROCESS_IDLE, }; diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 6044b86ef5..c5ffec2d5e 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -113,7 +113,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { if (smooth_scroll_enabled) { scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { set_value(target_scroll); } @@ -137,7 +137,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) { if (smooth_scroll_enabled) { scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { set_value(target_scroll); } @@ -335,13 +335,13 @@ void ScrollBar::_notification(int p_what) { drag_slave = NULL; } - if (p_what == NOTIFICATION_FIXED_PROCESS) { + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { if (scrolling) { if (get_value() != target_scroll) { double target = target_scroll - get_value(); 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) { set_value(target_scroll); @@ -350,14 +350,14 @@ void ScrollBar::_notification(int p_what) { } } else { scrolling = false; - set_fixed_process(false); + set_physics_process(false); } } else if (drag_slave_touching) { if (drag_slave_touching_deaccel) { 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; @@ -377,7 +377,7 @@ void ScrollBar::_notification(int p_what) { float sgn_x = drag_slave_speed.x < 0 ? -1 : 1; 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) { turnoff = true; @@ -401,7 +401,7 @@ void ScrollBar::_notification(int p_what) { float sgn_y = drag_slave_speed.y < 0 ? -1 : 1; 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) { turnoff = true; @@ -410,7 +410,7 @@ void ScrollBar::_notification(int p_what) { } if (turnoff) { - set_fixed_process(false); + set_physics_process(false); drag_slave_touching = 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; 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 (drag_slave_touching) { - set_fixed_process(false); + set_physics_process(false); drag_slave_touching_deaccel = false; drag_slave_touching = false; drag_slave_speed = Vector2(); @@ -599,7 +599,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) { drag_slave_touching_deaccel = false; time_since_motion = 0; if (drag_slave_touching) { - set_fixed_process(true); + set_physics_process(true); time_since_motion = 0; } } @@ -611,7 +611,7 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) { if (drag_slave_speed == Vector2()) { drag_slave_touching_deaccel = false; drag_slave_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_slave_touching_deaccel = true; diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index c71093b947..1ad1e3f638 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -67,7 +67,7 @@ Size2 ScrollContainer::get_minimum_size() const { }; void ScrollContainer::_cancel_drag() { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = Vector2(); @@ -121,7 +121,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { if (mb->is_pressed()) { if (drag_touching) { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = Vector2(); @@ -139,7 +139,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { drag_touching_deaccel = false; time_since_motion = 0; if (drag_touching) { - set_fixed_process(true); + set_physics_process(true); time_since_motion = 0; } } @@ -150,7 +150,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) { if (drag_speed == Vector2()) { drag_touching_deaccel = false; drag_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_touching_deaccel = true; @@ -257,14 +257,14 @@ void ScrollContainer::_notification(int p_what) { update_scrollbars(); } - if (p_what == NOTIFICATION_FIXED_PROCESS) { + if (p_what == NOTIFICATION_PHYSICS_PROCESS) { if (drag_touching) { if (drag_touching_deaccel) { 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_v = false; @@ -294,7 +294,7 @@ void ScrollContainer::_notification(int p_what) { float sgn_x = drag_speed.x < 0 ? -1 : 1; 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) { turnoff_h = true; @@ -302,7 +302,7 @@ void ScrollContainer::_notification(int p_what) { float sgn_y = drag_speed.y < 0 ? -1 : 1; 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) { turnoff_v = true; @@ -311,7 +311,7 @@ void ScrollContainer::_notification(int p_what) { drag_speed = Vector2(sgn_x * val_x, sgn_y * val_y); if (turnoff_h && turnoff_v) { - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -322,10 +322,10 @@ void ScrollContainer::_notification(int p_what) { Vector2 diff = drag_accum - last_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(); } } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 11bdbfc3e8..d14d3ef947 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -428,22 +428,22 @@ void TextEdit::_notification(int p_what) { draw_caret = false; update(); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_PHYSICS_PROCESS: { if (scrolling && v_scroll->get_value() != target_v_scroll) { double target_y = target_v_scroll - v_scroll->get_value(); 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) { v_scroll->set_value(target_v_scroll); scrolling = false; - set_fixed_process(false); + set_physics_process(false); } else { v_scroll->set_value(v_scroll->get_value() + vel); } } else { scrolling = false; - set_fixed_process(false); + set_physics_process(false); } } break; case NOTIFICATION_DRAW: { @@ -1610,7 +1610,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { target_v_scroll = 0; } scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { v_scroll->set_value(target_v_scroll); } @@ -1632,7 +1632,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { target_v_scroll = max_v_scroll; } scrolling = true; - set_fixed_process(true); + set_physics_process(true); } else { v_scroll->set_value(target_v_scroll); } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 613e5520a9..178a1c272b 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2493,7 +2493,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (drag_speed == 0) { drag_touching_deaccel = false; drag_touching = false; - set_fixed_process(false); + set_physics_process(false); } else { drag_touching_deaccel = true; @@ -2559,7 +2559,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { break; if (drag_touching) { - set_fixed_process(false); + set_physics_process(false); drag_touching_deaccel = false; drag_touching = false; drag_speed = 0; @@ -2574,7 +2574,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { drag_touching = OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel = false; if (drag_touching) { - set_fixed_process(true); + set_physics_process(true); } } @@ -2765,7 +2765,7 @@ void Tree::_notification(int p_what) { drop_mode_flags = 0; scrolling = false; - set_fixed_process(false); + set_physics_process(false); update(); } if (p_what == NOTIFICATION_DRAG_BEGIN) { @@ -2773,23 +2773,23 @@ void Tree::_notification(int p_what) { single_select_defer = NULL; if (cache.scroll_speed > 0 && get_rect().has_point(get_viewport()->get_mouse_position() - get_global_position())) { 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_deaccel) { 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; if (pos < 0) { pos = 0; turnoff = true; - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -2801,7 +2801,7 @@ void Tree::_notification(int p_what) { v_scroll->set_value(pos); float sgn = drag_speed < 0 ? -1 : 1; float val = Math::abs(drag_speed); - val -= 1000 * get_fixed_process_delta_time(); + val -= 1000 * get_physics_process_delta_time(); if (val < 0) { turnoff = true; @@ -2809,7 +2809,7 @@ void Tree::_notification(int p_what) { drag_speed = sgn * val; if (turnoff) { - set_fixed_process(false); + set_physics_process(false); drag_touching = false; drag_touching_deaccel = false; } @@ -2834,7 +2834,7 @@ void Tree::_notification(int p_what) { } else { point.y = 0; } - point *= cache.scroll_speed * get_fixed_process_delta_time(); + point *= cache.scroll_speed * get_physics_process_delta_time(); point += get_scroll(); h_scroll->set_value(point.x); v_scroll->set_value(point.y); 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(); } diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 6b7168a529..d9770ec3f3 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -87,7 +87,7 @@ SceneStringNames::SceneStringNames() { _get_gizmo_geometry = StaticCString::create("_get_gizmo_geometry"); _can_gizmo_scale = StaticCString::create("_can_gizmo_scale"); - _fixed_process = StaticCString::create("_fixed_process"); + _physics_process = StaticCString::create("_physics_process"); _process = StaticCString::create("_process"); _enter_tree = StaticCString::create("_enter_tree"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 8676b8436e..3b110e7a62 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -106,7 +106,7 @@ public: StringName _get_gizmo_geometry; StringName _can_gizmo_scale; - StringName _fixed_process; + StringName _physics_process; StringName _process; StringName _enter_world; StringName _exit_world; |