diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 12 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.h | 2 | ||||
-rw-r--r-- | scene/3d/camera.cpp | 4 | ||||
-rw-r--r-- | scene/3d/camera.h | 2 | ||||
-rw-r--r-- | scene/3d/immediate_geometry.h | 2 | ||||
-rw-r--r-- | scene/3d/interpolated_camera.cpp | 2 | ||||
-rw-r--r-- | scene/3d/physics_body.cpp | 2 | ||||
-rw-r--r-- | scene/3d/ray_cast.cpp | 10 | ||||
-rw-r--r-- | scene/3d/spatial_velocity_tracker.cpp | 28 | ||||
-rw-r--r-- | scene/3d/spatial_velocity_tracker.h | 6 | ||||
-rw-r--r-- | scene/3d/vehicle_body.cpp | 7 | ||||
-rw-r--r-- | scene/3d/vehicle_body.h | 2 |
12 files changed, 44 insertions, 35 deletions
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/immediate_geometry.h b/scene/3d/immediate_geometry.h index 6db825bf54..93ef726c6d 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -38,7 +38,7 @@ class ImmediateGeometry : public GeometryInstance { GDCLASS(ImmediateGeometry, GeometryInstance); RID im; - //a list of texures drawn need to be kept, to avoid references + //a list of textures drawn need to be kept, to avoid references // in VisualServer from becoming invalid if the texture is no longer used List<Ref<Texture> > cached_textures; bool empty; 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/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 3518113130..a072572142 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -267,6 +267,8 @@ void VehicleWheel::_bind_methods() { ClassDB::bind_method(D_METHOD("set_roll_influence", "roll_influence"), &VehicleWheel::set_roll_influence); ClassDB::bind_method(D_METHOD("get_roll_influence"), &VehicleWheel::get_roll_influence); + ClassDB::bind_method(D_METHOD("get_skidinfo"), &VehicleWheel::get_skidinfo); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_traction"), "set_use_as_traction", "is_used_as_traction"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_as_steering"), "set_use_as_steering", "is_used_as_steering"); ADD_GROUP("Wheel", "wheel_"); @@ -303,6 +305,11 @@ bool VehicleWheel::is_used_as_steering() const { return steers; } +float VehicleWheel::get_skidinfo() const { + + return m_skidInfo; +} + VehicleWheel::VehicleWheel() { steers = false; diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index eb661adb90..c642eb61b8 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -131,6 +131,8 @@ public: void set_roll_influence(float p_value); float get_roll_influence() const; + float get_skidinfo() const; + String get_configuration_warning() const; VehicleWheel(); |