internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
{
VDetailLog("{0},ProcessFloatVehicleParam,param={1},val={2}", ControllingPrim.LocalID, pParam, pValue);
float clampTemp;
switch (pParam)
{
case Vehicle.ANGULAR_DEFLECTION_EFFICIENCY:
m_angularDeflectionEfficiency = ClampInRange(0f, pValue, 1f);
break;
case Vehicle.ANGULAR_DEFLECTION_TIMESCALE:
m_angularDeflectionTimescale = ClampInRange(0.25f, pValue, 120);
break;
case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE:
m_angularMotorDecayTimescale = ClampInRange(0.25f, pValue, 120);
m_angularMotor.TargetValueDecayTimeScale = m_angularMotorDecayTimescale;
break;
case Vehicle.ANGULAR_MOTOR_TIMESCALE:
m_angularMotorTimescale = ClampInRange(0.25f, pValue, 120);
m_angularMotor.TimeScale = m_angularMotorTimescale;
break;
case Vehicle.BANKING_EFFICIENCY:
m_bankingEfficiency = ClampInRange(-1f, pValue, 1f);
break;
case Vehicle.BANKING_MIX:
m_bankingMix = ClampInRange(0.01f, pValue, 1);
break;
case Vehicle.BANKING_TIMESCALE:
m_bankingTimescale = ClampInRange(0.25f, pValue, 120);
break;
case Vehicle.BUOYANCY:
m_VehicleBuoyancy = ClampInRange(-1f, pValue, 1f);
m_VehicleGravity = ControllingPrim.ComputeGravity(m_VehicleBuoyancy);
break;
case Vehicle.HOVER_EFFICIENCY:
m_VhoverEfficiency = ClampInRange(0.01f, pValue, 1f);
break;
case Vehicle.HOVER_HEIGHT:
m_VhoverHeight = ClampInRange(0f, pValue, 1000000f);
break;
case Vehicle.HOVER_TIMESCALE:
m_VhoverTimescale = ClampInRange(0.01f, pValue, 120);
break;
case Vehicle.LINEAR_DEFLECTION_EFFICIENCY:
m_linearDeflectionEfficiency = ClampInRange(0f, pValue, 1f);
break;
case Vehicle.LINEAR_DEFLECTION_TIMESCALE:
m_linearDeflectionTimescale = ClampInRange(0.01f, pValue, 120);
break;
case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE:
m_linearMotorDecayTimescale = ClampInRange(0.01f, pValue, 120);
m_linearMotor.TargetValueDecayTimeScale = m_linearMotorDecayTimescale;
break;
case Vehicle.LINEAR_MOTOR_TIMESCALE:
m_linearMotorTimescale = ClampInRange(0.01f, pValue, 120);
m_linearMotor.TimeScale = m_linearMotorTimescale;
break;
case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY:
m_verticalAttractionEfficiency = ClampInRange(0.1f, pValue, 1f);
m_verticalAttractionMotor.Efficiency = m_verticalAttractionEfficiency;
break;
case Vehicle.VERTICAL_ATTRACTION_TIMESCALE:
m_verticalAttractionTimescale = ClampInRange(0.01f, pValue, 120);
m_verticalAttractionMotor.TimeScale = m_verticalAttractionTimescale;
break;
// These are vector properties but the engine lets you use a single float value to
// set all of the components to the same value
case Vehicle.ANGULAR_FRICTION_TIMESCALE:
clampTemp = ClampInRange(0.01f, pValue, 120);
m_angularFrictionTimescale = new Vector3(clampTemp, clampTemp, clampTemp);
break;
case Vehicle.ANGULAR_MOTOR_DIRECTION:
clampTemp = ClampInRange(-TwoPI, pValue, TwoPI);
m_angularMotorDirection = new Vector3(clampTemp, clampTemp, clampTemp);
m_angularMotor.Zero();
m_angularMotor.SetTarget(m_angularMotorDirection);
break;
case Vehicle.LINEAR_FRICTION_TIMESCALE:
clampTemp = ClampInRange(0.01f, pValue, 120);
m_linearFrictionTimescale = new Vector3(clampTemp, clampTemp, clampTemp);
break;
case Vehicle.LINEAR_MOTOR_DIRECTION:
clampTemp = ClampInRange(-BSParam.MaxLinearVelocity, pValue, BSParam.MaxLinearVelocity);
m_linearMotorDirection = new Vector3(clampTemp, clampTemp, clampTemp);
//m_linearMotorDirectionLASTSET = new Vector3(clampTemp, clampTemp, clampTemp);
m_linearMotor.SetTarget(m_linearMotorDirection);
break;
case Vehicle.LINEAR_MOTOR_OFFSET:
clampTemp = ClampInRange(-1000, pValue, 1000);
m_linearMotorOffset = new Vector3(clampTemp, clampTemp, clampTemp);
break;
}
} //end ProcessFloatVehicleParam