00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #if !defined(__INCLUDE_ShotProjectileh_INCLUDE__) 00022 #define __INCLUDE_ShotProjectileh_INCLUDE__ 00023 00024 #include <engine/PhysicsParticle.h> 00025 #include <engine/ScorchedCollisionIds.h> 00026 #include <engine/ViewPoints.h> 00027 #ifndef S3D_SERVER 00028 #include <tankgraph/RenderTracer.h> 00029 #endif 00030 #include <weapons/WeaponProjectile.h> 00031 #include <list> 00032 00033 class ShotProjectile : 00034 public PhysicsParticleReferenced 00035 { 00036 public: 00037 ShotProjectile( 00038 FixedVector &startPosition, FixedVector &velocity, 00039 WeaponProjectile *weapon, WeaponFireContext &weaponContext, 00040 unsigned int flareType, fixed spinSpeed); 00041 virtual ~ShotProjectile(); 00042 00043 virtual void simulate(fixed frameTime, bool &remove); 00044 virtual void init(); 00045 virtual void collision(PhysicsParticleObject &position, 00046 ScorchedCollisionId collisionId); 00047 virtual std::string getActionDetails(); 00048 00049 unsigned int getPlayerId() { return weaponContext_.getPlayerId(); } 00050 WeaponProjectile *getWeapon() { return weapon_; } 00051 #ifndef S3D_SERVER 00052 std::list<RenderTracer::TracerLinePoint> &getPositions() { return positions_; } 00053 #endif 00054 00055 protected: 00056 FixedVector startPosition_, velocity_; 00057 WeaponProjectile *weapon_; 00058 ViewPoints::ViewPoint *vPoint_; 00059 WeaponFireContext weaponContext_; 00060 unsigned int flareType_; 00061 bool up_; 00062 fixed snapTime_; 00063 fixed totalTime_; 00064 // things like thrusttime etc should have their 00065 // values set ONCE per projectile 00066 fixed thrustTime_; 00067 fixed thrustAmount_; 00068 fixed drag_; 00069 fixed timedCollision_; 00070 fixed spinSpeed_; 00071 #ifndef S3D_SERVER 00072 std::list<RenderTracer::TracerLinePoint> positions_; 00073 #endif 00074 00075 void doCollision(FixedVector &position); 00076 00077 private: 00078 ShotProjectile(const ShotProjectile &); 00079 const ShotProjectile & operator=(const ShotProjectile &); 00080 00081 }; 00082 00083 #endif
1.5.3