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 --- .../html/_multi_controller_8cpp_source.html | 247 +++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 Doc/doxygen/html/_multi_controller_8cpp_source.html (limited to 'Doc/doxygen/html/_multi_controller_8cpp_source.html') diff --git a/Doc/doxygen/html/_multi_controller_8cpp_source.html b/Doc/doxygen/html/_multi_controller_8cpp_source.html new file mode 100644 index 0000000..b1b1fae --- /dev/null +++ b/Doc/doxygen/html/_multi_controller_8cpp_source.html @@ -0,0 +1,247 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/nGenEx/MultiController.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
MultiController.cpp
+
+
+Go to the documentation of this file.
1 /* Project nGenEx
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2004. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: nGenEx.lib
+
6  FILE: MultiController.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  MultiController Input class
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "MultiController.h"
+
17 
+
18 // +--------------------------------------------------------------------+
+
19 
+ +
21 : x(0), y(0), z(0), p(0), r(0), w(0), c(0), p1(0), r1(0), w1(0), t(0)
+
22 {
+
23  for (int i = 0; i < MotionController::MaxActions; i++)
+
24  action[i] = 0;
+
25 
+
26  nctrl = 0;
+
27  for (int i = 0; i < 4; i++)
+
28  ctrl[i] = 0;
+
29 }
+
30 
+ +
32 {
+
33  for (int i = 0; i < 4; i++)
+
34  delete ctrl[i];
+
35 }
+
36 
+
37 // +--------------------------------------------------------------------+
+
38 
+
39 void
+ +
41 {
+
42  if (nctrl < 4 && c)
+
43  ctrl[nctrl++] = c;
+
44 }
+
45 
+
46 void
+ +
48 {
+
49  for (int i = 0; i < nctrl; i++)
+
50  ctrl[i]->MapKeys(mapping, nkeys);
+
51 }
+
52 
+
53 int
+ +
55 {
+
56  if (nctrl)
+
57  return ctrl[0]->GetSwapYawRoll();
+
58 
+
59  return 0;
+
60 }
+
61 
+
62 void
+ +
64 {
+
65  for (int i = 0; i < nctrl; i++)
+
66  ctrl[i]->SwapYawRoll(swap);
+
67 }
+
68 
+
69 // +--------------------------------------------------------------------+
+
70 
+
71 inline void clamp(double& x) { if (x<-1)x=-1; else if (x>1)x=1; }
+
72 
+
73 void
+ +
75 {
+
76  t = x = y = z = p = r = w = c = 0;
+
77 
+
78  for (int i = 0; i < MotionController::MaxActions; i++)
+
79  action[i] = 0;
+
80 
+
81  for (int i = 0; i < nctrl; i++) {
+
82  ctrl[i]->Acquire();
+
83 
+
84  x += ctrl[i]->X();
+
85  y += ctrl[i]->Y();
+
86  z += ctrl[i]->Z();
+
87 
+
88  r += ctrl[i]->Roll();
+
89  p += ctrl[i]->Pitch();
+
90  w += ctrl[i]->Yaw();
+
91  c += ctrl[i]->Center();
+
92  t += ctrl[i]->Throttle();
+
93 
+
94  for (int a = 0; a < MotionController::MaxActions; a++)
+
95  action[a] += ctrl[i]->Action(a);
+
96  }
+
97 
+
98  clamp(x);
+
99  clamp(y);
+
100  clamp(z);
+
101  clamp(r);
+
102  clamp(p);
+
103  clamp(w);
+
104  clamp(t);
+
105 }
+
106 
+
107 // +--------------------------------------------------------------------+
+
108 
+
109 void
+ +
111 {
+
112  for (int i = 0; i < nctrl; i++)
+
113  ctrl[i]->SetThrottle(throttle);
+
114 }
+
115 
+
116 // +--------------------------------------------------------------------+
+
117 
+
118 int
+ +
120 {
+
121  for (int i = 0; i < nctrl; i++) {
+
122  int result = ctrl[i]->ActionMap(key);
+
123 
+
124  if (result)
+
125  return result;
+
126  }
+
127 
+
128  return 0;
+
129 }
+
130 
+
+
+ + + + -- cgit v1.1