@@ -255,25 +255,25 @@ Body::markUpdated()
255255const  std::shared_ptr<const  ReferenceFrame>&
256256Body::getOrbitFrame (double  tdb) const 
257257{
258-     return  timeline->findPhase (tdb)-> orbitFrame ();
258+     return  timeline->findPhase (tdb). orbitFrame ();
259259}
260260
261261const  celestia::ephem::Orbit*
262262Body::getOrbit (double  tdb) const 
263263{
264-     return  timeline->findPhase (tdb)-> orbit ().get ();
264+     return  timeline->findPhase (tdb). orbit ().get ();
265265}
266266
267267const  std::shared_ptr<const  ReferenceFrame>&
268268Body::getBodyFrame (double  tdb) const 
269269{
270-     return  timeline->findPhase (tdb)-> bodyFrame ();
270+     return  timeline->findPhase (tdb). bodyFrame ();
271271}
272272
273273const  celestia::ephem::RotationModel*
274274Body::getRotationModel (double  tdb) const 
275275{
276-     return  timeline->findPhase (tdb)-> rotationModel ().get ();
276+     return  timeline->findPhase (tdb). rotationModel ().get ();
277277}
278278
279279/* ! Get the radius of a sphere large enough to contain the primary
@@ -581,16 +581,16 @@ Body::getPosition(double tdb) const
581581{
582582    Eigen::Vector3d position = Eigen::Vector3d::Zero ();
583583
584-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
585-     Eigen::Vector3d p = phase-> orbit ()->positionAtTime (tdb);
586-     const  ReferenceFrame* frame = phase-> orbitFrame ().get ();
584+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
585+     Eigen::Vector3d p = phase. orbit ()->positionAtTime (tdb);
586+     const  ReferenceFrame* frame = phase. orbitFrame ().get ();
587587
588588    while  (frame->getCenter ().getType () == SelectionType::Body)
589589    {
590-         phase  = frame->getCenter ().body ()->timeline ->findPhase (tdb). get ( );
590+         const  TimelinePhase& centerPhase  = frame->getCenter ().body ()->timeline ->findPhase (tdb);
591591        position += frame->getOrientation (tdb).conjugate () * p;
592-         p = phase-> orbit ()->positionAtTime (tdb);
593-         frame = phase-> orbitFrame ().get ();
592+         p = centerPhase. orbit ()->positionAtTime (tdb);
593+         frame = centerPhase. orbitFrame ().get ();
594594    }
595595
596596    position += frame->getOrientation (tdb).conjugate () * p;
@@ -606,20 +606,20 @@ Body::getPosition(double tdb) const
606606Eigen::Quaterniond
607607Body::getOrientation (double  tdb) const 
608608{
609-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
610-     return  phase-> rotationModel ()->orientationAtTime (tdb) * phase-> bodyFrame ()->getOrientation (tdb);
609+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
610+     return  phase. rotationModel ()->orientationAtTime (tdb) * phase. bodyFrame ()->getOrientation (tdb);
611611}
612612
613613/* ! Get the velocity of the body in the universal frame.
614614 */  
615615Eigen::Vector3d
616616Body::getVelocity (double  tdb) const 
617617{
618-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
618+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
619619
620-     const  ReferenceFrame* orbitFrame = phase-> orbitFrame ().get ();
620+     const  ReferenceFrame* orbitFrame = phase. orbitFrame ().get ();
621621
622-     Eigen::Vector3d v = phase-> orbit ()->velocityAtTime (tdb);
622+     Eigen::Vector3d v = phase. orbit ()->velocityAtTime (tdb);
623623    v = orbitFrame->getOrientation (tdb).conjugate () * v + orbitFrame->getCenter ().getVelocity (tdb);
624624
625625    if  (!orbitFrame->isInertial ())
@@ -636,11 +636,11 @@ Body::getVelocity(double tdb) const
636636Eigen::Vector3d
637637Body::getAngularVelocity (double  tdb) const 
638638{
639-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
639+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
640640
641-     Eigen::Vector3d v = phase-> rotationModel ()->angularVelocityAtTime (tdb);
641+     Eigen::Vector3d v = phase. rotationModel ()->angularVelocityAtTime (tdb);
642642
643-     const  ReferenceFrame* bodyFrame = phase-> bodyFrame ().get ();
643+     const  ReferenceFrame* bodyFrame = phase. bodyFrame ().get ();
644644    v = bodyFrame->getOrientation (tdb).conjugate () * v;
645645    if  (!bodyFrame->isInertial ())
646646    {
@@ -659,8 +659,8 @@ Body::getAngularVelocity(double tdb) const
659659Eigen::Matrix4d
660660Body::getLocalToAstrocentric (double  tdb) const 
661661{
662-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
663-     Eigen::Vector3d p = phase-> orbitFrame ()->convertToAstrocentric (phase-> orbit ()->positionAtTime (tdb), tdb);
662+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
663+     Eigen::Vector3d p = phase. orbitFrame ()->convertToAstrocentric (phase. orbit ()->positionAtTime (tdb), tdb);
664664    return  Eigen::Transform<double , 3 , Eigen::Affine>(Eigen::Translation3d (p)).matrix ();
665665}
666666
@@ -670,17 +670,17 @@ Eigen::Vector3d
670670Body::getAstrocentricPosition (double  tdb) const 
671671{
672672    //  TODO: Switch the iterative method used in getPosition
673-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
674-     return  phase-> orbitFrame ()->convertToAstrocentric (phase-> orbit ()->positionAtTime (tdb), tdb);
673+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
674+     return  phase. orbitFrame ()->convertToAstrocentric (phase. orbit ()->positionAtTime (tdb), tdb);
675675}
676676
677677/* ! Get a rotation that converts from the ecliptic frame to the body frame.
678678 */  
679679Eigen::Quaterniond
680680Body::getEclipticToFrame (double  tdb) const 
681681{
682-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
683-     return  phase-> bodyFrame ()->getOrientation (tdb);
682+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
683+     return  phase. bodyFrame ()->getOrientation (tdb);
684684}
685685
686686/* ! Get a rotation that converts from the ecliptic frame to the body's
@@ -689,8 +689,8 @@ Body::getEclipticToFrame(double tdb) const
689689Eigen::Quaterniond
690690Body::getEclipticToEquatorial (double  tdb) const 
691691{
692-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
693-     return  phase-> rotationModel ()->equatorOrientationAtTime (tdb) * phase-> bodyFrame ()->getOrientation (tdb);
692+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
693+     return  phase. rotationModel ()->equatorOrientationAtTime (tdb) * phase. bodyFrame ()->getOrientation (tdb);
694694}
695695
696696//  The body-fixed coordinate system has an origin at the center of the
@@ -699,8 +699,8 @@ Body::getEclipticToEquatorial(double tdb) const
699699Eigen::Quaterniond
700700Body::getEquatorialToBodyFixed (double  tdb) const 
701701{
702-     const  TimelinePhase*  phase = timeline->findPhase (tdb). get ( );
703-     return  phase-> rotationModel ()->spin (tdb);
702+     const  TimelinePhase&  phase = timeline->findPhase (tdb);
703+     return  phase. rotationModel ()->spin (tdb);
704704}
705705
706706/* ! Get a transformation to convert from the object's body fixed frame
0 commit comments