Class representing a celestial body. More...
Public Member Functions | |
| CelestialBody (CelestialObject type) | |
| Create a new instance of a celestial body. | |
| string | GetBodyInfo () |
| string | GetTextureInfo () |
| Get the information about the texture. | |
| double | GetAtmosphericDensity () |
| Get the nominal known atmospheric density. | |
| string | GetTextureName (int variation) |
| Returns a texture name of the celestial body. | |
Properties | |
| CelestialObject | CelestialObject [get, set] |
| Gets or sets the celestial object enum for this body. | |
Class representing a celestial body.
Definition at line 36 of file CelestialBody.cs.
| NewGamePhysics.Physics.CelestialBody.CelestialBody | ( | CelestialObject | type | ) |
Create a new instance of a celestial body.
| type |
Definition at line 47 of file CelestialBody.cs.
| double NewGamePhysics.Physics.CelestialBody.GetAtmosphericDensity | ( | ) |
Get the nominal known atmospheric density.
Definition at line 293 of file CelestialBody.cs.
00294 { 00295 switch (this.celestialObject) 00296 { 00297 00298 case CelestialObject.Sun: 00299 // Average coronal density 00300 // Source: http://en.wikipedia.org/wiki/Sun 00301 return 1.0E-12; 00302 00303 case CelestialObject.Mercury: 00304 // Essentially a vaccuum 00305 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/mercuryfact.html 00306 return 1.0E-18; 00307 00308 case CelestialObject.Venus: 00309 // Density at source 6.5% that of water 00310 // Source: http://en.wikipedia.org/wiki/Venus#Atmosphere_and_climate 00311 return 65.0; 00312 00313 case CelestialObject.Earth: 00314 return AirDensity.NominalAirDensity; 00315 00316 case CelestialObject.Moon: 00317 // Essentially a vaccuum 00318 // Source: http://en.wikipedia.org/wiki/Moon#Atmosphere 00319 return 1.0E-18; 00320 00321 case CelestialObject.Mars: 00322 // Nominal density 00323 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html 00324 return 0.02; 00325 00326 case CelestialObject.Jupiter: 00327 // Density at 1 bar 00328 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html 00329 return 0.16; 00330 00331 case CelestialObject.Io: 00332 // About 10 million times less than Earth 00333 // Source: http://vega.lpl.arizona.edu/iotorus/io.html 00334 return AirDensity.NominalAirDensity / 10000000; 00335 00336 case CelestialObject.Europa: 00337 // Assume a vaccuum 00338 return 1.0E-18; 00339 00340 case CelestialObject.Ganymede: 00341 // Assume a vaccuum 00342 return 1.0E-18; 00343 00344 case CelestialObject.Callisto: 00345 // Assume a vaccuum 00346 return 1.0E-18; 00347 00348 case CelestialObject.Saturn: 00349 // Density at 1 bar 00350 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/saturnfact.html 00351 return 0.19; 00352 00353 case CelestialObject.Uranus: 00354 // Density at 1 bar 00355 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/uranusfact.html 00356 return 0.42; 00357 00358 case CelestialObject.Neptune: 00359 // Density at 1 bar 00360 // Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/neptunefact.html 00361 return 0.45; 00362 00363 case CelestialObject.Pluto: 00364 // Assume a vaccuum 00365 return 1.0E-18; 00366 00367 default: 00368 // Default to vacuum 00369 return 1.0E-18; 00370 } 00371 }
| string NewGamePhysics.Physics.CelestialBody.GetTextureInfo | ( | ) |
Get the information about the texture.
Definition at line 196 of file CelestialBody.cs.
00197 { 00198 StringBuilder sb = new StringBuilder(); 00199 00200 switch (this.celestialObject) 00201 { 00202 case CelestialObject.Sun: 00203 sb.AppendLine("Artistic map based on images from SOHO."); 00204 sb.AppendLine("(c) Calvin J. Hamilton, 2001. (educational use)"); 00205 sb.AppendLine("Source: http://solarviews.com"); 00206 break; 00207 case CelestialObject.Mercury: 00208 sb.AppendLine("Map created from several sources including the Messenger spacecraft."); 00209 sb.AppendLine("Contains fictional or cloned data."); 00210 sb.AppendLine("Source: http://www.solarviews.com/eng/homepage.htm and http://home.arcor.de/jimpage"); 00211 break; 00212 case CelestialObject.Venus: 00213 sb.AppendLine("Map created from 21 images taken by the Galileo spacecraft during its 1990 flyby."); 00214 sb.AppendLine("The coloring is artificially enhanced to show features of the cloud cover."); 00215 sb.AppendLine("Created by Bjorn Jonsson"); 00216 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00217 break; 00218 case CelestialObject.Earth: 00219 sb.AppendLine("Map created from one years worth of monthly composites of images taken by the MODIS spacecraft in 2004."); 00220 sb.AppendLine("The map set is also known as Blue Marble: Next Generation."); 00221 sb.AppendLine("Cloud cover was removed via extensive automatic image processing."); 00222 sb.AppendLine("Credits: NASA's Earth Observatory"); 00223 sb.AppendLine("Source: http://earthobservatory.nasa.gov/Features/BlueMarble"); 00224 break; 00225 case CelestialObject.Moon: 00226 sb.AppendLine("Map created from USGS/Hubble and ESA Info Centre images."); 00227 sb.AppendLine("Source: http://www.oera.net/How2/TextureMaps2.htm"); 00228 break; 00229 case CelestialObject.Mars: 00230 sb.AppendLine("Map created from images taken by the Viking spacecraft and processes by the USGS."); 00231 sb.AppendLine("Details added by incorporating topology data from the Mars Global Surveyor."); 00232 sb.AppendLine("Manually corrected and color enhanced."); 00233 sb.AppendLine("Source: http://planetpixelemporium.com/mars.html"); 00234 break; 00235 case CelestialObject.Jupiter: 00236 sb.AppendLine("Map created from 100 images taken by the Cassini spacecraft during its Dec 2000 flyby."); 00237 sb.AppendLine("Longitudinal position on left edge is arbitrary, as object has no fixed visible features."); 00238 sb.AppendLine("Created by Bjorn Jonsson."); 00239 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00240 break; 00241 case CelestialObject.Io: 00242 sb.AppendLine("Map created from 1 high resolution greyscale image taken by the Voyager 1 spacecraft."); 00243 sb.AppendLine("Color information comes from 3 low resolution images taken by the Voyager 2 spacecraft"); 00244 sb.AppendLine("Contains fictional or cloned data."); 00245 sb.AppendLine("Created by Bjorn Jonsson."); 00246 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00247 break; 00248 case CelestialObject.Europa: 00249 sb.AppendLine("Map created from 14 images taken by the Galileo spacecraft."); 00250 sb.AppendLine("Color information comes from several images taken by the Voyager 1 and 2 spacecraft"); 00251 sb.AppendLine("Created by Bjorn Jonsson."); 00252 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00253 break; 00254 case CelestialObject.Ganymede: 00255 sb.AppendLine("Map created from over 100 images taken by the Voyager and Galileo spacecraft."); 00256 sb.AppendLine("Contains fictional or cloned data."); 00257 sb.AppendLine("Created by Bjorn Jonsson."); 00258 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00259 break; 00260 case CelestialObject.Callisto: 00261 sb.AppendLine("Map created from several images taken by the Voyager and Galileo spacecraft."); 00262 sb.AppendLine("Contains fictional or cloned data."); 00263 sb.AppendLine("Created by Bjorn Jonsson."); 00264 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00265 break; 00266 case CelestialObject.Saturn: 00267 sb.AppendLine("Map created from 56 images taken by the Cassini spacecraft in Sept 2004."); 00268 sb.AppendLine("Created by Bjorn Jonsson"); 00269 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00270 break; 00271 case CelestialObject.Neptune: 00272 sb.AppendLine("Map created from 27 images taken by the Voyager 2 spacecraft in Aug 1989."); 00273 sb.AppendLine("Contains fictional or cloned data."); 00274 sb.AppendLine("Created by Bjorn Jonsson"); 00275 sb.AppendLine("Source: http://www.mmedia.is/~bjj/planetary_maps.html"); 00276 break; 00277 case CelestialObject.Uranus: 00278 sb.AppendLine("Painted map based on various image sources including the Hubble space telescope."); 00279 sb.AppendLine("Source: http://planetpixelemporium.com/uranus.html"); 00280 break; 00281 case CelestialObject.Pluto: 00282 sb.AppendLine("Fictional rendering of object."); 00283 break; 00284 } 00285 00286 return sb.ToString(); 00287 }
| string NewGamePhysics.Physics.CelestialBody.GetTextureName | ( | int | variation | ) |
Returns a texture name of the celestial body.
| variation | The variation of the texture. This input variable is only used if there are any variations available. If none are available the default texture (i.e. variation 0) is used. Variations are available for: Earth, Venus. |
Definition at line 383 of file CelestialBody.cs.
00384 { 00385 string textureName = String.Empty; 00386 00387 // Filenames of the earth textures by month. 00388 string[] earthTexturesByMonth = { 00389 "earth_jan", 00390 "earth_feb", 00391 "earth_mar", 00392 "earth_apr", 00393 "earth_may", 00394 "earth_jun", 00395 "earth_jul", 00396 "earth_aug", 00397 "earth_sep", 00398 "earth_oct", 00399 "earth_nov", 00400 "earth_dec"}; 00401 00402 switch (this.celestialObject) 00403 { 00404 case CelestialObject.Sun: 00405 textureName = "sun"; 00406 break; 00407 case CelestialObject.Mercury: 00408 textureName = "mercury"; 00409 break; 00410 case CelestialObject.Venus: 00411 if (variation == 1) 00412 { 00413 textureName = "venus_surface"; 00414 break; 00415 } 00416 textureName = "venus_cloud"; 00417 break; 00418 case CelestialObject.Earth: 00419 if (variation == 1) 00420 { 00421 textureName = "earth_map"; 00422 break; 00423 } 00424 textureName = earthTexturesByMonth[DateTime.Now.Month - 1]; 00425 break; 00426 case CelestialObject.Moon: 00427 textureName = "moon"; 00428 break; 00429 case CelestialObject.Mars: 00430 textureName = "mars"; 00431 break; 00432 case CelestialObject.Jupiter: 00433 textureName = "jupiter"; 00434 break; 00435 case CelestialObject.Io: 00436 textureName = "io"; 00437 break; 00438 case CelestialObject.Europa: 00439 textureName = "europa"; 00440 break; 00441 case CelestialObject.Ganymede: 00442 textureName = "ganymede"; 00443 break; 00444 case CelestialObject.Callisto: 00445 textureName = "callisto"; 00446 break; 00447 case CelestialObject.Saturn: 00448 textureName = "saturn"; 00449 break; 00450 case CelestialObject.Neptune: 00451 textureName = "neptune"; 00452 break; 00453 case CelestialObject.Uranus: 00454 textureName = "uranus"; 00455 break; 00456 default: 00457 textureName = "planet"; 00458 break; 00459 } 00460 00461 return "Textures/" + textureName; 00462 }
CelestialObject NewGamePhysics.Physics.CelestialBody.CelestialObject [get, set] |
Gets or sets the celestial object enum for this body.
Definition at line 56 of file CelestialBody.cs.
1.6.2