Oolite
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#pragma once
28
29#import "OOStellarBody.h"
30
31#if !NEW_PLANETS
32
33#import "Entity.h"
34#import "OOColor.h"
35#import "legacy_random.h"
36
37@class OOTexture;
38
39#define MAX_TRI_INDICES 3 * (20 + 80 + 320 + 1280 + 5120 + 20480)
40#define MAX_PLANET_VERTICES 10400
41
50
51#define PlanetEntity OOPlanetEntity
52
54@private
56
59 BOOL isTextureImage; // is the texture explicitly specified (as opposed to synthesized)?
62
63 int planet_seed;
64 double polar_color_factor;
65
67
68 GLfloat amb_land[4];
69 GLfloat amb_polar_land[4];
70 GLfloat amb_sea[4];
71 GLfloat amb_polar_sea[4];
72
73 PlanetEntity* atmosphere; // secondary sphere used to show atmospheric details
74 PlanetEntity* root_planet; // link back to owning planet (not retained)
75
76 int shuttles_on_ground; // starting number of shuttles
77 double last_launch_time; // space launches out by about 15 minutes
78 double shuttle_launch_interval; // space launches out by about 15 minutes
79
81
82 GLuint displayListNames[MAX_SUBDIVIDE];
85
87}
88
89- (id)initFromDictionary:(NSDictionary*)dict withAtmosphere:(BOOL)atmo andSeed:(Random_Seed)p_seed;
90- (void)miniaturize;
91
92- (BOOL)setUpPlanetFromTexture:(NSString*)fileName;
93
95- (BOOL)isTextured;
96- (BOOL)isExplicitlyTextured; // Specified texture, not synthesized.
98- (NSString*)textureFileName;
99
101- (GLfloat*)amb_land;
102- (GLfloat*)amb_polar_land;
103- (GLfloat*)amb_sea;
104- (GLfloat*)amb_polar_sea;
105
107- (void)setPlanetType:(OOStellarBodyType)pt;
108
109- (double)radius; // metres
110- (void)setRadius:(GLfloat)rad;
111- (double)rotationalVelocity;
112- (void)setRotationalVelocity:(double)v;
113
114- (BOOL)hasAtmosphere;
115
116- (void)launchShuttle;
117
118- (void)welcomeShuttle:(ShipEntity*)shuttle;
119
120- (void)drawUnconditionally;
121
122#ifdef OO_DEBUG_MONITOR_ENABLED
124#endif
125
126@end
127
128#endif // !NEW_PLANETS
OOStellarBodyType
#define PlanetEntity
#define MAX_PLANET_VERTICES
#define MAX_TRI_INDICES
double rotational_velocity
double last_launch_time
Vector rotationAxis
NSString * textureFileName()
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
OOTexture * texture()
double polar_color_factor
BOOL isExplicitlyTextured()
void drawUnconditionally()
GLfloat amb_land[4]
BOOL useTexturedModel
PlanetEntity * atmosphere
BOOL isTextureImage
GLfloat amb_sea[4]
GLuint displayListNames[MAX_SUBDIVIDE]
OOStellarBodyType planet_type
int shuttles_on_ground
double rotationalVelocity()
OOStellarBodyType planetType()
VertexData vertexdata
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
GLuint index_array[MAX_TRI_INDICES]
GLfloat color_array[4 *MAX_PLANET_VERTICES]
GLfloat uv_array[2 *MAX_PLANET_VERTICES]
Vector vertex_array[MAX_PLANET_VERTICES+2]
Vector normal_array[MAX_PLANET_VERTICES]