Oolite
Loading...
Searching...
No Matches
OOPlanetEntity.h
Go to the documentation of this file.
1/*
2
3OOPlanetEntity.h
4
5Entity subclass representing a planet.
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#if !NEW_PLANETS
29#import "PlanetEntity.h"
30#else
31
32#import "Entity.h"
33#import "OOColor.h"
34
36
37@interface OOPlanetEntity : Entity <OOStellarBody> {
38@private
39 OOPlanetDrawable* _planetDrawable;
40 OOPlanetDrawable* _atmosphereDrawable;
41 OOPlanetDrawable* _cloudsShaderDrawable;
42 OOPlanetDrawable* _atmosphereShaderDrawable;
43
44 BOOL _miniature;
45 OOColor* _airColor;
46 OOColor* _illuminationColor;
47 float _airColorMixRatio;
48 float _airDensity;
49 double _mesopause2;
50
51 Vector _rotationAxis;
52 float _rotationalVelocity;
53 Quaternion _atmosphereOrientation;
54 float _atmosphereRotationalVelocity;
55
56 Vector _terminatorThresholdVector;
57
58 unsigned _shuttlesOnGround;
59 OOTimeDelta _lastLaunchTime;
60 OOTimeDelta _shuttleLaunchInterval;
61
62 NSDictionary* _materialParameters;
63 NSString* _textureName;
64 NSString* _normSpecMapName;
65
66 NSString* _name;
67}
68
69- (id)initAsMainPlanetForSystem:(OOSystemID)s;
70
71- (id)initFromDictionary:(NSDictionary*)dict withAtmosphere:(BOOL)atmosphere andSeed:(Random_Seed)seed forSystem:(OOSystemID)systemID;
72
73- (instancetype)miniatureVersion;
74
75- (double)rotationalVelocity;
76- (void)setRotationalVelocity:(double)v;
77
78- (BOOL)planetHasStation;
79- (void)launchShuttle;
80- (void)welcomeShuttle:(ShipEntity*)shuttle;
81
82- (BOOL)hasAtmosphere;
83
84// FIXME: need material model.
85- (NSString*)textureFileName;
86- (void)setTextureFileName:(NSString*)textureName;
87
88- (BOOL)setUpPlanetFromTexture:(NSString*)fileName;
89
90- (OOMaterial*)material;
91- (OOMaterial*)atmosphereMaterial;
92- (OOMaterial*)atmosphereShaderMaterial;
93
94- (BOOL)isFinishedLoading;
95
96- (Vector)airColorAsVector; // visible to shader bindings
97- (OOColor*)airColor;
98- (void)setAirColor:(OOColor*)newColor;
99- (Vector)illuminationColorAsVector; // visible to shader bindings
100- (OOColor*)illuminationColor;
101- (void)setIlluminationColor:(OOColor*)newColor;
102- (float)airColorMixRatio; // visible to shader bindings
103- (void)setAirColorMixRatio:(float)newRatio;
104- (float)airDensity; // visible to shafer bindings
105- (void)setAirDensity:(float)newDensity;
106
107- (void)setTerminatorThresholdVector:(Vector)newTerminatorThresholdVector;
108- (Vector)terminatorThresholdVector; // visible to shader bindings
109
110@end
111
112#endif // NEW_PLANETS
struct Quaternion Quaternion
int16_t OOSystemID
Definition OOTypes.h:183
double OOTimeDelta
Definition OOTypes.h:193
struct Vector Vector