home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 09 Racing and Sports AI / 02 Biasillo / Listing1.cpp next >
Encoding:
C/C++ Source or Header  |  2001-12-09  |  984 b   |  24 lines

  1. /* Copyright (C) Gari Biasillo, 2001. 
  2.  * All rights reserved worldwide.
  3.  *
  4.  * This software is provided "as is" without express or implied
  5.  * warranties. You may freely copy and compile this source into
  6.  * applications you distribute provided that the copyright text
  7.  * below is included in the resulting source code, for example:
  8.  * "Portions Copyright (C) Gari Biasillo, 2001"
  9.  */
  10.  
  11. // A simple structure is used to control the car, which contains 
  12. // the steering and acceleration/braking values. Steering, dx, is 
  13. // in the range of -1.0 to +1.0, representing full left to full 
  14. // right. The second member, dy, has two uses depending on its 
  15. // value which also has the range -1.0 to +1.0. Negative values 
  16. // represent the braking amount (zero to 100%), and positive values 
  17. // represent acceleration (zero to 100%).
  18.  
  19. struct CCarControl
  20. {
  21.     float    dx;    // -1.0 ... +1.0 = Left to Right steering
  22.     float    dy;    // <0.0 = Braking, >0.0 Acceleration
  23. };
  24.