Concrete class providing a flat geometry (a sphere with nominal radius 1, equator in the XY-plane, Z axis through the poles). More...
#include <geometry.h>
Public Member Functions | |
GeometrySpherical (uint seed) | |
Constructor. | |
~GeometrySpherical () | |
Destructor. | |
float | height (const XYZ &p) const |
Height is relative to the surface of the unit radius sphere. | |
void | set_height (XYZ &p, float h) const |
The height set is relative to the surface of the unit radius sphere. | |
const XYZ | midpoint (const XYZ &v0, const XYZ &v1) const |
Don't just take the mid-point of the straight-line path through the sphere's surface: must work relative to the sphere's surface. | |
float | normalised_latitude (const XYZ &p) const |
Normalised latitude is 1.0 at the north pole, -1.0 at the south pole. | |
const XYZ | up (const XYZ &p) const |
Up is normal to the sphere. | |
const XYZ | north (const XYZ &p) const |
North is perpendicular to "up" and "east". More... | |
const XYZ | east (const XYZ &p) const |
East is perpendicular to "up" and the polar vector. More... | |
const XYZ | perturb (const XYZ &p, const XYZ &variation) const |
Add a random variation to a point. More... | |
float | epsilon () const |
This needs to return something small for the lake flooding algorithm to work. | |
void | scan_convert (const boost::array< XYZ, 3 > &v, const ScanConvertBackend &) const |
uint | scan_convert_image_aspect_ratio () const |
Return 2.0 for spheres because vertical range is +/- pi/2, horizontal is +/- pi. | |
![]() | |
Geometry (uint seed) | |
Constructor. | |
virtual | ~Geometry () |
Destructor. | |
Additional Inherited Members | |
![]() | |
static void | scan_convert_common (const boost::array< XYZ, 3 > &v, const ScanConvertBackend &backend) |
Common scan-converter code. More... | |
![]() | |
Random01 | _r01 |
Random number generator used for perturbations and the like. More... | |
Concrete class providing a flat geometry (a sphere with nominal radius 1, equator in the XY-plane, Z axis through the poles).
East is perpendicular to "up" and the polar vector.
Implements Geometry.
North is perpendicular to "up" and "east".
Implements Geometry.
Add a random variation to a point.
In spherical geometry, the variation ellipsoid tracks the surface (ie z corresponds to up, north to y)
Implements Geometry.
|
virtual |
The problem with spherical geometry is that spans can go off one side of the map and come back on the other.
Implements ScanConverter.