A TerrainViewController for spherical terrains (i.e., planets). More...
#include <PlanetViewController.h>
Public Member Functions | |
PlanetViewController (ptr< SceneNode > node, double R) | |
Creates a new PlanetViewController. | |
virtual | ~PlanetViewController () |
Deletes this PlanetViewController. | |
virtual double | getHeight () |
Returns the height of the camera above the z=0 surface. | |
virtual void | move (vec3d &oldp, vec3d &p) |
Moves the "look at" point so that "oldp" appears at the position of "p" on screen. | |
virtual double | interpolate (double sx0, double sy0, double stheta, double sphi, double sd, double dx0, double dy0, double dtheta, double dphi, double dd, double t) |
Sets the position as the interpolation of the two given positions with the interpolation parameter t (between 0 and 1). | |
virtual void | update () |
Sets the localToParent transform of the SceneNode associated with this TerrainViewController. | |
Public Attributes | |
const double | R |
The radius of the planet at sea level. |
A TerrainViewController for spherical terrains (i.e., planets).
This subclass interprets the x0 and y0 fields as longitudes and latitudes on the planet, and considers theta and phi as relative to the tangent plane at the (x0,y0) point.
proland::PlanetViewController::PlanetViewController | ( | ptr< SceneNode > | node, | |
double | R | |||
) |
Creates a new PlanetViewController.
node | a SceneNode representing a camera position and orientation in the scene. | |
R | the planet radius at sea level. |
virtual proland::PlanetViewController::~PlanetViewController | ( | ) | [virtual] |
Deletes this PlanetViewController.
virtual double proland::PlanetViewController::getHeight | ( | ) | [virtual] |
Returns the height of the camera above the z=0 surface.
Reimplemented from proland::TerrainViewController.
virtual double proland::PlanetViewController::interpolate | ( | double | sx0, | |
double | sy0, | |||
double | stheta, | |||
double | sphi, | |||
double | sd, | |||
double | dx0, | |||
double | dy0, | |||
double | dtheta, | |||
double | dphi, | |||
double | dd, | |||
double | t | |||
) | [virtual] |
Sets the position as the interpolation of the two given positions with the interpolation parameter t (between 0 and 1).
The source position is sx0,sy0,stheta,sphi,sd, the destination is dx0,dy0,dtheta,dphi,dd.
Reimplemented from proland::TerrainViewController.
virtual void proland::PlanetViewController::move | ( | vec3d & | oldp, | |
vec3d & | p | |||
) | [virtual] |
Moves the "look at" point so that "oldp" appears at the position of "p" on screen.
oldp | a terrain point. | |
p | another terrain point. |
Reimplemented from proland::TerrainViewController.
virtual void proland::PlanetViewController::update | ( | ) | [virtual] |
Sets the localToParent transform of the SceneNode associated with this TerrainViewController.
The transform is computed from the view parameters x0,y0,theta,phi and d.
Reimplemented from proland::TerrainViewController.
const double proland::PlanetViewController::R |
The radius of the planet at sea level.