From 1269a8d27cbce802fb99632deaa1250fac7a4c6f Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Tue, 21 Dec 2021 10:30:30 +0100 Subject: [PATCH] Introduce a factor for when the lakes are frozen over and use it to alter the fricton factor, bumpiness and load resistance factor --- simgear/bvh/BVHMaterial.hxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/simgear/bvh/BVHMaterial.hxx b/simgear/bvh/BVHMaterial.hxx index dd3cc862..1e105b26 100644 --- a/simgear/bvh/BVHMaterial.hxx +++ b/simgear/bvh/BVHMaterial.hxx @@ -37,11 +37,20 @@ public: bool get_solid () const { return _solid_is_prop ? _solid_property->getBoolValue() : _solid; } + + /** + * Return the solid factor for when the lakes are frozen over or not. + */ + double get_frozen_fact () const { + return _solid_is_prop ? (_solid_property->getBoolValue() ? 0.1 : 1.) : 1.; + } /** * Get the friction factor for that material */ - double get_friction_factor () const { return _friction_factor; } + double get_friction_factor () const { + return _friction_factor * get_frozen_fact(); + } /** * Get the rolling friction for that material @@ -51,12 +60,16 @@ public: /** * Get the bumpines for that material */ - double get_bumpiness () const { return _bumpiness; } + double get_bumpiness () const { + return _bumpiness * get_frozen_fact(); + } /** * Get the load resistance */ - double get_load_resistance () const { return _load_resistance; } + double get_load_resistance () const { + return _load_resistance / get_frozen_fact(); + } protected: // True if the material is solid, false if it is a fluid