home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 09 Racing and Sports AI / 02 Biasillo / Listing3.cpp < prev   
Encoding:
Text File  |  2001-12-09  |  838 b   |  23 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. // The velocity of a point relative to the center of gravity can 
  12. // be calculated with the function PointVel().
  13.  
  14. vector3 PointVel(const vector3& linearVel, const vector3& angularVel,
  15.                  const vector3& point)
  16. {
  17.     // linearVel = Linear velocity
  18.     // angularVel = Axis of rotation * spin rate
  19.     // point = Relative position to body's center of gravity
  20.  
  21.     return (linearVel + CrossProduct(angularVel, point));
  22. }
  23.