Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

distance.h File Reference

#include "mathlib.h"
#include "ray.h"
#include "sphere.h"
#include "ellipsoid.h"

Include dependency graph for distance.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T>
distance (const Point3< T > &p, const Ray3< T > &r)
template<class T>
distance (const Point3< T > &p, const Ellipsoid< T > &e)
template<class T>
distance (const Point3< T > &p, const Sphere< T > &s)


Function Documentation

template<class T>
T distance const Point3< T > &  p,
const Ray3< T > &  r
 

Definition at line 31 of file distance.h.

00032 {
00033     T t = ((p - r.origin) * r.direction) / (r.direction * r.direction);
00034     if (t <= 0)
00035         return p.distanceTo(r.origin);
00036     else
00037         return p.distanceTo(r.point(t));
00038 }

template<class T>
T distance const Point3< T > &  p,
const Ellipsoid< T > &  e
 

Definition at line 26 of file distance.h.

00027 {
00028     return 0.0f;
00029 }

template<class T>
T distance const Point3< T > &  p,
const Sphere< T > &  s
 

Definition at line 21 of file distance.h.

References abs().

Referenced by ApproxPlanetPickTraversal(), CommandGoto::CommandGoto(), CommandGotoLongLat::CommandGotoLongLat(), Observer::computeGotoParameters(), Observer::computeGotoParametersGC(), computePlanetCoords(), PlutoOrbit::computePosition(), NeptuneOrbit::computePosition(), UranusOrbit::computePosition(), SaturnOrbit::computePosition(), JupiterOrbit::computePosition(), MarsOrbit::computePosition(), LunarOrbit::computePosition(), EarthOrbit::computePosition(), VenusOrbit::computePosition(), MercuryOrbit::computePosition(), ComputeRotationCoarseness(), StarDatabase::createStar(), Destination::Destination(), dialogGotoObject(), displayApparentDiameter(), displayApparentMagnitude(), displayDistance(), displayDSOinfo(), displayLocationInfo(), displayPlanetInfo(), displayStarInfo(), DumpOldStarDatabase(), EclipseFinderProc(), eclipseGoto(), astro::equatorialToCelestialCart(), ExactPlanetPickTraversal(), CelestiaCore::getLightTravelDelay(), Simulation::getSelectionLongLat(), Observer::getSelectionLongLat(), EclipseFinderDlg::gotoEclipse(), Observer::gotoJourney(), Observer::gotoLocation(), GotoObject(), GotoObjectProc(), Simulation::gotoSelection(), Observer::gotoSelection(), Observer::gotoSelectionGC(), Simulation::gotoSelectionLongLat(), Observer::gotoSelectionLongLat(), SelectionPopup::init(), Renderer::labelStars(), DeepSkyObject::load(), StarDatabase::loadOldFormatBinary(), LongLatDialog::LongLatDialog(), observer_gotodistance(), observer_gotolonglat(), operator<(), Observer::orbit(), CommandParser::parseCommand(), VertexList::pick(), Model::pick(), Mesh::pick(), Mesh3DS::pick(), CloseDSOPicker::process(), CloseStarPicker::process(), StarPicker::process(), NearStarFinder::process(), ClosestStarFinder::process(), StarRenderer::process(), Renderer::render(), Renderer::renderCometTail(), renderCompass(), Renderer::renderForegroundOrbits(), Renderer::renderObject(), Renderer::renderOrbits(), Renderer::renderPlanet(), Renderer::renderStar(), CelestiaCore::setLightTravelDelay(), setupObjectLighting(), LongLatDialog::slotApply(), EclipseFinder::testEclipse(), Renderer::testEclipse(), testIntersection(), and WriteStarDatabase().

00022 {
00023     return abs(s.center.distanceTo(p) - s.radius);
00024 }


Generated on Sat Jan 14 22:32:42 2006 for Celestia by  doxygen 1.4.1