File: reality.h

package info (click to toggle)
yiff 2.06-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,464 kB
  • ctags: 3,028
  • sloc: ansic: 47,463; makefile: 218; sh: 77
file content (166 lines) | stat: -rw-r--r-- 2,860 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
                Official ShipWars Reality Constants


	Notation legend:

	ms = milliseconds
	us = microseconds

	rl = real life
	ru = XSW real units

	su = screen units


	Unit conversion legend:

	1 XSW second = 1 real life second

	1 screen unit = 1 pixel (at 1:1 zoom)
	1 screen unit = 0.001 XSW real units
	1 screen unit = 8 meters

	1 XSW real unit = 1000 screen units
	1 XSW real unit = 8000 meters

	1 meter = 0.125 screen units
	1 meter = 0.000125 XSW real units


 */


#ifndef REALITY_H
#define REALITY_H


/*
 *   Cyclic Time Lapse:
 *
 *	The main loop should usleep() for CYCLIC_MICROTIME_LAPSE
 *	microseconds.   All speed calculations are pre these numbers.
 *
 *	In addition, catchup time for speed should be multiplied by the
 *	differance of this value.  Example:
 *	Suppose you calculated x to be 50 (meters per second).
 *	Then you multiply x with ( last_millitime / CYCLIC_MILLITIME_LAPSE )
 *	to correct x for any time lost in the previous loop.
 *	last_millitime in this example would be the millitime of the last
 *	loop.
 */
#define CYCLE_LAPSE_MS 	16
#define CYCLE_LAPSE_US	16000


/*
 *   Sector sizes:
 *
 *	In XSW real units.  Total length of one sector is 163840.
 */
#define SECTOR_SIZE_X_MIN	-1024
#define SECTOR_SIZE_X_MAX	1024
#define SECTOR_SIZE_Y_MIN	-1024
#define SECTOR_SIZE_Y_MAX	1024
#define SECTOR_SIZE_Z_MIN	-1024
#define SECTOR_SIZE_Z_MAX	1024


/*
 *   Drag Coefficents:
 */
#define SUBLIGHT_DRAG_COEF  0.0
#define WARP_DRAG_COEF      0.009
#define TRANSWARP_DRAG_COEF 0.03


/*
 *	Velocity thresholds:
 */
#define WARP_THRESHOLD       0.04
#define TRANSWARP_THRESHOLD  0.3


/*
 *	Frequency ranges (in kHz):
 *
 *	(Note: Frequency compare resolution is 2 decimal places).
 */
#define SWR_FREQ_MIN		1.00
#define SWR_FREQ_MAX		900.00


/*
 *	Short-range (non subspace) communications range:
 *
 *	Radius range for sending regular communication messages and
 *	hails.  Units are in XSW Real units.
 */
#define COM_SHORT_RANGE_MAX	100


/*
 *	Shield phaze visibility interval:
 *
 *	In milliseconds.
 */
#define SHIELD_VISIBILITY_INTERVAL	3000


/*
 *	Visibility in a nebula:
 */
#define VISIBILITY_NEBULA	0.15


/*
 *	Maximum switchable throttle power:
 *
 *	Cannot switch throttle to reverse if throttle setting is
 *	greater than this value.
 */
#define THROTTLE_MAX_SWITCH	0.3

   
/*
 *	PI Constants:
 */
#ifndef PI
    #define PI		3.141592654
#endif

#ifndef TWOPI
    #define TWOPI	6.283185307
#endif

#ifndef HALFPI
    #define HALFPI	1.570796327
#endif



/*
 *	Unit conversion defaults:
 *
 *	Must be greater than 0!
 *
 *	1 AU = 149,600,000 km
 */
#define DEF_UNITCONV_RU_TO_AU	0.1


/*
 *	Unit conversions:
 */
typedef struct {                           

        double ru_to_au;        /* SW Real units to Astronomical units. */

} sw_units_struct;
sw_units_struct sw_units;





#endif /* REALITY_H */