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

CloserStarPredicate Struct Reference

Collaboration diagram for CloserStarPredicate:

Collaboration graph
List of all members.

Public Member Functions

bool operator() (const Star *star0, const Star *star1) const
bool operator() (const Star *star0, const Star *star1) const

Public Attributes

Point3f pos

Member Function Documentation

bool CloserStarPredicate::operator() const Star star0,
const Star star1
const [inline]
 

Definition at line 92 of file winstarbrowser.cpp.

References pos.

00093     {
00094         return ((pos - star0->getPosition()).lengthSquared() <
00095                 (pos - star1->getPosition()).lengthSquared());
00096                                
00097     }

bool CloserStarPredicate::operator() const Star star0,
const Star star1
const [inline]
 

Definition at line 26 of file starbrowser.cpp.

References pos, Point3< T >::x, Point3< T >::y, and Point3< T >::z.

00027     {
00028         Point3f p0 = star0->getPosition();
00029         Point3f p1 = star1->getPosition();
00030         Vec3f v0(p0.x * 1e6 - pos.x, p0.y * 1e6 - pos.y, p0.z * 1e6 - pos.z);
00031         Vec3f v1(p1.x * 1e6 - pos.x, p1.y * 1e6 - pos.y, p1.z * 1e6 - pos.z);
00032         
00033         return (v0.lengthSquared() < v1.lengthSquared());                               
00034     }


Member Data Documentation

Point3f CloserStarPredicate::pos
 

Definition at line 91 of file winstarbrowser.cpp.

Referenced by InitStarBrowserItems(), StarBrowser::listStars(), StarBrowser::nearestStar(), and operator()().


The documentation for this struct was generated from the following files:
Generated on Sat Jan 14 22:33:10 2006 for Celestia by  doxygen 1.4.1