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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
predicate fix
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