Line data Source code
1 0 : /* 2 : 3 : OOPlanetEntity.h 4 : 5 : Entity subclass representing a planet. 6 : 7 : Oolite 8 : Copyright (C) 2004-2013 Giles C Williams and contributors 9 : 10 : This program is free software; you can redistribute it and/or 11 : modify it under the terms of the GNU General Public License 12 : as published by the Free Software Foundation; either version 2 13 : of the License, or (at your option) any later version. 14 : 15 : This program is distributed in the hope that it will be useful, 16 : but WITHOUT ANY WARRANTY; without even the implied warranty of 17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 : GNU General Public License for more details. 19 : 20 : You should have received a copy of the GNU General Public License 21 : along with this program; if not, write to the Free Software 22 : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 : MA 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 : 35 : 36 : @class OOPlanetDrawable, ShipEntity, OOMaterial; 37 : 38 : 39 : @interface OOPlanetEntity: Entity <OOStellarBody> 40 : { 41 : @private 42 : OOPlanetDrawable *_planetDrawable; 43 : OOPlanetDrawable *_atmosphereDrawable; 44 : OOPlanetDrawable *_atmosphereShaderDrawable; 45 : 46 : BOOL _miniature; 47 : OOColor *_airColor; 48 : OOColor *_illuminationColor; 49 : float _airColorMixRatio; 50 : float _airDensity; 51 : double _mesopause2; 52 : 53 : Vector _rotationAxis; 54 : float _rotationalVelocity; 55 : Quaternion _atmosphereOrientation; 56 : float _atmosphereRotationalVelocity; 57 : 58 : Vector _terminatorThresholdVector; 59 : 60 : unsigned _shuttlesOnGround; 61 : OOTimeDelta _lastLaunchTime; 62 : OOTimeDelta _shuttleLaunchInterval; 63 : 64 : NSDictionary *_materialParameters; 65 : NSString *_textureName; 66 : NSString *_normSpecMapName; 67 : 68 : NSString *_name; 69 : } 70 : 71 : - (id) initAsMainPlanetForSystem:(OOSystemID)s; 72 : 73 : - (id) initFromDictionary:(NSDictionary *)dict withAtmosphere:(BOOL)atmosphere andSeed:(Random_Seed)seed forSystem:(OOSystemID)systemID; 74 : 75 : - (instancetype) miniatureVersion; 76 : 77 : - (double) rotationalVelocity; 78 : - (void) setRotationalVelocity:(double) v; 79 : 80 : - (BOOL) planetHasStation; 81 : - (void) launchShuttle; 82 : - (void) welcomeShuttle:(ShipEntity *)shuttle; 83 : 84 : - (BOOL) hasAtmosphere; 85 : 86 : // FIXME: need material model. 87 : - (NSString *) textureFileName; 88 : - (void) setTextureFileName:(NSString *)textureName; 89 : 90 : - (BOOL) setUpPlanetFromTexture:(NSString *)fileName; 91 : 92 : - (OOMaterial *) material; 93 : - (OOMaterial *) atmosphereMaterial; 94 : - (OOMaterial *) atmosphereShaderMaterial; 95 : 96 : - (BOOL) isFinishedLoading; 97 : 98 : - (Vector) airColorAsVector; // visible to shader bindings 99 : - (OOColor *) airColor; 100 : - (void) setAirColor:(OOColor *) newColor; 101 : - (Vector) illuminationColorAsVector; // visible to shader bindings 102 : - (OOColor *) illuminationColor; 103 : - (void) setIlluminationColor:(OOColor *) newColor; 104 : - (float) airColorMixRatio; // visible to shader bindings 105 : - (void) setAirColorMixRatio:(float) newRatio; 106 : - (float) airDensity; // visible to shafer bindings 107 : - (void) setAirDensity: (float) newDensity; 108 : 109 : - (void) setTerminatorThresholdVector:(Vector) newTerminatorThresholdVector; 110 : - (Vector) terminatorThresholdVector; // visible to shader bindings 111 : 112 : @end 113 : 114 : #endif // NEW_PLANETS