Esempio n. 1
0
 public void SetVelocity(float velocity, float power)
 {
     velocity = MathHelper.Clamp(velocity, -1000, 1000);
     wheel.SetValue("Speed Limit", Math.Abs(velocity) * 3.6f);                        // m/s to km/h
     wheel.SetValue("Propulsion override", (float)Math.Atan2(power, 1) * sideMult);
 }
 public static void SetSteerSpeed(IMyMotorSuspension motorSuspension, float steerSpeed)
 {
     motorSuspension.SetValue <float>("SteerSpeed", steerSpeed);
 }
 {               //IMyMotorSuspension API wrapper
                 //PROPERTIES:
     ///public static void SetSteering(IMyMotorSuspension motorSuspension, bool steering){
     ///	motorSuspension.SetValue<bool>("Steering", steering);
     ///}
     public static void SetMaxSteerAngle(IMyMotorSuspension motorSuspension, float maxSteerAngle)
     {
         motorSuspension.SetValue <float>("MaxSteerAngle", maxSteerAngle);
     }
 public static void SetSpeedLimit(IMyMotorSuspension motorSuspension, float speedLimit)              //in kmph
 {
     motorSuspension.SetValue <float>("Speed Limit", speedLimit);
 }
 ///public static void SetFriction(IMyMotorSuspension motorSuspension, float friction){
 ///	motorSuspension.SetValue<float>("Friction", friction);
 ///}
 ///public static void SetDamping(IMyMotorSuspension motorSuspension, float damping){
 ///	motorSuspension.SetValue<float>("Damping", damping);
 ///}
 public static void SetStrength(IMyMotorSuspension motorSuspension, float strength)
 {
     motorSuspension.SetValue <float>("Strength", strength);
 }
 ///public static void SetInvertSteering(IMyMotorSuspension motorSuspension, bool invertSteering){
 ///	motorSuspension.SetValue<bool>("InvertSteering", invertSteering);
 ///}
 ///public static void SetPropulsion(IMyMotorSuspension motorSuspension, bool propulsion){
 ///	motorSuspension.SetValue<bool>("Propulsion", propulsion);
 ///}
 ///public static void SetInvertPropulsion(IMyMotorSuspension motorSuspension, bool invertPropulsion){
 ///	motorSuspension.SetValue<bool>("InvertPropulsion", invertPropulsion);
 ///}
 public static void SetPower(IMyMotorSuspension motorSuspension, float power)
 {
     motorSuspension.SetValue <float>("Power", power);
 }