Oolite
Loading...
Searching...
No Matches
PlanetEntity.m File Reference
Include dependency graph for PlanetEntity.m:

Go to the source code of this file.

Classes

category  PlanetEntity(OOPrivate)
struct  BaseFace

Macros

#define CLEAR_SKY_ALPHA   0.05
#define CLOUD_ALPHA   0.50
#define POLAR_CLEAR_SKY_ALPHA   0.34
#define POLAR_CLOUD_ALPHA   0.75

Functions

static unsigned baseVertexIndexForEdge (GLushort va, GLushort vb, BOOL textured)

Variables

static Vector base_vertex_array [MAX_PLANET_VERTICES]
static int base_terrain_array [MAX_PLANET_VERTICES]
static unsigned next_free_vertex
static NSMapTable * sEdgeToVertex
static int n_triangles [MAX_SUBDIVIDE]
static int triangle_start [MAX_SUBDIVIDE]
static GLuint vertex_index_array [3 *(20+80+320+1280+5120+20480)]
static GLfloat texture_uv_array [MAX_PLANET_VERTICES *2]
static const Vector kUntexturedVertices []
static const BaseFace kUntexturedFaces [][3]
static const Vector kTexturedVertices []
static const BaseFace kTexturedFaces [][3]

Macro Definition Documentation

◆ CLEAR_SKY_ALPHA

#define CLEAR_SKY_ALPHA   0.05

◆ CLOUD_ALPHA

◆ POLAR_CLEAR_SKY_ALPHA

#define POLAR_CLEAR_SKY_ALPHA   0.34

◆ POLAR_CLOUD_ALPHA

#define POLAR_CLOUD_ALPHA   0.75

Function Documentation

◆ baseVertexIndexForEdge()

unsigned baseVertexIndexForEdge ( GLushort va,
GLushort vb,
BOOL textured )
static

Referenced by PlanetEntity(OOPrivate)::initialiseBaseTerrainArray:, and PlanetEntity(OOPrivate)::initialiseBaseVertexArray.

Here is the caller graph for this function:

Variable Documentation

◆ base_terrain_array

◆ base_vertex_array

◆ kTexturedFaces

const BaseFace kTexturedFaces[][3]
static
Initial value:
= {
{ { 1, +0.400000, +0.666667 }, { 0, +0.600000, +0.666667 }, { 6, +0.500000, +0.333333 } },
{ { 3, +0.100000, +0.333333 }, { 2, -0.100000, +0.333333 }, { 5, +0.000000, +0.666667 } },
{ { 4, +0.500000, +1.000000 }, { 0, +0.600000, +0.666667 }, { 1, +0.400000, +0.666667 } },
{ { 4, +0.500000, +1.000000 }, { 1, +0.400000, +0.666667 }, { 8, +0.200000, +0.666667 } },
{ { 12, +1.000000, +0.666667 }, { 13, +0.900000, +0.333333 }, { 9, +0.800000, +0.666667 } },
{ { 5, +0.000000, +0.666667 }, { 4, +0.500000, +1.000000 }, { 8, +0.200000, +0.666667 } },
{ { 6, +0.500000, +0.333333 }, { 0, +0.600000, +0.666667 }, { 11, +0.700000, +0.333333 } },
{ { 7, +0.500000, +0.000000 }, { 2, -0.100000, +0.333333 }, { 3, +0.100000, +0.333333 } },
{ { 7, +0.500000, +0.000000 }, { 3, +0.100000, +0.333333 }, { 10, +0.300000, +0.333333 } },
{ { 7, +0.500000, +0.000000 }, { 6, +0.500000, +0.333333 }, { 11, +0.700000, +0.333333 } },
{ { 8, +0.200000, +0.666667 }, { 1, +0.400000, +0.666667 }, { 10, +0.300000, +0.333333 } },
{ { 8, +0.200000, +0.666667 }, { 3, +0.100000, +0.333333 }, { 5, +0.000000, +0.666667 } },
{ { 9, +0.800000, +0.666667 }, { 0, +0.600000, +0.666667 }, { 4, +0.500000, +1.000000 } },
{ { 9, +0.800000, +0.666667 }, { 13, +0.900000, +0.333333 }, { 11, +0.700000, +0.333333 } },
{ { 9, +0.800000, +0.666667 }, { 4, +0.500000, +1.000000 }, { 12, +1.000000, +0.666667 } },
{ { 10, +0.300000, +0.333333 }, { 1, +0.400000, +0.666667 }, { 6, +0.500000, +0.333333 } },
{ { 10, +0.300000, +0.333333 }, { 3, +0.100000, +0.333333 }, { 8, +0.200000, +0.666667 } },
{ { 10, +0.300000, +0.333333 }, { 6, +0.500000, +0.333333 }, { 7, +0.500000, +0.000000 } },
{ { 11, +0.700000, +0.333333 }, { 0, +0.600000, +0.666667 }, { 9, +0.800000, +0.666667 } },
{ { 11, +0.700000, +0.333333 }, { 13, +0.900000, +0.333333 }, { 7, +0.500000, +0.000000 } }
}

Definition at line 155 of file PlanetEntity.m.

155 {
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 } }
176};

Referenced by PlanetEntity(OOPrivate)::initialiseBaseVertexArray.

◆ kTexturedVertices

const Vector kTexturedVertices[]
static
Initial value:
= {
{ +0.525731, +0.000000, +0.850651 },
{ -0.525731, +0.000000, +0.850651 },
{ +0.525731, +0.000000, -0.850651 },
{ -0.525731, +0.000000, -0.850651 },
{ +0.000000, +0.850651, +0.525731 },
{ +0.000000, +0.850651, -0.525731 },
{ +0.000000, -0.850651, +0.525731 },
{ +0.000000, -0.850651, -0.525731 },
{ -0.850651, +0.525731, +0.000000 },
{ +0.850651, +0.525731, +0.000000 },
{ -0.850651, -0.525731, +0.000000 },
{ +0.850651, -0.525731, +0.000000 },
{ +0.000000, +0.850651, -0.525731 },
{ +0.525731, +0.000000, -0.850651 }
}

Definition at line 138 of file PlanetEntity.m.

138 {
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 }
153};

Referenced by PlanetEntity(OOPrivate)::initialiseBaseVertexArray, and PlanetEntity(OOPrivate)::setUseTexturedModel:.

◆ kUntexturedFaces

const BaseFace kUntexturedFaces[][3]
static
Initial value:
= {
{ { 9, +0.600000, +0.666667 }, { 7, +0.800000, +0.666667 }, { 8, +0.800000, +0.333333 } },
{ { 8, +0.800000, +0.333333 }, { 4, +0.600000, +0.333333 }, { 9, +0.600000, +0.666667 } },
{ { 3, +0.400000, +0.666667 }, { 9, +0.600000, +0.666667 }, { 4, +0.600000, +0.333333 } },
{ { 8, +0.800000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 4, +0.600000, +0.333333 } },
{ { 7, +0.800000, +0.666667 }, { 1, +1.000000, +0.333333 }, { 8, +0.800000, +0.333333 } },
{ { 2, +0.500000, +1.000000 }, { 7, +0.800000, +0.666667 }, { 9, +0.600000, +0.666667 } },
{ { 2, +0.500000, +1.000000 }, { 9, +0.600000, +0.666667 }, { 3, +0.400000, +0.666667 } },
{ { 1, +1.000000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 8, +0.800000, +0.333333 } },
{ { 4, +0.600000, +0.333333 }, { 0, +0.500000, +0.000000 }, { 5, +0.400000, +0.333333 } },
{ { 5, +0.400000, +0.333333 }, { 3, +0.400000, +0.666667 }, { 4, +0.600000, +0.333333 } },
{ { 6, +1.000000, +0.666667 }, { 1, +1.000000, +0.333333 }, { 7, +0.800000, +0.666667 } },
{ { 7, +0.800000, +0.666667 }, { 2, +0.500000, +1.000000 }, { 6, +1.000000, +0.666667 } },
{ { 1, +0.000000, +0.333333 }, { 11, +0.200000, +0.333333 }, { 0, +0.500000, +0.000000 } },
{ { 3, +0.400000, +0.666667 }, { 10, +0.200000, +0.666667 }, { 2, +0.500000, +1.000000 } },
{ { 0, +0.500000, +0.000000 }, { 11, +0.200000, +0.333333 }, { 5, +0.400000, +0.333333 } },
{ { 5, +0.400000, +0.333333 }, { 10, +0.200000, +0.666667 }, { 3, +0.400000, +0.666667 } },
{ { 1, +0.000000, +0.333333 }, { 6, +0.000000, +0.666667 }, { 11, +0.200000, +0.333333 } },
{ { 6, +0.000000, +0.666667 }, { 2, +0.500000, +1.000000 }, { 10, +0.200000, +0.666667 } },
{ { 5, +0.400000, +0.333333 }, { 11, +0.200000, +0.333333 }, { 10, +0.200000, +0.666667 } },
{ { 11, +0.200000, +0.333333 }, { 6, +0.000000, +0.666667 }, { 10, +0.200000, +0.666667 } }
}

Definition at line 115 of file PlanetEntity.m.

115 {
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 } }
136};

Referenced by PlanetEntity(OOPrivate)::initialiseBaseVertexArray.

◆ kUntexturedVertices

const Vector kUntexturedVertices[]
static
Initial value:
= {
{ +0.000000, -0.850664, -0.525710 },
{ +0.000000, -0.850664, +0.525710 },
{ +0.000000, +0.850664, +0.525710 },
{ +0.000000, +0.850664, -0.525710 },
{ -0.525710, +0.000000, -0.850664 },
{ +0.525710, +0.000000, -0.850664 },
{ +0.525710, +0.000000, +0.850664 },
{ -0.525710, +0.000000, +0.850664 },
{ -0.850664, -0.525710, +0.000000 },
{ -0.850664, +0.525710, +0.000000 },
{ +0.850664, +0.525710, +0.000000 },
{ +0.850664, -0.525710, +0.000000 }
}

Definition at line 100 of file PlanetEntity.m.

100 {
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 }
113};

Referenced by PlanetEntity(OOPrivate)::initialiseBaseVertexArray, and PlanetEntity(OOPrivate)::setUseTexturedModel:.

◆ n_triangles

◆ next_free_vertex

◆ sEdgeToVertex

NSMapTable* sEdgeToVertex
static

◆ texture_uv_array

◆ triangle_start

◆ vertex_index_array

GLuint vertex_index_array[3 *(20+80+320+1280+5120+20480)]
static