From e95fe66dd506dac7455a61654ff0af778ac6016f Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 17 Apr 2009 04:38:31 +0000 Subject: * Set some minimum values to avoid divide by zero errors. --- OpenSim/Region/Physics/OdePlugin/ODEVehicleSettings.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEVehicleSettings.cs b/OpenSim/Region/Physics/OdePlugin/ODEVehicleSettings.cs index 3a99b48..12b623d 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEVehicleSettings.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEVehicleSettings.cs @@ -91,24 +91,31 @@ namespace OpenSim.Region.Physics.OdePlugin switch (pParam) { case Vehicle.ANGULAR_DEFLECTION_EFFICIENCY: + if (pValue < 0.01f) pValue = 0.01f; m_angularDeflectionEfficiency = pValue; break; case Vehicle.ANGULAR_DEFLECTION_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_angularDeflectionTimescale = pValue; break; case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_angularMotorDecayTimescale = pValue; break; case Vehicle.ANGULAR_MOTOR_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_angularMotorTimescale = pValue; break; case Vehicle.BANKING_EFFICIENCY: + if (pValue < 0.01f) pValue = 0.01f; m_bankingEfficiency = pValue; break; case Vehicle.BANKING_MIX: + if (pValue < 0.01f) pValue = 0.01f; m_bankingMix = pValue; break; case Vehicle.BANKING_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_bankingTimescale = pValue; break; case Vehicle.BUOYANCY: @@ -121,24 +128,31 @@ namespace OpenSim.Region.Physics.OdePlugin m_hoverHeight = pValue; break; case Vehicle.HOVER_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_hoverTimescale = pValue; break; case Vehicle.LINEAR_DEFLECTION_EFFICIENCY: + if (pValue < 0.01f) pValue = 0.01f; m_linearDeflectionEfficiency = pValue; break; case Vehicle.LINEAR_DEFLECTION_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_linearDeflectionTimescale = pValue; break; case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_linearMotorDecayTimescale = pValue; break; case Vehicle.LINEAR_MOTOR_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_linearMotorTimescale = pValue; break; case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY: + if (pValue < 0.01f) pValue = 0.01f; m_verticalAttractionEfficiency = pValue; break; case Vehicle.VERTICAL_ATTRACTION_TIMESCALE: + if (pValue < 0.01f) pValue = 0.01f; m_verticalAttractionTimescale = pValue; break; -- cgit v1.1