After littering all over other threads, I figured it was time to make a fresh one.
So here is where I will be putting up archives of my tweaks, functions, toys.
I will also be posting code so those who are simply curious, or wish to compile their own, can explore or experiment to their heart's content.
When I have a newer, better, or more complete version of something, I will be pulling the previous archives.
This is to conserve disc space on the hosting service.
I will also be making a forking directory in my downloads.
Full ready to compile snapshots will be uploaded to my downloads on occasion.
I start with Commit 5441, modded with RaDecDist.
RaDecDist displays the realtime, based on the simulation clock, position of any selected object except earth.
RaDecDist consists of two parts.
The first is in /src/celengine/univcoord.h:142 just after distancefromkm.
Code: Select all
// 190404 Janus : get Distance in micro light years.
double distanceFromUly(const UniversalCoord& uc)
{
return offsetFromUly(uc).norm();
}
This adds a function to get absolute distance something is from earth in micro light years{Uly}, to the univcoord object{Class}
The second replaces some messy code in /src/celestia/celestiacore.cpp:3694 in celestiacore::renderoverlay, before the text handler.
If you reach the line that reads "// Text input", you have gone to far.
The code I replaced filters based on the observer being beside earth, mine does not.
Code: Select all
// 190331 Janus : Display Ra Dec & now Dist at the bottom of everything not earth.
// To be added is a filter for view details.
Selection Sol_Object = u->find("Sol");
Selection EarthObject = u->find("Earth", &Sol_Object, 1);
Body* earth = EarthObject.body();
if (sel.body() != EarthObject.body())
{
UniversalCoord SelPos = sel.getPosition(sim->getTime());
Vector3d v = sel.getPosition(sim->getTime()).offsetFromUly(Selection(earth).getPosition(sim->getTime()));
v = XRotation(astro::J2000Obliquity) * v;
displayRADec(*overlay, v);
double dist = SelPos.offsetFromUly(EarthObject.getPosition(sim->getTime())).norm();
*overlay << "Dist:: " << DistanceLyToStr(dist / 1000000) << "\n";
}
This displays the simulation clock based position RaDecDist coordinates of any selected object.
Some may wonder why I added a Uly based function when there is already a KM based one.
I did so because I like to use natural units when I work.
Only translating them to something more familiar when displayed.
Light seconds, AU, Uly, LY, Light minutes, make far more sense to me when looking around in space.
I will be posting other tweaks, mods, toys as I get time.
Always like this one, so people can try them out to what they like.
Combination will also be posted, mostly on request.
Janus.
EDIT: Superseded by post#6 with updated archive.