Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Sensor.h
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: Sensor.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Integrated (Passive and Active) Sensor Package class
13
*/
14
15
#ifndef Sensor_h
16
#define Sensor_h
17
18
#include "
Types.h
"
19
#include "
SimObject.h
"
20
#include "
System.h
"
21
#include "
Geometry.h
"
22
#include "
List.h
"
23
24
// +--------------------------------------------------------------------+
25
26
class
Shot
;
27
class
Contact
;
28
29
// +--------------------------------------------------------------------+
30
31
class
Sensor
:
public
System
,
public
SimObserver
32
{
33
public
:
34
enum
Mode
{
35
PAS
,
STD
,
ACM
,
GM
,
// fighter modes
36
PST
,
CST
// starship modes
37
};
38
39
Sensor
();
40
Sensor
(
const
Sensor
& rhs);
41
virtual
~Sensor
();
42
43
virtual
void
ExecFrame
(
double
seconds);
44
virtual
SimObject
*
LockTarget
(
int
type
=
SimObject::SIM_SHIP
,
45
bool
closest=
false
,
46
bool
hostile=
false
);
47
virtual
SimObject
*
LockTarget
(
SimObject
* candidate);
48
virtual
bool
IsTracking
(
SimObject
* tgt);
49
virtual
void
DoEMCON
(
int
emcon
);
50
51
virtual
void
ClearAllContacts
();
52
53
virtual
Mode
GetMode
()
const
{
return
mode
; }
54
virtual
void
SetMode
(
Mode
m);
55
virtual
double
GetBeamLimit
()
const
;
56
virtual
double
GetBeamRange
()
const
;
57
virtual
void
IncreaseRange
();
58
virtual
void
DecreaseRange
();
59
virtual
void
AddRange
(
double
r);
60
61
Contact
*
FindContact
(
Ship
* s);
62
Contact
*
FindContact
(
Shot
* s);
63
64
// borrow this sensor for missile seeker
65
SimObject
*
AcquirePassiveTargetForMissile
();
66
SimObject
*
AcquireActiveTargetForMissile
();
67
68
// SimObserver:
69
virtual
bool
Update
(
SimObject
* obj);
70
virtual
const
char
*
GetObserverName
()
const
;
71
72
protected
:
73
void
ProcessContact
(
Ship
* contact,
double
az1,
double
az2);
74
void
ProcessContact
(
Shot
* contact,
double
az1,
double
az2);
75
76
Mode
mode
;
77
int
nsettings
;
78
int
range_index
;
79
float
range_settings
[8];
80
SimObject
*
target
;
81
82
List<Contact>
contacts
;
83
};
84
85
#endif Sensor_h
86
Stars45
Sensor.h
Generated on Thu May 31 2012 16:31:15 for Starshatter_Open by
1.8.1