48#define NSIntegerMapKeyCallBacks NSIntMapKeyCallBacks
49#define NSIntegerMapValueCallBacks NSIntMapValueCallBacks
64@interface PlanetEntity (OOPrivate) <OOGraphicsResetClient>
68- (void)drawModelWithVertexArraysAndSubdivision:(
int)subdivide;
72- (void)initialiseBaseTerrainArray:(
int)percent_land;
73- (void)paintVertex:(
unsigned)vi seed:(
int)seed;
76- (id)initAsAtmosphereForPlanet:(
PlanetEntity*)planet dictionary:(NSDictionary*)dict;
77- (void)setTextureColorForPlanet:(BOOL)isMain inSystem:(BOOL)isLocal;
79- (id)initMiniatureFromPlanet:(
PlanetEntity*)planet withAlpha:(
float)alpha;
81- (void)loadTexture:(NSDictionary*)configuration;
82- (
OOTexture*)planetTextureWithInfo:(NSDictionary*)info;
83- (
OOTexture*)cloudTextureWithCloudColor:(
OOColor*)cloudColor cloudImpress:(GLfloat)cloud_impress cloudBias:(GLfloat)cloud_bias;
87- (void)setUseTexturedModel:(BOOL)flag;
101 { +0.000000, -0.850664, -0.525710 },
102 { +0.000000, -0.850664, +0.525710 },
103 { +0.000000, +0.850664, +0.525710 },
104 { +0.000000, +0.850664, -0.525710 },
105 { -0.525710, +0.000000, -0.850664 },
106 { +0.525710, +0.000000, -0.850664 },
107 { +0.525710, +0.000000, +0.850664 },
108 { -0.525710, +0.000000, +0.850664 },
109 { -0.850664, -0.525710, +0.000000 },
110 { -0.850664, +0.525710, +0.000000 },
111 { +0.850664, +0.525710, +0.000000 },
112 { +0.850664, -0.525710, +0.000000 }
116 { { 9, +0.600000, +0.666667 }, { 7, +0.800000, +0.666667 }, { 8, +0.800000, +0.333333 } },
117 { { 8, +0.800000, +0.333333 }, { 4, +0.600000, +0.333333 }, { 9, +0.600000, +0.666667 } },
118 { { 3, +0.400000, +0.666667 }, { 9, +0.600000, +0.666667 }, { 4, +0.600000, +0.333333 } },
119 { { 8, +0.800000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 4, +0.600000, +0.333333 } },
120 { { 7, +0.800000, +0.666667 }, { 1, +1.000000, +0.333333 }, { 8, +0.800000, +0.333333 } },
121 { { 2, +0.500000, +1.000000 }, { 7, +0.800000, +0.666667 }, { 9, +0.600000, +0.666667 } },
122 { { 2, +0.500000, +1.000000 }, { 9, +0.600000, +0.666667 }, { 3, +0.400000, +0.666667 } },
123 { { 1, +1.000000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 8, +0.800000, +0.333333 } },
124 { { 4, +0.600000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 5, +0.400000, +0.333333 } },
125 { { 5, +0.400000, +0.333333 }, { 3, +0.400000, +0.666667 }, { 4, +0.600000, +0.333333 } },
126 { { 6, +1.000000, +0.666667 }, { 1, +1.000000, +0.333333 }, { 7, +0.800000, +0.666667 } },
127 { { 7, +0.800000, +0.666667 }, { 2, +0.500000, +1.000000 }, { 6, +1.000000, +0.666667 } },
128 { { 1, +0.000000, +0.333333 }, { 11, +0.200000, +0.333333 }, { 0, +0.500000, +0.000000 } },
129 { { 3, +0.400000, +0.666667 }, { 10, +0.200000, +0.666667 }, { 2, +0.500000, +1.000000 } },
130 { { 0, +0.500000, +0.000000 }, { 11, +0.200000, +0.333333 }, { 5, +0.400000, +0.333333 } },
131 { { 5, +0.400000, +0.333333 }, { 10, +0.200000, +0.666667 }, { 3, +0.400000, +0.666667 } },
132 { { 1, +0.000000, +0.333333 }, { 6, +0.000000, +0.666667 }, { 11, +0.200000, +0.333333 } },
133 { { 6, +0.000000, +0.666667 }, { 2, +0.500000, +1.000000 }, { 10, +0.200000, +0.666667 } },
134 { { 5, +0.400000, +0.333333 }, { 11, +0.200000, +0.333333 }, { 10, +0.200000, +0.666667 } },
135 { { 11, +0.200000, +0.333333 }, { 6, +0.000000, +0.666667 }, { 10, +0.200000, +0.666667 } }
139 { +0.525731, +0.000000, +0.850651 },
140 { -0.525731, +0.000000, +0.850651 },
141 { +0.525731, +0.000000, -0.850651 },
142 { -0.525731, +0.000000, -0.850651 },
143 { +0.000000, +0.850651, +0.525731 },
144 { +0.000000, +0.850651, -0.525731 },
145 { +0.000000, -0.850651, +0.525731 },
146 { +0.000000, -0.850651, -0.525731 },
147 { -0.850651, +0.525731, +0.000000 },
148 { +0.850651, +0.525731, +0.000000 },
149 { -0.850651, -0.525731, +0.000000 },
150 { +0.850651, -0.525731, +0.000000 },
151 { +0.000000, +0.850651, -0.525731 },
152 { +0.525731, +0.000000, -0.850651 }
156 { { 1, +0.400000, +0.666667 }, { 0, +0.600000, +0.666667 }, { 6, +0.500000, +0.333333 } },
157 { { 3, +0.100000, +0.333333 }, { 2, -0.100000, +0.333333 }, { 5, +0.000000, +0.666667 } },
158 { { 4, +0.500000, +1.000000 }, { 0, +0.600000, +0.666667 }, { 1, +0.400000, +0.666667 } },
159 { { 4, +0.500000, +1.000000 }, { 1, +0.400000, +0.666667 }, { 8, +0.200000, +0.666667 } },
160 { { 12, +1.000000, +0.666667 }, { 13, +0.900000, +0.333333 }, { 9, +0.800000, +0.666667 } },
161 { { 5, +0.000000, +0.666667 }, { 4, +0.500000, +1.000000 }, { 8, +0.200000, +0.666667 } },
162 { { 6, +0.500000, +0.333333 }, { 0, +0.600000, +0.666667 }, { 11, +0.700000, +0.333333 } },
163 { { 7, +0.500000, +0.000000 }, { 2, -0.100000, +0.333333 }, { 3, +0.100000, +0.333333 } },
164 { { 7, +0.500000, +0.000000 }, { 3, +0.100000, +0.333333 }, { 10, +0.300000, +0.333333 } },
165 { { 7, +0.500000, +0.000000 }, { 6, +0.500000, +0.333333 }, { 11, +0.700000, +0.333333 } },
166 { { 8, +0.200000, +0.666667 }, { 1, +0.400000, +0.666667 }, { 10, +0.300000, +0.333333 } },
167 { { 8, +0.200000, +0.666667 }, { 3, +0.100000, +0.333333 }, { 5, +0.000000, +0.666667 } },
168 { { 9, +0.800000, +0.666667 }, { 0, +0.600000, +0.666667 }, { 4, +0.500000, +1.000000 } },
169 { { 9, +0.800000, +0.666667 }, { 13, +0.900000, +0.333333 }, { 11, +0.700000, +0.333333 } },
170 { { 9, +0.800000, +0.666667 }, { 4, +0.500000, +1.000000 }, { 12, +1.000000, +0.666667 } },
171 { { 10, +0.300000, +0.333333 }, { 1, +0.400000, +0.666667 }, { 6, +0.500000, +0.333333 } },
172 { { 10, +0.300000, +0.333333 }, { 3, +0.100000, +0.333333 }, { 8, +0.200000, +0.666667 } },
173 { { 10, +0.300000, +0.333333 }, { 6, +0.500000, +0.333333 }, { 7, +0.500000, +0.000000 } },
174 { { 11, +0.700000, +0.333333 }, { 0, +0.600000, +0.666667 }, { 9, +0.800000, +0.666667 } },
175 { { 11, +0.700000, +0.333333 }, { 13, +0.900000, +0.333333 }, { 7, +0.500000, +0.000000 } }
183 [
NSException raise:NSInternalInconsistencyException format:@"%s, believed dead, called.", __PRETTY_FUNCTION__];
187- (id)initAsAtmosphereForPlanet:(
PlanetEntity*)planet dictionary:(NSDictionary*)dict
189 BOOL procGen = [UNIVERSE doProcedurallyTexturedPlanets];
196 int percent_land = 100 - [
dict oo_intForKey:@"percent_cloud" defaultValue:100 - (3 + (gen_rnd_number() & 31) + (gen_rnd_number() & 31))];
198 polar_color_factor = 1.0;
200#define CLEAR_SKY_ALPHA 0.05
201#define CLOUD_ALPHA 0.50
202#define POLAR_CLEAR_SKY_ALPHA 0.34
203#define POLAR_CLOUD_ALPHA 0.75
233 cloudAlpha =
OOClamp_0_1_f([dict oo_floatForKey:
@"cloud_alpha" defaultValue:1.0]);
235 if (clearSkyColor !=
nil) {
239 if (cloudColor !=
nil) {
243 if (polarClearSkyColor !=
nil) {
245 }
else if (clearSkyColor !=
nil) {
246 memmove(amb_polar_land, amb_land,
sizeof amb_polar_land);
250 if (polarCloudColor !=
nil) {
252 }
else if (cloudColor !=
nil) {
253 memmove(amb_polar_sea, amb_sea,
sizeof amb_polar_sea);
258 amb_sea[3] *= cloudAlpha;
259 amb_polar_land[3] *= cloudAlpha;
260 amb_polar_sea[3] *= cloudAlpha;
271 float cloud_bias = -0.01 * (float)percent_land;
272 float cloud_impress = 1.0 - cloud_bias;
283 OOLogERR(
@"planet.atmosphere.init.noPlanet",
@"planet entity initAsAtmosphereForPlanet: no planet found.");
297 shuttles_on_ground = 0;
298 last_launch_time = 0.0;
299 shuttle_launch_interval = 3600.0;
301 scanClass = CLASS_NO_DRAW;
317 [
self paintVertex:i:planet_seed];
323 rotational_velocity = [
dict oo_floatForKey:@"atmosphere_rotational_velocity" defaultValue:[
planet rotationalVelocity] * (0.9 + (randf() * 0.2))];
325 root_planet = planet;
351- (id)initFromDictionary:(NSDictionary*)dict withAtmosphere:(BOOL)atmo andSeed:(
Random_Seed)p_seed
353 BOOL procGen = [UNIVERSE doProcedurallyTexturedPlanets];
373 NSDictionary* textureSpec = [
dict oo_textureSpecifierForKey:@"texture" defaultName:nil];
374 if (textureSpec !=
nil) {
385 NSString* seedStr = [
dict oo_stringForKey:@"seed"];
386 if (seedStr !=
nil) {
391 OOLogERR(
@"planet.fromDict",
@"could not interpret \"%@\
" as planet seed, using default.", seedStr);
398 NSMutableDictionary* planetInfo = [
NSMutableDictionary dictionaryWithDictionary:[UNIVERSE generateSystemData:p_seed]];
399 int radius_km = [
dict oo_intForKey:KEY_RADIUS
400 defaultValue:[
planetInfo oo_intForKey:KEY_RADIUS]];
401 int techlevel = [
dict oo_intForKey:KEY_TECHLEVEL
402 defaultValue:[
planetInfo oo_intForKey:KEY_TECHLEVEL]];
421 int percent_land = [
planetInfo oo_intForKey:@"percent_land" defaultValue:24 + (gen_rnd_number() % 48)];
432 [
planetInfo setObject:[
NSNumber numberWithFloat:0.01 * percent_land] forKey:@"land_fraction"];
436 Vector land_hsb, sea_hsb, land_polar_hsb, sea_polar_hsb;
468 land_polar_hsb.
x = land_hsb.
x;
469 land_polar_hsb.
y = (land_hsb.
y / 4.0);
470 land_polar_hsb.
z = 1.0 - (land_hsb.
z / 10.0);
471 sea_polar_hsb.
x = sea_hsb.
x;
472 sea_polar_hsb.
y = (sea_hsb.
y / 4.0);
473 sea_polar_hsb.
z = 1.0 - (sea_hsb.
z / 10.0);
497 [
planetInfo setObject:amb_land_color forKey:@"land_color"];
498 [
planetInfo setObject:amb_sea_color forKey:@"sea_color"];
499 [
planetInfo setObject:amb_polar_land_color forKey:@"polar_land_color"];
500 [
planetInfo setObject:amb_polar_sea_color forKey:@"polar_sea_color"];
513 [
self paintVertex:i:planet_seed];
518 if ([dict objectForKey:
@"rotational_velocity"]) {
526 NSDictionary* atmoDict = dict;
528 atmoDict = [
NSDictionary dictionaryWithObjectsAndKeys:@"0", @"percent_cloud", [
NSNumber numberWithFloat:[
planetInfo oo_floatForKey:@"cloud_alpha" defaultValue:1.0]], @"cloud_alpha", nil];
530 atmosphere = [[PlanetEntity alloc] initAsAtmosphereForPlanet:
self dictionary:atmoDict];
544 int deltaT = floor(fmod([
PLAYER clockTimeAdjusted], 86400));
569 NSString* typeString;
572 typeString =
@"STELLAR_TYPE_MINIATURE";
575 typeString =
@"STELLAR_TYPE_NORMAL_PLANET";
578 typeString =
@"STELLAR_TYPE_ATMOSPHERE";
581 typeString =
@"STELLAR_TYPE_MOON";
585 typeString =
@"UNKNOWN";
587 return [
NSString stringWithFormat:@"ID: %u position: %@ type: %@ radius: %.3fkm", [
self universalID], HPVectorDescription([
self position]), typeString, 0.001 * [
self radius]];
606- (BOOL)checkCloseCollisionWith:(
Entity*)other
608#ifdef OO_DEBUG_MONITOR_ENABLED
610 OOLog(
@"planet.collide",
@"PLANET Collision!");
617 if ([ship behaviour] == BEHAVIOUR_LAND_ON_PLANET) {
621 if ([ship reportAIMessages]) {
623 OOLog(
@"planet.collide.shipHit",
@"DEBUG: %@ %d collided with planet at (%.1f,%.1f,%.1f)", [ship
name], [ship
universalID], p1.
x, p1.
y, p1.
z);
643 if ((alt > 0) && (alt <= atmo)) {
644 double aleph = (atmo - alt) / atmo;
650 [UNIVERSE setSkyColorRed:0.8 * aleph * aleph
651 green:0.8 * aleph * aleph
654 }
else if (alt > 0 && alt <= atmo * 1.5) {
660 [UNIVERSE setSkyColorRed:0.0f
667 double ugt = [UNIVERSE getTime];
709- (void)setUseTexturedModel:(BOOL)flag
712 useTexturedModel = YES;
715 useTexturedModel = NO;
721- (void)drawImmediate:(
bool)immediate translucent:(
bool)translucent
723 if ([
UNIVERSE breakPatternHide] || translucent || immediate)
741 uint8_t subdivideLevel = 2;
743 double drawFactor = [[UNIVERSE gameView] viewSize].width / 100.0;
747 subdivideLevel = 2 + floor(drawRatio2);
748 if (subdivideLevel > 4)
753 subdivideLevel = [UNIVERSE reducedDetail] ? 3 : 4;
759 OOGL(glPushAttrib(GL_ENABLE_BIT));
763 GLfloat specular[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
764 OOGL(glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular));
765 OOGL(glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0));
781 ignoreDepthBuffer |= YES;
792 OOGL(glEnable(GL_BLEND));
808 GLfloat mat1[] = { 1.0, 1.0, 1.0, 1.0 };
812#if OO_TEXTURE_CUBE_MAP
813 OOGL(glDisable(GL_TEXTURE_2D));
814 OOGL(glEnable(GL_TEXTURE_CUBE_MAP));
819 OOGL(glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, mat1));
822 OOGL(glDisable(GL_TEXTURE_2D));
826 OOGL(glShadeModel(GL_SMOOTH));
829 if (ignoreDepthBuffer) {
830 OOGL(glDisable(GL_DEPTH_TEST));
833 OOGL(glColor4fv(mat1));
834 OOGL(glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat1));
836 OOGL(glEnableClientState(GL_COLOR_ARRAY));
844 OOGL(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
851 OOGL(glDisableClientState(GL_TEXTURE_COORD_ARRAY));
863 OOGL(glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE));
864 OOGL(glEnable(GL_COLOR_MATERIAL));
868 OOGL(glDisable(GL_COLOR_MATERIAL));
873#if OO_TEXTURE_CUBE_MAP
875 OOGL(glDisable(GL_TEXTURE_CUBE_MAP));
876 OOGL(glEnable(GL_TEXTURE_2D));
880 OOGL(glDisableClientState(GL_COLOR_ARRAY));
881 OOGL(glDisableClientState(GL_TEXTURE_COORD_ARRAY));
882 OOGL(glEnable(GL_DEPTH_TEST));
898 if (ignoreDepthBuffer) {
899 OOGL(glEnable(GL_DEPTH_TEST));
901 OOGL(glEnable(GL_TEXTURE_2D));
903 OOGL(glDisable(GL_BLEND));
920#ifdef OO_DEBUG_MONITOR_ENABLED
942- (void)setTextureColorForPlanet:(BOOL)isMain inSystem:(BOOL)isLocal
944 Vector land_hsb, land_polar_hsb;
957 land_polar_hsb.
x = land_hsb.
x;
958 land_polar_hsb.
y = (land_hsb.
y / 5.0);
959 land_polar_hsb.
z = 1.0 - (land_hsb.
z / 10.0);
964 amb_sea[3] = amb_land[3] = 1.0;
968 amb_polar_sea[3] = amb_polar_land[3] = 1.0;
971- (BOOL)setUpPlanetFromTexture:(NSString*)fileName
976 [
self loadTexture:OOTextureSpecFromObject(fileName, nil)];
989 [
self paintVertex:i:planet_seed];
994 GLfloat oldCloudAlpha = 0.0;
999 NSDictionary* atmo_dictionary = [
NSDictionary dictionaryWithObjectsAndKeys:@"0", @"percent_cloud", [
NSNumber numberWithFloat:oldCloudAlpha], @"cloud_alpha", nil];
1048- (void)setRadius:(GLfloat)rad
1058- (void)setRotationalVelocity:(
double)v
1069 return sqrt_zero_distance;
1077- (void)drawModelWithVertexArraysAndSubdivision:(
int)subdivide
1093 launch_pos.
x += start_distance * vf.
x;
1094 launch_pos.
y += start_distance * vf.
y;
1095 launch_pos.
z += start_distance * vf.
z;
1097 shuttle_ship = [UNIVERSE newShipWithRole:@"shuttle"];
1099 if (![shuttle_ship crew]) {
1109 [UNIVERSE addEntity:shuttle_ship];
1123 static BOOL lastOneWasTextured;
1125 if (lastOneWasTextured != isTextured) {
1130 lastOneWasTextured = isTextured;
1134 sEdgeToVertex = NSCreateMapTable(NSIntegerMapKeyCallBacks, NSIntegerMapValueCallBacks, 7680);
1137 const Vector* vertices = NULL;
1139 GLuint faceCount = 0;
1140 if (useTexturedModel) {
1152 for (vi = 0; vi < vertexCount; vi++) {
1160 for (fi = 0; fi < faceCount; fi++) {
1162 for (j = 0; j < 3; j++) {
1171 for (sublevel = 0; sublevel <
MAX_SUBDIVIDE - 1; sublevel++) {
1172 int newlevel = sublevel + 1;
1219 void* key = (
void*)(((uintptr_t)va << 16) | vb);
1223 return (
unsigned)num - 1;
1239 if (uva.y == 0.0 || uva.y == 1.0)
1241 if (uvb.y == 0.0 || uvb.y == 1.0)
1255- (void)initialiseBaseTerrainArray:(
int)percent_land
1260 if (percent_land >= 0) {
1262 for (vi = 0; vi < vertexCount; vi++) {
1274 for (sublevel = 0; sublevel <
MAX_SUBDIVIDE - 1; sublevel++) {
1320- (void)paintVertex:(
unsigned)vi seed:(
int)seed
1323 BOOL isTextured = _texture !=
nil;
1325 GLfloat paint_land[4] = { 0.2, 0.9, 0.0, 1.0 };
1326 GLfloat paint_sea[4] = { 0.0, 0.2, 0.9, 1.0 };
1327 GLfloat paint_color[4];
1331 double pole_blend = v.
z * v.
z * polar_color_factor;
1332 if (pole_blend < 0.0)
1334 if (pole_blend > 1.0)
1337 paint_land[0] = (1.0 - pole_blend) * amb_land[0] + pole_blend * amb_polar_land[0];
1338 paint_land[1] = (1.0 - pole_blend) * amb_land[1] + pole_blend * amb_polar_land[1];
1339 paint_land[2] = (1.0 - pole_blend) * amb_land[2] + pole_blend * amb_polar_land[2];
1340 paint_sea[0] = (1.0 - pole_blend) * amb_sea[0] + pole_blend * amb_polar_sea[0];
1341 paint_sea[1] = (1.0 - pole_blend) * amb_sea[1] + pole_blend * amb_polar_sea[1];
1342 paint_sea[2] = (1.0 - pole_blend) * amb_sea[2] + pole_blend * amb_polar_sea[2];
1345 paint_land[3] = (1.0 - pole_blend) * amb_land[3] + pole_blend * amb_polar_land[3];
1346 paint_sea[3] = (1.0 - pole_blend) * amb_sea[3] + pole_blend * amb_polar_sea[3];
1351 for (i = 0; i < 3; i++) {
1353 paint_land[
i] += (cv - 0.5) * 0.1;
1354 paint_sea[
i] += (cv - 0.5) * 0.1;
1357 for (i = 0; i < 4; i++) {
1359 paint_color[
i] = 1.0;
1361 paint_color[
i] = (r * paint_sea[
i]) * 0.01 + ((100 - r) * paint_land[i]) * 0.01;
1363 vertexdata.color_array[
vi * 4 + i] = paint_color[
i];
1374 vertexdata.normal_array[
vi] = v;
1375 vertexdata.vertex_array[
vi] =
make_vector(v.
x * collision_radius, v.
y * collision_radius, v.
z * collision_radius);
1386 if (displayListNames[i] != 0) {
1387 glDeleteLists(displayListNames[i], 1);
1388 displayListNames[
i] = 0;
1408- (void)loadTexture:(NSDictionary*)configuration
1415 if (_texture !=
nil) {
1416 _textureFileName = [[
configuration oo_stringForKey:@"name"] copy];
1417 isTextureImage = YES;
1419 _textureFileName =
nil;
1420 isTextureImage = NO;
1432 unsigned char* data;
1433 GLuint width, height;
1445 textureOptions:kOOTextureDefaultOptions | kOOTextureRepeatS
1452- (
OOTexture*)cloudTextureWithCloudColor:(
OOColor*)cloudColor cloudImpress:(GLfloat)cloud_impress cloudBias:(GLfloat)cloud_bias
1454 unsigned char* data;
1455 GLuint width, height;
1459 cloudColor:cloud_impress
1469 textureOptions:kOOTextureDefaultOptions | kOOTextureRepeatS
1476#ifdef OO_DEBUG_MONITOR_ENABLED
1477- (NSSet*)allTextures
1479 if (_texture !=
nil)
1480 return [NSSet setWithObject:_texture];
OOINLINE float OOClamp_0_1_f(float value) INLINE_CONST_FUNC
#define OOLogERR(class, format,...)
#define OOLog(class, format,...)
void OOGLPushModelView(void)
void OOGLTranslateModelView(Vector vector)
OOMatrix OOGLPopModelView(void)
void OOGLWireframeModeOn(void)
void OOGLWireframeModeOff(void)
#define OOVerifyOpenGLState()
BOOL OOCheckOpenGLErrors(NSString *format,...)
#define OOSetOpenGLState(STATE)
OOPixMap OOMakePixMap(void *pixels, OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format, size_t rowBytes, size_t bufferSize)
Vector vector_forward_from_quaternion(Quaternion quat) CONST_FUNC
void quaternion_rotate_about_axis(Quaternion *quat, Vector axis, OOScalar angle) NONNULL_FUNC
Vector vector_up_from_quaternion(Quaternion quat) CONST_FUNC
void quaternion_set_random(Quaternion *quat) NONNULL_FUNC
#define PLANET_MINIATURE_FACTOR
@ STELLAR_TYPE_ATMOSPHERE
@ STELLAR_TYPE_NORMAL_PLANET
Random_Seed RandomSeedFromString(NSString *abcdefString)
BOOL ScanVectorFromString(NSString *xyzString, Vector *outVector)
OOINLINE Vector vector_add(Vector a, Vector b) INLINE_CONST_FUNC
OOINLINE Vector make_vector(OOScalar vx, OOScalar vy, OOScalar vz) INLINE_CONST_FUNC
OOINLINE OOScalar dot_product(Vector first, Vector second) INLINE_CONST_FUNC
const Vector kBasisYVector
OOINLINE Vector vector_normal(Vector vec) INLINE_CONST_FUNC
static GLuint vertex_index_array[3 *(20+80+320+1280+5120+20480)]
#define POLAR_CLEAR_SKY_ALPHA
static const Vector kUntexturedVertices[]
static unsigned baseVertexIndexForEdge(GLushort va, GLushort vb, BOOL textured)
static Vector base_vertex_array[MAX_PLANET_VERTICES]
#define POLAR_CLOUD_ALPHA
static const Vector kTexturedVertices[]
static int base_terrain_array[MAX_PLANET_VERTICES]
static NSMapTable * sEdgeToVertex
static int triangle_start[MAX_SUBDIVIDE]
static GLfloat texture_uv_array[MAX_PLANET_VERTICES *2]
static int n_triangles[MAX_SUBDIVIDE]
static unsigned next_free_vertex
static const BaseFace kUntexturedFaces[][3]
static const BaseFace kTexturedFaces[][3]
void fillRanNoiseBuffer()
void initialiseBaseVertexArray()
void deleteDisplayLists()
double sqrtZeroDistance()
OOUniversalID universalID
void setOrientation:(Quaternion quat)
void update:(OOTimeDelta delta_t)
GLfloat collisionRadius()
void setOwner:(Entity *ent)
void orientationChanged()
void setScanClass:(OOScanClass sClass)
Vector cameraRelativePosition
GLfloat cam_zero_distance
void setStatus:(OOEntityStatus stat)
void setPosition:(HPVector posn)
OOColor * colorWithRed:green:blue:alpha:(float red,[green] float green,[blue] float blue,[alpha] float alpha)
OOColor * colorWithDescription:(id description)
void getRed:green:blue:alpha:(float *red,[green] float *green,[blue] float *blue,[alpha] float *alpha)
OOColor * colorWithHue:saturation:brightness:alpha:(float hue,[saturation] float saturation,[brightness] float brightness,[alpha] float alpha)
void registerClient:(id< OOGraphicsResetClient > client)
void unregisterClient:(id< OOGraphicsResetClient > client)
OOGraphicsResetManager * sharedManager()
id textureWithGenerator:(OOTextureGenerator *generator)
id textureWithConfiguration:extraOptions:(id configuration,[extraOptions] OOTextureFlags extraOptions)
void ensureFinishedLoading()
void drawImmediate:translucent:(bool immediate, [translucent] bool translucent)
double rotational_velocity
void setPosition:(HPVector posn)
void setTextureColorForPlanet:inSystem:(BOOL isMain, [inSystem] BOOL isLocal)
NSString * textureFileName()
void initialiseBaseTerrainArray:(int percent_land)
double shuttle_launch_interval
double sqrt_zero_distance
PlanetEntity * root_planet
void update:(OOTimeDelta delta_t)
void setUseTexturedModel:(BOOL flag)
void loadTexture:(NSDictionary *configuration)
uint8_t lastSubdivideLevel
void drawModelWithVertexArraysAndSubdivision:(int subdivide)
void setOrientation:(Quaternion inOrientation)
GLfloat amb_polar_land[4]
NSString * _textureFileName
double polar_color_factor
void setRotationalVelocity:(double v)
BOOL isExplicitlyTextured()
void drawUnconditionally()
void resetGraphicsState()
void initialiseBaseVertexArray()
PlanetEntity * atmosphere
OOTexture * cloudTextureWithCloudColor:cloudImpress:cloudBias:(OOColor *cloudColor, [cloudImpress] GLfloat cloud_impress, [cloudBias] GLfloat cloud_bias)
void deleteDisplayLists()
NSString * descriptionComponents()
GLuint displayListNames[MAX_SUBDIVIDE]
OOStellarBodyType planet_type
OOTexture * planetTextureWithInfo:(NSDictionary *info)
static unsigned baseVertexIndexForEdge(GLushort va, GLushort vb, BOOL textured)
double rotationalVelocity()
OOStellarBodyType planetType()
void setCargoFlag:(OOCargoFlag flag)
void setSingleCrewWithRole:(NSString *crewRole)
void switchAITo:(NSString *aiString)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
RANROTSeed RANROTGetFullSeed(void)
void ranrot_srand(uint32_t seed)
void setRandomSeed(RNG_Seed a_seed)
RNG_Seed currentRandomSeed(void)
void RANROTSetFullSeed(RANROTSeed seed)
void seed_for_planet_description(Random_Seed s_seed)
OOINLINE int is_nil_seed(Random_Seed a_seed) INLINE_CONST_FUNC