Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#244 sort broken in star browser

v1.7.0
open
nobody
Other (10)
5
2009-09-29
2009-09-29
Osprey
No

When use star browser window in gnome backend and set sorting by neares or with planets then stars are not sorted by distance.
In old Celestia 1.6 work, possible it comes with eigen.

Discussion

  • Osprey
    Osprey
    2009-10-01

    predicate fix

     
    Attachments
  • Osprey
    Osprey
    2009-10-01

    Problem was in after some patch where viewer pos was in light years:
    @@ -217,7 +223,7 @@ bool StarBrowser::setPredicate(int pred)
    void StarBrowser::refresh()
    {
    ucPos = appSim->getObserver().getPosition();
    - pos = (Point3f) ucPos;
    + pos = ucPos.toLy().cast<float>();
    }
    But star pos was still multiplied by 1.0e6f
    So to fix need just remove multiplier in predicate:
    - Vector3f v0 = p0 * 1.0e6f - pos;
    - Vector3f v1 = p1 * 1.0e6f - pos;
    + Vector3f v0 = p0 - pos;
    + Vector3f v1 = p1 - pos;
    It also give a little speedup.

    Patch in attach, but still _need_ review code for BrighterStarPredicate