home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Engine / Classes / KTire.uc < prev    next >
Text File  |  2003-06-23  |  3KB  |  88 lines

  1. class KTire extends KActor
  2.     native
  3.     abstract;
  4.  
  5. cpptext
  6. {
  7. #ifdef WITH_KARMA
  8.     // Actor interface.
  9.     virtual void preContactUpdate();
  10. #endif
  11. }
  12.  
  13. var KCarWheelJoint  WheelJoint;         // joint holding this wheel to chassis etc.
  14.  
  15. // TYRE MODEL
  16.  
  17. // FRICTION
  18. var float           RollFriction;       // friction coeff. in tyre direction
  19. var float           LateralFriction;    // friction coeff. in sideways direction
  20.  
  21. // SLIP
  22. // slip = min(maxSlip, minSlip + (slipRate * angular vel))
  23. var float           RollSlip;           // max first-order (force ~ vel) slip in tyre direction
  24. var float           LateralSlip;        // max first-order (force ~ vel) slip in sideways direction
  25. var float           MinSlip;            // minimum slip (both directions)
  26. var float           SlipRate;           // amount of extra slip per unit velocity
  27.  
  28. // NORMAL
  29. var float           Softness;           // 'softness' in the normal dir
  30. var float           Adhesion;           // 'stickyness' in the normal dir
  31. var float           Restitution;        // 'bouncyness' in the normal dir
  32.  
  33. // Other Output information
  34.  
  35. var const bool      bTireOnGround;        // If this tire is currently in contact with something.
  36.  
  37. var const float     GroundSlipVel;      // relative tangential velocity of wheel against ground (0 for static, >0 for slipping)
  38.                                         // could use this to trigger squeeling noises/smoke
  39. var const vector    GroundSlipVec;        // full vector version of above (ie GroundSlipVel is magnitude of this vector).
  40.  
  41. var const float     SpinSpeed;            // current speed (65535 = 1 rev/sec) of this wheel spinning about its axis
  42.  
  43. var const material        GroundMaterial;        // material that tyre is touching
  44. //var const ESurfaceTypes GroundSurfaceType;    // surface type that the tyre is touching
  45.  
  46. // This is filled in by VehicleStateReceived in KVehicle.
  47. var KRigidBodyState    ReceiveState;
  48. var bool            bReceiveStateNew;
  49.  
  50. // This even is for updating the state (position, velocity etc.) of the tire's karma
  51. // body when we get new information from the network.
  52. event bool KUpdateState(out KRigidBodyState newState)
  53. {
  54.     if(!bReceiveStateNew)
  55.         return false;
  56.         
  57.     newState = ReceiveState;
  58.     bReceiveStateNew = false;
  59.  
  60.     return true;
  61.     //return false;
  62. }
  63.  
  64. // By default, nothing happens if you shoot a tire
  65. function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, 
  66.                         Vector momentum, class<DamageType> damageType)
  67. {
  68.  
  69. }
  70.  
  71. defaultproperties
  72. {
  73.     RollFriction=0.3
  74.     LateralFriction=0.3
  75.  
  76.     RollSlip=0.085
  77.     LateralSlip=0.06
  78.     MinSlip=0.001
  79.     SlipRate=0.0005
  80.  
  81.     Softness=0.0002
  82.     Restitution=0.1
  83.     Adhesion=0
  84.  
  85.     bDisturbFluidSurface=true
  86.     RemoteRole=ROLE_None
  87.     bNoDelete=false
  88. }