Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
PlanetEntity.h
Go to the documentation of this file.
1/*
2
3PlanetEntity.h
4
5Entity subclass representing a planet or an atmosphere.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
27#import "OOStellarBody.h"
28
29#if !NEW_PLANETS
30
31#import "Entity.h"
32#import "legacy_random.h"
33#import "OOColor.h"
34
35@class OOTexture;
36
37
38#define MAX_TRI_INDICES 3*(20+80+320+1280+5120+20480)
39#define MAX_PLANET_VERTICES 10400
40
41
42typedef struct
43{
44 Vector vertex_array[MAX_PLANET_VERTICES + 2];
45 GLfloat color_array[4*MAX_PLANET_VERTICES];
46 GLfloat uv_array[2*MAX_PLANET_VERTICES];
47 Vector normal_array[MAX_PLANET_VERTICES];
48 GLuint index_array[MAX_TRI_INDICES];
50
51
52#define PlanetEntity OOPlanetEntity
53
54
56{
57@private
60 uint8_t lastSubdivideLevel;
62 BOOL isTextureImage; // is the texture explicitly specified (as opposed to synthesized)?
66 int planet_seed;
71 GLfloat amb_land[4];
72 GLfloat amb_polar_land[4];
73 GLfloat amb_sea[4];
74 GLfloat amb_polar_sea[4];
76 PlanetEntity *atmosphere; // secondary sphere used to show atmospheric details
77 PlanetEntity *root_planet; // link back to owning planet (not retained)
79 int shuttles_on_ground; // starting number of shuttles
80 double last_launch_time; // space launches out by about 15 minutes
81 double shuttle_launch_interval; // space launches out by about 15 minutes
83 double sqrt_zero_distance;
85 GLuint displayListNames[MAX_SUBDIVIDE];
89 Vector rotationAxis;
91
92- (id) initFromDictionary:(NSDictionary*)dict withAtmosphere:(BOOL)atmo andSeed:(Random_Seed)p_seed;
93- (void) miniaturize;
94
95- (BOOL) setUpPlanetFromTexture:(NSString *)fileName;
96
97- (int) planet_seed;
98- (BOOL) isTextured;
99- (BOOL) isExplicitlyTextured; // Specified texture, not synthesized.
100- (OOTexture *) texture;
101- (NSString *) textureFileName;
102
103- (double) polar_color_factor;
104- (GLfloat *) amb_land;
105- (GLfloat *) amb_polar_land;
106- (GLfloat *) amb_sea;
107- (GLfloat *) amb_polar_sea;
108
109- (OOStellarBodyType) planetType;
110- (void) setPlanetType:(OOStellarBodyType) pt;
111
112
113- (double) radius; // metres
114- (void) setRadius:(GLfloat) rad;
115- (double) rotationalVelocity;
116- (void) setRotationalVelocity:(double) v;
117
118- (BOOL) hasAtmosphere;
119
120- (void) launchShuttle;
121
122- (void) welcomeShuttle:(ShipEntity *) shuttle;
123
124- (void) drawUnconditionally;
125
126#ifndef NDEBUG
127- (PlanetEntity *) atmosphere;
128#endif
129
130@end
131
132
133#endif // !NEW_PLANETS
OOStellarBodyType
#define MAX_PLANET_VERTICES
#define MAX_TRI_INDICES
double rotational_velocity
double last_launch_time
Vector rotationAxis
GLfloat amb_polar_sea[4]
double shuttle_launch_interval
double sqrt_zero_distance
PlanetEntity * root_planet
uint8_t lastSubdivideLevel
GLuint vertexCount
OOTexture * _texture
GLfloat amb_polar_land[4]
NSString * _textureFileName
double polar_color_factor
GLfloat amb_land[4]
BOOL useTexturedModel
BOOL isTextureImage
GLfloat amb_sea[4]
PlanetEntity * atmosphere
GLuint displayListNames[MAX_SUBDIVIDE]
OOStellarBodyType planet_type
int shuttles_on_ground
VertexData vertexdata
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque