コード例 #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);
 }
コード例 #2
0
 public static void SetSteerSpeed(IMyMotorSuspension motorSuspension, float steerSpeed)
 {
     motorSuspension.SetValue <float>("SteerSpeed", steerSpeed);
 }
コード例 #3
0
 {               //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);
     }
コード例 #4
0
 public static void SetSpeedLimit(IMyMotorSuspension motorSuspension, float speedLimit)              //in kmph
 {
     motorSuspension.SetValue <float>("Speed Limit", speedLimit);
 }
コード例 #5
0
 ///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);
 }
コード例 #6
0
 ///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);
 }