From 8e9d56d3dec5bf47a873b1ff75c4a25eeef1d793 Mon Sep 17 00:00:00 2001 From: Dragos Daian Date: Tue, 23 Apr 2024 18:06:45 +0200 Subject: [PATCH] Add missing delete points method (#79) --- src/fluids/fluid_2d.cpp | 1 + src/rapier2d-wrapper/Cargo.toml | 10 +++-- .../includes/rapier2d_wrapper.h | 34 ----------------- src/rapier2d-wrapper/src/body.rs | 5 --- src/rapier2d-wrapper/src/convert.rs | 4 +- src/rapier2d-wrapper/src/fluid.rs | 37 +++++++++++++++---- src/rapier2d-wrapper/src/physics_world.rs | 18 +-------- src/rapier2d-wrapper/src/query.rs | 4 +- src/rapier2d-wrapper/src/settings.rs | 31 ---------------- src/servers/rapier_project_settings.cpp | 30 --------------- src/servers/rapier_project_settings.h | 7 ---- src/spaces/rapier_space_2d.cpp | 22 ++--------- src/spaces/rapier_space_2d.h | 7 ---- 13 files changed, 45 insertions(+), 165 deletions(-) diff --git a/src/fluids/fluid_2d.cpp b/src/fluids/fluid_2d.cpp index 9908e6cf..0e6bd367 100644 --- a/src/fluids/fluid_2d.cpp +++ b/src/fluids/fluid_2d.cpp @@ -215,6 +215,7 @@ void Fluid2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_debug_draw", "debug_draw"), &Fluid2D::set_debug_draw); ClassDB::bind_method(D_METHOD("get_debug_draw"), &Fluid2D::get_debug_draw); + ClassDB::bind_method(D_METHOD("delete_points", "indices"), &Fluid2D::delete_points); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug_draw"), "set_debug_draw", "get_debug_draw"); } diff --git a/src/rapier2d-wrapper/Cargo.toml b/src/rapier2d-wrapper/Cargo.toml index 5f5051a7..082ce793 100644 --- a/src/rapier2d-wrapper/Cargo.toml +++ b/src/rapier2d-wrapper/Cargo.toml @@ -20,13 +20,15 @@ serde-serialize = ["rapier2d/serde-serialize", "rapier2d-f64/serde-serialize"] parallel = ["rapier2d/parallel", "rapier2d-f64/parallel"] [dependencies] -rapier2d = {git = "https://github.com/dimforge/rapier", branch = "master"} -rapier2d-f64 = {git = "https://github.com/dimforge/rapier", branch = "master"} +rapier2d = {git = "https://github.com/dimforge/rapier", branch = "stability-improvements"} +rapier2d-f64 = {git = "https://github.com/dimforge/rapier", branch = "stability-improvements"} salva2d = { git = "https://github.com/dimforge/salva", branch = "master", features = ["rapier"] } [patch.crates-io] -rapier2d = {git = "https://github.com/dimforge/rapier", branch = "master"} -rapier2d-f64 = {git = "https://github.com/dimforge/rapier", branch = "master"} +rapier2d = {git = "https://github.com/dimforge/rapier", branch = "stability-improvements"} +rapier2d-f64 = {git = "https://github.com/dimforge/rapier", branch = "stability-improvements"} +parry2d = {git = "https://github.com/dimforge/parry", branch = "internal-edges-rework"} +parry2d-f64 = {git = "https://github.com/dimforge/parry", branch = "internal-edges-rework"} [profile.release] codegen-units = 1 diff --git a/src/rapier2d-wrapper/includes/rapier2d_wrapper.h b/src/rapier2d-wrapper/includes/rapier2d_wrapper.h index 054401d5..cab07f90 100644 --- a/src/rapier2d-wrapper/includes/rapier2d_wrapper.h +++ b/src/rapier2d-wrapper/includes/rapier2d_wrapper.h @@ -11,16 +11,6 @@ enum class BodyType { Static, }; -#if !defined(DEFINE_SPIN_NO_STD) -template -struct Lazy; -#endif - -#if defined(DEFINE_SPIN_NO_STD) -template -struct Lazy; -#endif - /// A feature id where the feature type is packed into the same value as the feature index. struct PackedFeatureId; @@ -92,10 +82,6 @@ struct QueryExcludedInfo { }; struct WorldSettings { - Real sleep_linear_threshold; - Real sleep_angular_threshold; - Real sleep_time_until_sleep; - Real solver_prediction_distance; size_t max_ccd_substeps; Real particle_radius; Real smoothing_factor; @@ -205,26 +191,6 @@ using CollisionModifyContactsCallback = OneWayDirection (*)(Handle world_handle, struct SimulationSettings { /// The timestep length (default: `1.0 / 60.0`) Real dt; - /// 0-1: multiplier for how much of the constraint violation (e.g. contact penetration) - /// will be compensated for during the velocity solve. - /// (default `0.8`). - Real erp; - /// 0-1: the damping ratio used by the springs for Baumgarte constraints stabilization. - /// Lower values make the constraints more compliant (more "springy", allowing more visible penetrations - /// before stabilization). - /// (default `0.25`). - Real damping_ratio; - /// 0-1: multiplier for how much of the joint violation - /// will be compensated for during the velocity solve. - /// (default `1.0`). - Real joint_erp; - /// The fraction of critical damping applied to the joint for constraints regularization. - /// (default `0.25`). - Real joint_damping_ratio; - /// Amount of penetration the engine wont attempt to correct (default: `0.001m`). - Real allowed_linear_error; - /// The maximal distance separating two objects that will generate predictive contacts (default: `0.002`). - Real prediction_distance; /// The number of solver iterations run by the constraints solver for calculating forces (default: `4`). size_t num_solver_iterations; /// Number of addition friction resolution iteration run during the last solver sub-step (default: `4`). diff --git a/src/rapier2d-wrapper/src/body.rs b/src/rapier2d-wrapper/src/body.rs index 54f38b37..2dd7959c 100644 --- a/src/rapier2d-wrapper/src/body.rs +++ b/src/rapier2d-wrapper/src/body.rs @@ -42,9 +42,6 @@ pub extern "C" fn body_create(world_handle : Handle, pixel_pos : &Vector, rot : } // let default values better let activation = rigid_body.activation_mut(); - activation.time_until_sleep = physics_world.sleep_time_until_sleep; - activation.linear_threshold = pixels_to_meters(physics_world.sleep_linear_threshold); - activation.angular_threshold = physics_world.sleep_angular_threshold; set_rigid_body_properties_internal(&mut rigid_body, pixel_pos, rot, true); rigid_body.user_data = user_data.get_data(); let body_handle = physics_world.rigid_body_set.insert(rigid_body); @@ -216,8 +213,6 @@ pub extern "C" fn body_set_can_sleep(world_handle : Handle, body_handle : Handle if can_sleep && body.activation().angular_threshold == -1.0 { let activation = body.activation_mut(); - activation.angular_threshold = physics_world.sleep_angular_threshold; - activation.linear_threshold = physics_world.sleep_linear_threshold; } else if !can_sleep && body.activation().angular_threshold != -1.0 { let activation = body.activation_mut(); activation.angular_threshold = -1.0; diff --git a/src/rapier2d-wrapper/src/convert.rs b/src/rapier2d-wrapper/src/convert.rs index 8f85ee40..a8bb54b4 100644 --- a/src/rapier2d-wrapper/src/convert.rs +++ b/src/rapier2d-wrapper/src/convert.rs @@ -1,9 +1,10 @@ use rapier2d::prelude::*; use crate::vector::Vector; -const PIXELS_PER_METER : Real = 100.0; +const PIXELS_PER_METER : Real = 1.0; pub fn pixels_to_meters(x : Real) -> Real { + return x; if x == 0.0 { 0.0 } else { x / PIXELS_PER_METER } } @@ -12,6 +13,7 @@ pub fn vector_pixels_to_meters(v : &Vector) -> Vector { } pub fn meters_to_pixels(x : Real) -> Real { + return x; x * PIXELS_PER_METER } diff --git a/src/rapier2d-wrapper/src/fluid.rs b/src/rapier2d-wrapper/src/fluid.rs index 6945e5a4..8203d83d 100644 --- a/src/rapier2d-wrapper/src/fluid.rs +++ b/src/rapier2d-wrapper/src/fluid.rs @@ -113,16 +113,39 @@ pub extern "C" fn fluid_delete_points(world_handle : Handle, fluid_handle: Handl let fluid = fluid.unwrap(); unsafe { let indexes_raw = std::slice::from_raw_parts(indexes, indexes_count); - for i in 0..indexes_raw.len() { - let index_raw = indexes_raw[i]; - if fluid.positions.len() <= index_raw { + // create mask from array of indexes + let mut mask = vec![false; fluid.positions.len()]; + for i in 0..indexes_count { + if fluid.positions.len() <= indexes_raw[i] { continue; } - fluid.positions.remove(index_raw); - fluid.velocities.remove(index_raw); - fluid.accelerations.remove(index_raw); - fluid.volumes.remove(index_raw); + mask[indexes_raw[i]] = true; } + let mut i = 0; + // remove all points that are not in the mask + fluid.positions.retain(|_| { + let delete = mask[i]; + i += 1; + !delete + }); + let mut i = 0; + fluid.velocities.retain(|_| { + let delete = mask[i]; + i += 1; + !delete + }); + let mut i = 0; + fluid.accelerations.retain(|_| { + let delete = mask[i]; + i += 1; + !delete + }); + let mut i = 0; + fluid.volumes.retain(|_| { + let delete = mask[i]; + i += 1; + !delete + }); } } diff --git a/src/rapier2d-wrapper/src/physics_world.rs b/src/rapier2d-wrapper/src/physics_world.rs index 051cf13c..25292a89 100644 --- a/src/rapier2d-wrapper/src/physics_world.rs +++ b/src/rapier2d-wrapper/src/physics_world.rs @@ -123,11 +123,6 @@ pub struct PhysicsWorld { pub multibody_joint_set : MultibodyJointSet, pub ccd_solver : CCDSolver, - pub sleep_linear_threshold: Real, - pub sleep_angular_threshold: Real, - pub sleep_time_until_sleep: Real, - pub solver_prediction_distance : Real, - pub active_body_callback : ActiveBodyCallback, pub collision_filter_body_callback : CollisionFilterCallback, pub collision_filter_sensor_callback : CollisionFilterCallback, @@ -159,11 +154,6 @@ impl PhysicsWorld { multibody_joint_set : MultibodyJointSet::new(), ccd_solver : CCDSolver::new(), - sleep_linear_threshold : settings.sleep_linear_threshold, - sleep_angular_threshold : settings.sleep_angular_threshold, - sleep_time_until_sleep : settings.sleep_time_until_sleep, - solver_prediction_distance :settings.solver_prediction_distance, - active_body_callback : None, collision_filter_body_callback : None, collision_filter_sensor_callback : None, @@ -187,13 +177,7 @@ impl PhysicsWorld { let mut integration_parameters = IntegrationParameters::default(); integration_parameters.dt = settings.dt; - integration_parameters.erp = settings.erp; integration_parameters.max_ccd_substeps = settings.max_ccd_substeps; - integration_parameters.damping_ratio = settings.damping_ratio; - integration_parameters.joint_erp = settings.joint_erp; - integration_parameters.joint_damping_ratio = settings.joint_damping_ratio; - integration_parameters.allowed_linear_error = settings.allowed_linear_error; - integration_parameters.prediction_distance = settings.prediction_distance; if settings.num_solver_iterations > 0 { integration_parameters.num_solver_iterations = NonZeroUsize::new(settings.num_solver_iterations).unwrap(); } @@ -331,7 +315,7 @@ impl PhysicsWorld { } contact_info.pixel_distance = meters_to_pixels(contact_point.dist); contact_info.pixel_impulse = meters_to_pixels(contact_point.data.impulse); - contact_info.pixel_tangent_impulse = meters_to_pixels(contact_point.data.tangent_impulse); + contact_info.pixel_tangent_impulse = meters_to_pixels(contact_point.data.tangent_impulse.x); send_contact_points = contact_callback(self.handle, &contact_info, &event_info); if !send_contact_points { diff --git a/src/rapier2d-wrapper/src/query.rs b/src/rapier2d-wrapper/src/query.rs index 93c7d11d..b4975929 100644 --- a/src/rapier2d-wrapper/src/query.rs +++ b/src/rapier2d-wrapper/src/query.rs @@ -432,10 +432,8 @@ pub extern "C" fn shapes_contact(world_handle : Handle, shape_info1 : ShapeInfo, let margin = pixels_to_meters(pixel_margin); let mut physics_engine = singleton().lock().unwrap(); - - let physics_world = physics_engine.get_world(world_handle); - let prediction = Real::max(physics_world.solver_prediction_distance, margin); + let prediction = Real::max(0.002, margin); let raw_shared_shape1 = physics_engine.get_shape(shape_info1.handle).clone(); let skewed_shape1 = skew_shape(&raw_shared_shape1, shape_info1.skew); diff --git a/src/rapier2d-wrapper/src/settings.rs b/src/rapier2d-wrapper/src/settings.rs index 3167947f..4d810c99 100644 --- a/src/rapier2d-wrapper/src/settings.rs +++ b/src/rapier2d-wrapper/src/settings.rs @@ -3,10 +3,6 @@ use crate::vector::Vector; #[repr(C)] pub struct WorldSettings { - pub sleep_linear_threshold: Real, - pub sleep_angular_threshold: Real, - pub sleep_time_until_sleep: Real, - pub solver_prediction_distance : Real, pub max_ccd_substeps: usize, pub particle_radius: Real, pub smoothing_factor: Real, @@ -15,10 +11,6 @@ pub struct WorldSettings { #[no_mangle] pub extern "C" fn default_world_settings() -> WorldSettings { WorldSettings { - sleep_linear_threshold : 0.1, - sleep_angular_threshold : 0.1, - sleep_time_until_sleep : 1.0, - solver_prediction_distance : 0.002, max_ccd_substeps: 1, particle_radius: 0.1, smoothing_factor: 2.0, @@ -30,29 +22,6 @@ pub struct SimulationSettings { /// The timestep length (default: `1.0 / 60.0`) pub dt: Real, - /// 0-1: multiplier for how much of the constraint violation (e.g. contact penetration) - /// will be compensated for during the velocity solve. - /// (default `0.8`). - pub erp: Real, - /// 0-1: the damping ratio used by the springs for Baumgarte constraints stabilization. - /// Lower values make the constraints more compliant (more "springy", allowing more visible penetrations - /// before stabilization). - /// (default `0.25`). - pub damping_ratio: Real, - - /// 0-1: multiplier for how much of the joint violation - /// will be compensated for during the velocity solve. - /// (default `1.0`). - pub joint_erp: Real, - - /// The fraction of critical damping applied to the joint for constraints regularization. - /// (default `0.25`). - pub joint_damping_ratio: Real, - - /// Amount of penetration the engine wont attempt to correct (default: `0.001m`). - pub allowed_linear_error: Real, - /// The maximal distance separating two objects that will generate predictive contacts (default: `0.002`). - pub prediction_distance: Real, /// The number of solver iterations run by the constraints solver for calculating forces (default: `4`). pub num_solver_iterations: usize, /// Number of addition friction resolution iteration run during the last solver sub-step (default: `4`). diff --git a/src/servers/rapier_project_settings.cpp b/src/servers/rapier_project_settings.cpp index b32e2423..b5f667e7 100644 --- a/src/servers/rapier_project_settings.cpp +++ b/src/servers/rapier_project_settings.cpp @@ -6,12 +6,6 @@ using namespace godot; constexpr char RUN_ON_SEPARATE_THREAD[] = "physics/2d/run_on_separate_thread"; constexpr char MAX_THREADS[] = "threading/worker_pool/max_threads"; -constexpr char SOLVER_ERP[] = "physics/rapier_2d/solver/erp"; -constexpr char SOLVER_DAMPING_RATIO[] = "physics/rapier_2d/solver/damping_ratio"; -constexpr char SOLVER_JOINT_ERP[] = "physics/rapier_2d/solver/joint_erp"; -constexpr char SOLVER_JOINT_DAMPING_RATIO[] = "physics/rapier_2d/solver/joint_damping_ratio"; -constexpr char SOLVER_ALLOWED_LINEAR_ERROR[] = "physics/rapier_2d/solver/allowed_linear_error"; -constexpr char SOLVER_PREDICTION_DISTANCE[] = "physics/rapier_2d/solver/prediction_distance"; constexpr char SOLVER_NUM_ITERATIONS[] = "physics/rapier_2d/solver/num_iterations"; constexpr char SOLVER_NUM_ADDITIONAL_FRICTION_ITERATIONS[] = "physics/rapier_2d/solver/num_additional_friction_iterations"; constexpr char SOLVER_NUM_INTERNAL_PGS_ITERATIONS[] = "physics/rapier_2d/solver/num_internal_pgs_iterations"; @@ -76,12 +70,6 @@ void register_setting_ranged( } void RapierProjectSettings::register_settings() { - register_setting_ranged(SOLVER_ERP, 0.6, U"0.00001,1,0.00001,suffix:%"); - register_setting_ranged(SOLVER_DAMPING_RATIO, 1.0, U"0.00001,1,0.00001,suffix:%"); - register_setting_ranged(SOLVER_JOINT_ERP, 1.0, U"0.00001,1,0.00001,suffix:%"); - register_setting_ranged(SOLVER_JOINT_DAMPING_RATIO, 1.0, U"0.0001,1,0.00001,suffix:%"); - register_setting_ranged(SOLVER_ALLOWED_LINEAR_ERROR, 0.001, U"0,1,0.00001"); - register_setting_ranged(SOLVER_PREDICTION_DISTANCE, 0.002, U"0,1,0.00001"); register_setting_ranged(SOLVER_NUM_INTERNAL_PGS_ITERATIONS, 1, U"1,4,or_greater"); register_setting_ranged(SOLVER_NUM_ADDITIONAL_FRICTION_ITERATIONS, 4, U"1,16,or_greater"); register_setting_ranged(SOLVER_NUM_ITERATIONS, 4, U"1,16,or_greater"); @@ -111,27 +99,9 @@ bool RapierProjectSettings::should_run_on_separate_thread() { int RapierProjectSettings::get_max_threads() { return get_setting(MAX_THREADS); } -double RapierProjectSettings::get_solver_erp() { - return get_setting(SOLVER_ERP); -} -double RapierProjectSettings::get_solver_damping_ratio() { - return get_setting(SOLVER_DAMPING_RATIO); -} -double RapierProjectSettings::get_solver_joint_erp() { - return get_setting(SOLVER_JOINT_ERP); -} -double RapierProjectSettings::get_solver_joint_damping_ratio() { - return get_setting(SOLVER_JOINT_DAMPING_RATIO); -} -double RapierProjectSettings::get_solver_allowed_linear_error() { - return get_setting(SOLVER_ALLOWED_LINEAR_ERROR); -} int RapierProjectSettings::get_solver_max_ccd_substeps() { return get_setting(SOLVER_MAX_CCD_SUBSTEPS); } -double RapierProjectSettings::get_solver_prediction_distance() { - return get_setting(SOLVER_PREDICTION_DISTANCE); -} int RapierProjectSettings::get_solver_num_solver_iterations() { return get_setting(SOLVER_NUM_ITERATIONS); } diff --git a/src/servers/rapier_project_settings.h b/src/servers/rapier_project_settings.h index 4bdc5dea..4019118f 100644 --- a/src/servers/rapier_project_settings.h +++ b/src/servers/rapier_project_settings.h @@ -12,13 +12,6 @@ class RapierProjectSettings { static bool should_run_on_separate_thread(); static int get_max_threads(); - static double get_solver_erp(); - static double get_solver_damping_ratio(); - static double get_solver_joint_erp(); - static double get_solver_joint_damping_ratio(); - static double get_solver_allowed_linear_error(); - static double get_solver_max_penetration_correction(); - static double get_solver_prediction_distance(); static int get_solver_num_solver_iterations(); static int get_solver_num_additional_friction_iterations(); static int get_solver_num_internal_pgs_iterations(); diff --git a/src/spaces/rapier_space_2d.cpp b/src/spaces/rapier_space_2d.cpp index 2e4559af..d47fccdb 100644 --- a/src/spaces/rapier_space_2d.cpp +++ b/src/spaces/rapier_space_2d.cpp @@ -443,12 +443,6 @@ void RapierSpace2D::step(real_t p_step) { settings.pixel_gravity.x = default_gravity_dir.x * default_gravity_value; settings.pixel_gravity.y = default_gravity_dir.y * default_gravity_value; settings.max_ccd_substeps = RapierProjectSettings::get_solver_max_ccd_substeps(); - settings.allowed_linear_error = RapierProjectSettings::get_solver_allowed_linear_error(); - settings.damping_ratio = RapierProjectSettings::get_solver_damping_ratio(); - settings.erp = RapierProjectSettings::get_solver_erp(); - settings.joint_damping_ratio = RapierProjectSettings::get_solver_joint_damping_ratio(); - settings.joint_erp = RapierProjectSettings::get_solver_joint_erp(); - settings.prediction_distance = RapierProjectSettings::get_solver_prediction_distance(); settings.num_additional_friction_iterations = RapierProjectSettings::get_solver_num_additional_friction_iterations(); settings.num_internal_pgs_iterations = RapierProjectSettings::get_solver_num_internal_pgs_iterations(); settings.num_solver_iterations = RapierProjectSettings::get_solver_num_solver_iterations(); @@ -525,13 +519,10 @@ void RapierSpace2D::set_param(PhysicsServer2D::SpaceParameter p_param, real_t p_ contact_bias = p_value; break; case PhysicsServer2D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: - body_linear_velocity_sleep_threshold = p_value; break; case PhysicsServer2D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: - body_angular_velocity_sleep_threshold = p_value; break; case PhysicsServer2D::SPACE_PARAM_BODY_TIME_TO_SLEEP: - body_time_to_sleep = p_value; break; case PhysicsServer2D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: constraint_bias = p_value; @@ -553,11 +544,11 @@ real_t RapierSpace2D::get_param(PhysicsServer2D::SpaceParameter p_param) const { case PhysicsServer2D::SPACE_PARAM_CONTACT_DEFAULT_BIAS: return contact_bias; case PhysicsServer2D::SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: - return body_linear_velocity_sleep_threshold; + return 0.0; case PhysicsServer2D::SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: - return body_angular_velocity_sleep_threshold; + return 0.0; case PhysicsServer2D::SPACE_PARAM_BODY_TIME_TO_SLEEP: - return body_time_to_sleep; + return 0.0; case PhysicsServer2D::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: return constraint_bias; case PhysicsServer2D::SPACE_PARAM_SOLVER_ITERATIONS: @@ -637,9 +628,6 @@ RapierSpace2D::RapierSpace2D() { int physics_fps = project_settings->get_setting_with_override("physics/common/physics_ticks_per_second"); last_step = physics_fps ? 1.0f / (real_t)physics_fps : 0.001f; - body_linear_velocity_sleep_threshold = project_settings->get_setting_with_override("physics/2d/sleep_threshold_linear"); - body_angular_velocity_sleep_threshold = project_settings->get_setting_with_override("physics/2d/sleep_threshold_angular"); - body_time_to_sleep = project_settings->get_setting_with_override("physics/2d/time_before_sleep"); solver_iterations = project_settings->get_setting_with_override("physics/2d/solver/solver_iterations"); contact_recycle_radius = project_settings->get_setting_with_override("physics/2d/solver/contact_recycle_radius"); contact_max_separation = project_settings->get_setting_with_override("physics/2d/solver/contact_max_separation"); @@ -653,10 +641,6 @@ RapierSpace2D::RapierSpace2D() { ERR_FAIL_COND(is_handle_valid(handle)); rapier2d::WorldSettings world_settings = rapier2d::default_world_settings(); - world_settings.sleep_linear_threshold = body_linear_velocity_sleep_threshold; - world_settings.sleep_angular_threshold = body_angular_velocity_sleep_threshold; - world_settings.sleep_time_until_sleep = body_time_to_sleep; - world_settings.solver_prediction_distance = RapierProjectSettings::get_solver_prediction_distance(); world_settings.particle_radius = RapierProjectSettings::get_fluid_particle_radius(); world_settings.smoothing_factor = RapierProjectSettings::get_fluid_smoothing_factor(); handle = rapier2d::world_create(&world_settings); diff --git a/src/spaces/rapier_space_2d.h b/src/spaces/rapier_space_2d.h index ee027425..7a0de168 100644 --- a/src/spaces/rapier_space_2d.h +++ b/src/spaces/rapier_space_2d.h @@ -53,10 +53,6 @@ class RapierSpace2D { real_t contact_bias = 0.0; real_t constraint_bias = 0.0; - real_t body_linear_velocity_sleep_threshold = 0.0; - real_t body_angular_velocity_sleep_threshold = 0.0; - real_t body_time_to_sleep = 0.0; - Vector2 fluid_default_gravity_dir = Vector2(0.0, -1.0); real_t fluid_default_gravity_value = -9.81; @@ -128,9 +124,6 @@ class RapierSpace2D { _FORCE_INLINE_ real_t get_contact_max_allowed_penetration() const { return contact_max_allowed_penetration; } _FORCE_INLINE_ real_t get_contact_bias() const { return contact_bias; } _FORCE_INLINE_ real_t get_constraint_bias() const { return constraint_bias; } - _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_threshold() const { return body_linear_velocity_sleep_threshold; } - _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_threshold() const { return body_angular_velocity_sleep_threshold; } - _FORCE_INLINE_ real_t get_body_time_to_sleep() const { return body_time_to_sleep; } void step(real_t p_step); void call_queries();