©2004,2009 Jim E. Brooks http://www.palomino3d.org
[2010/04]
The representation of the simulated world is factored into:
The World and Planet classes together define the simulated world but do not contain 3D objects (SceneGraph does). Planet is a private implementation of the World class.
The interface of World was designed for either a flat or spherical world, and this fact should be kept internal to the World class if possible.
The world::conv conversion functions convert between physical metrics, spherical coordinates, and graphical coordinates.
[2008/04]
Latitude defines a semi-circle {0',...,180'}. lat=0' defines the north pole.
Longitude defines a full-circle {0',...,360'}. lon=0' defines Greenwich,UK.
Most methods have assertions to enforce correct range of both latitude and longitude. If out-of-range isn't really an error, modulate args using math::ModuloAbs(180.0f,lat) or (360.0f,lon).
[2008/05]
The graphics rendering code is based on world coordinates (object space). World coordinates are purely a graphical concept.
The simulator is designed to start with spherical coordinates. Spherical coordinates are (latitude,longitude,altitude) (degree,degree,meter).
Physical coordinates are (meter,meter,meter). Data files associated with 3D models define width,length,height in meters.
[2008/05]
At startup, the simulation maps the Earth's actual measurements to 3D graphical coordinates (world coordinates). Once defined, world coordinates and their correlation to spherical coordinates remain constant. The simulator may seem to re-orient world space as the viewpoint moves over the spherical world, but this is just an illusion. Rather, the view matrix is recomputed every frame to be on a tangent (SuperView::ComputeViewMatrix) which instead changes the mapping world space and eye space.
[2009/03]
The C++ World class creates the primordial simulated world (which is later fully populated by Lua scripts) and provides info about the world.
Palomino-specific: World encapsulates and hides either a FlatPlanet or SpherePlanet.
Historical note: In previous versions, World was a pager: it created and destroyed Objects as the locus moved. World served as a fence: it could restrict moving the viewpoint outside the world. World was complicated with scene-graph functionality and being an Object container, but that was later factored-out to the SceneGraph class. The World class survives, in part, because some of this functionality may need to be reimplemented.
[2008/02]
Planet is an abstract class whose derivatives are FlatPlanet and SpherePlanet. Planet is a private implementation of World (World is a Facade over Planet).
FlatPlanet defines a single satellite image produced by osgdem (GoldenGate.osga). Despite being flat, thru Geo, it can be accessed in terms of spherical coordinates.
SpherePlanet is a Facade over an OSSIM planet which can automatically download satellite imagery and render the entire Earth as an ellipsoid.
[2008/02]
This is a matrix that is tangential to a point on the ellipsoid. Its Z axis is the "up vector". The view matrix is transformed thru the tangent matrix so that the horizon is level (the orientation a human pilot would expect). The tangent matrix is recomputed as the player moves around the globe.
[2010/04]
The world module provides functions to convert between physical and graphical coordinates.
These functions are in the world::conv
namespace.
Last modified: Wed Apr 14 12:02:47 CDT 2010