1717#include " astro.h"
1818#include " hash.h"
1919
20+ namespace astro = celestia::astro;
21+
2022Eigen::Vector3d DeepSkyObject::getPosition () const
2123{
2224 return position;
@@ -86,14 +88,14 @@ bool DeepSkyObject::pick(const Eigen::ParametrizedLine<double, 3>& ray,
8688bool DeepSkyObject::load (const AssociativeArray* params, const fs::path& resPath)
8789{
8890 // Get position
89- if (auto position = params->getLengthVector <double >(" Position" , KM_PER_LY<double >); position .has_value ())
91+ if (auto pos = params->getLengthVector <double >(" Position" , astro:: KM_PER_LY<double >); pos .has_value ())
9092 {
91- setPosition (*position );
93+ setPosition (*pos );
9294 }
9395 else
9496 {
95- auto distance = params->getLength <double >(" Distance" , KM_PER_LY<double >).value_or (1.0 );
96- auto RA = params->getAngle <double >(" RA" , DEG_PER_HRA).value_or (0.0 );
97+ auto distance = params->getLength <double >(" Distance" , astro:: KM_PER_LY<double >).value_or (1.0 );
98+ auto RA = params->getAngle <double >(" RA" , astro:: DEG_PER_HRA).value_or (0.0 );
9799 auto dec = params->getAngle <double >(" Dec" ).value_or (0.0 );
98100
99101 Eigen::Vector3d p = astro::equatorialToCelestialCart (RA, dec, distance);
@@ -107,7 +109,7 @@ bool DeepSkyObject::load(const AssociativeArray* params, const fs::path& resPath
107109 setOrientation (Eigen::Quaternionf (Eigen::AngleAxisf (static_cast <float >(celmath::degToRad (angle)),
108110 axis.cast <float >().normalized ())));
109111
110- setRadius (params->getLength <float >(" Radius" , KM_PER_LY<double >).value_or (1 .0f ));
112+ setRadius (params->getLength <float >(" Radius" , astro:: KM_PER_LY<double >).value_or (1 .0f ));
111113
112114 if (auto absMagValue = params->getNumber <float >(" AbsMag" ); absMagValue.has_value ())
113115 setAbsoluteMagnitude (*absMagValue);
0 commit comments