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/_r_loc_8cpp_source.html | 205 +++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 Doc/doxygen/html/_r_loc_8cpp_source.html (limited to 'Doc/doxygen/html/_r_loc_8cpp_source.html') diff --git a/Doc/doxygen/html/_r_loc_8cpp_source.html b/Doc/doxygen/html/_r_loc_8cpp_source.html new file mode 100644 index 0000000..1e739c9 --- /dev/null +++ b/Doc/doxygen/html/_r_loc_8cpp_source.html @@ -0,0 +1,205 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/RLoc.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
RLoc.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: RLoc.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Navigation Point class implementation
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "RLoc.h"
+
17 #include "Random.h"
+
18 
+
19 // +----------------------------------------------------------------------+
+
20 
+ +
22 : rloc(0), dex(0), dex_var(5.0e3f), az(0), az_var(3.1415f), el(0), el_var(0.1f)
+
23 { }
+
24 
+
25 RLoc::RLoc(const Point& l, double d, double dv)
+
26 : loc(l), base_loc(l), rloc(0), dex((float) d), dex_var((float) dv),
+
27 az(0), az_var(3.1415f), el(0), el_var(0.1f)
+
28 { }
+
29 
+
30 RLoc::RLoc(RLoc* l, double d, double dv)
+
31 : rloc(l), dex((float) d), dex_var((float) dv),
+
32 az(0), az_var(3.1415f), el(0), el_var(0.1f)
+
33 { }
+
34 
+
35 RLoc::RLoc(const RLoc& r)
+
36 : loc(r.loc), base_loc(r.base_loc), rloc(r.rloc),
+
37 dex(r.dex), dex_var(r.dex_var),
+
38 az(r.az), az_var(r.az_var),
+
39 el(r.el), el_var(r.el_var)
+
40 { }
+
41 
+ +
43 { }
+
44 
+
45 // +----------------------------------------------------------------------+
+
46 
+
47 const Point&
+ +
49 {
+
50  if (rloc || dex > 0) Resolve();
+
51  return loc;
+
52 }
+
53 
+
54 // +----------------------------------------------------------------------+
+
55 
+
56 void
+ +
58 {
+
59  if (rloc) {
+
60  base_loc = rloc->Location();
+
61  rloc = 0;
+
62  }
+
63 
+
64  if (dex > 0) {
+
65  double d = dex + Random(-dex_var, dex_var);
+
66  double a = az + Random(-az_var, az_var);
+
67  double e = el + Random(-el_var, el_var);
+
68 
+
69  Point p = Point(d * sin(a),
+
70  d * -cos(a),
+
71  d * sin(e));
+
72 
+
73  loc = base_loc + p;
+
74  dex = 0;
+
75  }
+
76  else {
+
77  loc = base_loc;
+
78  }
+
79 }
+
80 
+
81 // +----------------------------------------------------------------------+
+
82 
+
83 void
+ +
85 {
+
86  base_loc = l;
+
87  loc = l;
+
88 }
+
+
+ + + + -- cgit v1.1