Advertisement
Guest User

Untitled

a guest
Jun 13th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.77 KB | None | 0 0
  1. // ref: https://developer.nvidia.com/sites/default/files/akamai/physx/Docs/Vehicles.html#tuning-guide
  2.  
  3. /// PhysX part
  4. simulation          = "tankX";
  5. engineBrakeCoef     = 0.1;
  6.  
  7. torqueCurve[] = {
  8.         {"(700/2640)" , 0},
  9.         {"(1600/2640)", 0.92},
  10.         {"(1800/2640)", 0.98},
  11.         {"(1900/2640)", 1},
  12.         {"(2000/2640)", 0.98},
  13.         {"(2200/2640)", 0.96},
  14.         {"(2400/2640)", 0.91},
  15.         {"(4900/2640)", 0},
  16. };
  17. /*
  18. torqueCurve[] = {  // TorqueCurve from MBT base in A3 Config (2640 seems to be redRPM, not sure where 2850 is coming from).
  19.    
  20.     {"(700/2640)",0},
  21.     {"(1600/2640)","(2650/2850)"},
  22.     {"(1800/2640)","(2800/2850)"},
  23.     {"(1900/2640)","(2850/2850)"},
  24.     {"(2000/2640)","(2800/2850)"},
  25.     {"(2200/2640)","(2750/2850)"},
  26.     {"(2400/2640)","(2600/2850)"},
  27.     {"(4900/2640)","(0/2850)"}
  28.    
  29.     };
  30. */
  31. //maxOmega = 251.33;
  32. maxOmega = 251.33;
  33. //enginePower = 195;
  34. enginePower = 185;
  35. // peakTorque = 2311;
  36. peakTorque = 741.7;
  37. maxGForce           = 2;
  38. thrustDelay         = 0.1;      /// how much time does it take to get the full thrust (default 1), used to reduce initial wheel slipping
  39. clutchStrength      = 50;
  40. fuelCapacity        = 1885;
  41. brakeIdleSpeed      = 1.78;     /// speed in m/s below which braking is applied
  42. latency             = 1.4;
  43. tankTurnForce       = 201710; /// Random magic number, expected to be something like 11 x mass of vehicle (was 101710 before guy played with it...)
  44. normalSpeedForwardCoef = 0.52;
  45. switchTime = 0.31;
  46. dampersBumpCoef = 0.3;
  47. changeGearMinEffectivity[] = {0.95, 0.15, 0.85, 0.95, 0.95, 0.95, 0.95};
  48. maxSpeed  = 56;
  49. engineBrakeCoef = 0.2;
  50. overSpeedBrakeCoef = 0.8;
  51. dampingRateFullThrottle = 0.08;
  52. dampingRateZeroThrottleClutchEngaged = 2;
  53. dampingRateZeroThrottleClutchDisengaged = 0.5;
  54. wheelCircumference = 1.8;
  55. /// Gearbox and transmission
  56. idleRpm = 600; // RPM at which the engine idles.
  57. redRpm = 2400; // RPM at which the engine redlines.
  58.  
  59. engineLosses = 25; // power losses on the engine's crank-shaft (before the gearbox) in Nm. (Multiplied by the gear ratio)
  60. transmissionLosses = 15; // power losses on wheel axis (in/after the gearbox) in Nm. (Constant)
  61.  
  62.  
  63. class complexGearbox {
  64.     GearboxRatios[]    = {
  65.        
  66.                             "R1",-5.9,
  67.                             "N",0,
  68.                             "D1",5.9,
  69.                             "D2",3.8,
  70.                             "D3",2.75,
  71.                             "D4",2,
  72.                             "D5",1.23
  73.                         };
  74.  
  75.                        
  76.     TransmissionRatios[] = {
  77.                                 "High",7
  78.                             };
  79.                            
  80.     gearBoxMode        = "auto"; //gearbox can be of type: full-auto (only requires 'W' or 'S'), auto (requires shift between drive and reverse), semi-auto, manual
  81.     moveOffGear        = 1; // defines what gear an automatic or semi-automatic gearbox will move off from stationary in. 1 by default.
  82.     driveString        = "D"; // string to display in the HUD for forward gears.
  83.     neutralString      = "N"; // string to display in the HUD for neutral gear.
  84.     reverseString      = "R"; // string to display in the HUD for reverse gears.
  85.     transmissionDelay  = 1;
  86.    
  87.     gearUpMaxCoef = 0.9;
  88.     gearUpMinCoef = 0.7;
  89.     gearDownMaxCoef = 0.75;
  90.     gearDownMinCoef = 0.7;
  91. };
  92. /// end of gearbox
  93.  
  94. numberPhysicalWheels = 12;
  95.  
  96. class Wheels {
  97.     class L2 {
  98.         boneName = "track_L1";
  99.         center   = "wheel_1_2_axis";
  100.         boundary = "wheel_1_2_bound";
  101.         damping  = 75.0;
  102.         // tanks do not have steerable wheels
  103.         steering = false;
  104.         /// We need to distinguish the side to apply the right thrust value
  105.         side = "left";
  106.         /// weight of the wheel is defined per wheel, it reduces overall mass of vehicle
  107.         weight = 60;
  108.         mass = 60;
  109.         MOI = 20;       // Moment of Intertia (basically, momentum of wheel). lower = slower/less momentum
  110.         latStiffX = 25;
  111.         latStiffY = 480;
  112.         longitudinalStiffnessPerUnitGravity = 100000;
  113.         maxBrakeTorque = 10000;
  114.         sprungMass = 2940.0;
  115.         springStrength = 74500;
  116.         springDamperRate = 9000;
  117.         dampingRate = 1;
  118.         dampingRateInAir = 2450.0;  // Basically, how quickly the wheel will come to a stop, this and MOI are the main factors to be tweaked
  119.         dampingRateDamaged = 10.0;
  120.         dampingRateDestroyed = 10000.0;
  121.         maxDroop = 0.2;
  122.         maxCompression = 0.2;
  123.         frictionVsSlipGraph[] = {[0,5],[0.5,5],[1,5]};
  124.     };
  125.     class L3: L2 {
  126.         boneName = "track_L2";
  127.         center   = "wheel_1_3_axis";
  128.         boundary = "wheel_1_3_bound";
  129.     };
  130.     class L4: L2 {
  131.         boneName = "track_L3";
  132.         center   = "wheel_1_4_axis";
  133.         boundary = "wheel_1_4_bound";
  134.     };
  135.     class L5: L2 {
  136.         boneName = "track_L4";
  137.         center   = "wheel_1_5_axis";
  138.         boundary = "wheel_1_5_bound";
  139.     };
  140.     // rear left wheel, usually Idler or Drive Sproket
  141.     // Note, this wheel may not always be touching the ground, but we need it anyway!
  142.     class L6: L2 {
  143.         boneName = "track_L5";
  144.         center   = "wheel_1_6_axis";
  145.         boundary = "wheel_1_6_bound";
  146.     };
  147.     // front left wheel, usually Idler or Drive Sproket
  148.     // Note, this wheel may not always be touching the ground, but we need it anyway!
  149.     class L1: L2 {
  150.         boneName = "wheel_Lrear";
  151.         center   = "wheel_1_1_axis";
  152.         boundary = "wheel_1_1_bound";
  153.     };
  154.  
  155.     class R2: L2 {
  156.         boneName = "track_R1";
  157.         center   = "wheel_2_2_axis";
  158.         boundary = "wheel_2_2_bound";
  159.         side = "right";
  160.     };
  161.     class R3: R2 {
  162.         boneName = "track_R2";
  163.         center   = "wheel_2_3_axis";
  164.         boundary = "wheel_2_3_bound";
  165.     };
  166.     class R4: R2 {
  167.         boneName = "track_R3";
  168.         center   = "wheel_2_4_axis";
  169.         boundary = "wheel_2_4_bound";
  170.     };
  171.     class R5: R2 {
  172.         boneName = "track_R4";
  173.         center   = "wheel_2_5_axis";
  174.         boundary = "wheel_2_5_bound";
  175.     };
  176.     // rear right wheel, usually Idler or Drive Sproket
  177.     // Note, this wheel may not always be touching the ground, but we need it anyway!
  178.     class R6: R2 {
  179.         boneName = "track_R5";
  180.         center   = "wheel_2_6_axis";
  181.         boundary = "wheel_2_6_bound";
  182.     };
  183.     // front right wheel, usually Idler or Drive Sproket
  184.     // Note, this wheel may not always be touching the ground, but we need it anyway!
  185.     class R1: R2 {
  186.         boneName = "wheel_Rrear";
  187.         center   = "wheel_2_1_axis";
  188.         boundary = "wheel_2_1_bound";
  189.     };
  190. };
  191. /// End of PhysX
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement