[Gcblue-commits] gcb_wx/include/sim tcTorpedoObject.h,NONE,1.1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-05 02:58:35
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22179/include/sim Added Files: tcTorpedoObject.h Log Message: Sonar work, passive sonar, torpedoes --- NEW FILE: tcTorpedoObject.h --- /** ** @file tcTorpedoObject.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCTORPEDOOBJECT_H_ #define _TCTORPEDOOBJECT_H_ #include "tcWeaponObject.h" #include "tcGuidanceState.h" #include "tcSonar.h" class tcUpdateStream; namespace Database { class tcTorpedoDBObject; } /** * A class that models a torpedo. * * @see tcGameObject */ class tcTorpedoObject : public tcWeaponObject { public: /** * Search mode code for torpedo */ enum TorpedoSearchMode { SEARCH_STRAIGHT = 0, SEARCH_S = 1, SEARCH_LEFTCIRCLE = 2, SEARCH_RIGHTCIRCLE = 3 }; float goalDepth_m; float goalHeading_rad; float goalPitch_rad; float goalSpeed_kts; double interceptTime; float runTime; ///< [s] time elapsed since launch // are all 3 of these necessary? needs refactoring double lastGuidanceUpdate; float guidanceUpdateInterval; tsGeoPoint waypoint; // nav datum float rangeToObjective_km; // for segment determination unsigned int currentSegment; tcSonar seeker; float fuel_kg; float searchHeading_rad; ///< center of "S" sector to search int searchMode; tcTorpedoDBObject *mpDBObject; // pointer to valid database obj void Clear(); void LaunchFrom(tcGameObject* obj, unsigned nLauncher); void RandInitNear(float afLon_deg, float afLat_deg); virtual void Update(double afStatusTime); virtual void UpdateEffects(); virtual void UpdateGuidance(double t); virtual void SetHeading(float newHeading); int GetCurrentGuidanceMode(); virtual void SetSpeed(float newSpeed); virtual tcSonar* GetSensorState(); virtual void DesignateTarget(long anID); virtual int GetGuidanceParameters(tsGuidanceParameters& gp); float RuntimeRemaining(); void PrintToFile(tcFile&); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); tcTorpedoObject(); tcTorpedoObject(tcTorpedoObject&); tcTorpedoObject(tcTorpedoDBObject *obj); ~tcTorpedoObject(); protected: virtual void UpdateDrop(float dt_s); virtual void UpdateSpeedSimple(float dt_s); }; #endif |