From ee9ca74131f896a1c26cfc7c7af7c71e659b408b Mon Sep 17 00:00:00 2001 From: Vladimir Mitin <52578967+DerTROLLMAN@users.noreply.github.com> Date: Fri, 18 Sep 2026 05:59:26 +0300 Subject: [PATCH] Restore material-based wheel damping Expose material damping through the IVP material interface and restore its use in vehicle wheel friction. Apply the damping value from the active physics material to wheel objects, restoring material-dependent wheel behavior. --- ivp_intern/ivp_friction.cxx | 13 +++++++++++++ ivp_physics/ivp_material.hxx | 1 + 2 files changed, 14 insertions(+) diff --git a/ivp_intern/ivp_friction.cxx b/ivp_intern/ivp_friction.cxx index 6f364810..004f3e01 100644 --- a/ivp_intern/ivp_friction.cxx +++ b/ivp_intern/ivp_friction.cxx @@ -260,6 +260,19 @@ void IVP_Contact_Point::static_friction_single(const IVP_Event_Sim *es, bool IVP_Contact_Point::friction_force_local_constraint_2d_wheel( IVP_Core *core_a, IVP_Impact_Solver_Long_Term *info, const IVP_Event_Sim *es, IVP_FLOAT &flEnergy) { + // Apply material-based damping to vehicle wheels. + IVP_Material* materials[2]; + get_material_info(materials); + + const IVP_DOUBLE damping = materials[1]->get_damping(); + + if (damping != 0.0) { + IVP_U_Float_Point rotation_damping; + rotation_damping.set_to_zero(); + + core_a->damp_object(es->delta_time, &rotation_damping, damping); + } + IVP_Constraint_Car_Object *wheel = core_a->car_wheel; IVP_Constraint_Solver_Car *solver = wheel->solver_car; diff --git a/ivp_physics/ivp_material.hxx b/ivp_physics/ivp_material.hxx index 5e274fc1..ae027368 100644 --- a/ivp_physics/ivp_material.hxx +++ b/ivp_physics/ivp_material.hxx @@ -48,6 +48,7 @@ class IVP_Material { get_second_friction_factor() = 0; // second friction factor when two friction // values is enabled virtual IVP_DOUBLE get_elasticity() = 0; + virtual IVP_DOUBLE get_damping() { return 0.0; } // INTERN_START virtual IVP_DOUBLE get_adhesion() = 0; // for future releases // INTERN_END