From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- Doc/doxygen/html/_hard_point_8cpp_source.html | 221 ++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 Doc/doxygen/html/_hard_point_8cpp_source.html (limited to 'Doc/doxygen/html/_hard_point_8cpp_source.html') diff --git a/Doc/doxygen/html/_hard_point_8cpp_source.html b/Doc/doxygen/html/_hard_point_8cpp_source.html new file mode 100644 index 0000000..73aac91 --- /dev/null +++ b/Doc/doxygen/html/_hard_point_8cpp_source.html @@ -0,0 +1,221 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/HardPoint.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
HardPoint.cpp
+
+
+Go to the documentation of this file.
1 /* Project Starshatter 4.5
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2004. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: Stars.exe
+
6  FILE: HardPoint.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  HardPoint class
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "HardPoint.h"
+
17 #include "Weapon.h"
+
18 #include "WeaponDesign.h"
+
19 #include "Shot.h"
+
20 #include "Ship.h"
+
21 #include "Sim.h"
+
22 
+
23 // +----------------------------------------------------------------------+
+
24 
+
25 HardPoint::HardPoint(Vec3 muzzle_loc, double az, double el)
+
26 : aim_azimuth((float) az), aim_elevation((float) el), muzzle(muzzle_loc)
+
27 {
+
28  ZeroMemory(designs, sizeof(designs));
+
29 }
+
30 
+
31 // +----------------------------------------------------------------------+
+
32 
+ +
34 : aim_azimuth(h.aim_azimuth), aim_elevation(h.aim_elevation), muzzle(h.muzzle),
+
35 mount_rel(h.mount_rel), radius(h.radius), hull_factor(h.hull_factor)
+
36 {
+
37  CopyMemory(designs, h.designs, sizeof(designs));
+
38 }
+
39 
+
40 // +--------------------------------------------------------------------+
+
41 
+ +
43 {
+
44 }
+
45 
+
46 // +--------------------------------------------------------------------+
+
47 
+
48 void
+
49 HardPoint::Mount(Point loc, float rad, float hull)
+
50 {
+
51  mount_rel = loc;
+
52  radius = rad;
+
53  hull_factor = hull;
+
54 }
+
55 
+
56 // +--------------------------------------------------------------------+
+
57 
+
58 void
+ +
60 {
+
61  for (int i = 0; i < MAX_DESIGNS; i++) {
+
62  if (!designs[i]) {
+
63  designs[i] = d;
+
64  return;
+
65  }
+
66  }
+
67 }
+
68 
+
69 // +--------------------------------------------------------------------+
+
70 
+
71 Weapon*
+
72 HardPoint::CreateWeapon(int type_index)
+
73 {
+
74  if (type_index >= 0 && type_index < MAX_DESIGNS && designs[type_index]) {
+
75  Vec3 zero_pt = Vec3(0.0f, 0.0f, 0.0f);
+
76  Vec3* muzzle_pt = &zero_pt;
+
77 
+
78  if (designs[type_index]->turret.length() == 0)
+
79  muzzle_pt = &muzzle;
+
80 
+
81  Weapon* missile = new(__FILE__,__LINE__) Weapon(designs[type_index],
+
82  1,
+
83  muzzle_pt,
+ + +
86  missile->SetAbbreviation(GetAbbreviation());
+
87  missile->Mount(mount_rel, radius, hull_factor);
+
88  return missile;
+
89  }
+
90 
+
91  return 0;
+
92 }
+
93 
+
94 // +--------------------------------------------------------------------+
+
95 
+
96 double
+
97 HardPoint::GetCarryMass(int type_index)
+
98 {
+
99  if (type_index >= 0 && type_index < MAX_DESIGNS && designs[type_index])
+
100  return designs[type_index]->carry_mass;
+
101 
+
102  return 0;
+
103 }
+
104 
+
+
+ + + + -- cgit v1.1