00001 /* 00002 CS Senior Project 2003 00003 Team : Leftfield 00004 Project : ModernWarfare 00005 Members : 00006 - Russ Christensen <rchriste@cs.utah.edu> 00007 - Todd Smith <tcsmith@cs.utah.edu> 00008 - Usit Duongsaa <duongsaa@cs.utah.edu> 00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 00012 00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 */ 00017 00022 #ifndef INCLUDE_BATTLEBULLET 00023 #define INCLUDE_BATTLEBULLET 00024 00025 #include "..\AEngine\AEngine.h" 00026 #include "Globals.h" 00027 00028 using namespace Globals; 00029 00030 //------------------------------------------------------------------------------------ 00031 namespace BulletTypes 00032 { 00033 const int SHELL = 0; 00034 const int ROCKET = 1; 00035 const int ICBM = 2; 00036 const int ANTIAIR = 3; 00037 }; 00038 //------------------------------------------------------------------------------------ 00039 //------------------------------------------------------------------------------------ 00041 class BattleBullet 00042 { 00043 public: 00044 BattleBullet() { m_type=-1; } 00045 BattleBullet( int type, char team, int targetGroup, Vec3D pos, Vec3D target ) 00046 { 00047 m_type = type; 00048 m_team = team; m_targetGroup = targetGroup; 00049 m_pos = pos; m_target = target; 00050 m_time = 0; m_dir = target-pos; 00051 m_totalDist = sqrtf(m_dir.x*m_dir.x + m_dir.y*m_dir.y); 00052 FLOAT angle = clipAngle( 90-D3DXToDegree( atan2f(m_dir.x,m_dir.y)) ); 00053 m_dir = Vec3D( angle, 0.0f, 0.0f ); 00054 m_firingZ = m_pos.z; 00055 } 00056 00057 int m_type; 00058 char m_team; 00059 int m_targetGroup; 00060 Vec3D m_pos, m_target, m_dir; 00061 int m_time; // time (in update count) since fired (-1 if invalid) 00062 FLOAT m_totalDist; // total dist from initial m_pos to m_target 00063 FLOAT m_firingZ; // the height where the bullet was fired 00064 }; 00065 //------------------------------------------------------------------------------------ 00066 00067 #endif
1.3-rc2