diff options
| author | Josh Rahm <rahm@google.com> | 2025-12-23 12:59:23 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2025-12-23 12:59:23 -0700 |
| commit | 46efbf05fcade8199035f956e20a63ca91fc88fd (patch) | |
| tree | 9e3f3e297ea66e442e1a11b5ad16ad8ed6fc7fb7 /sons_of_sol/Updaters.hpp | |
| parent | 306bb687414f54177eb37ab7cd744e491c397c31 (diff) | |
| download | SonsOfSol-46efbf05fcade8199035f956e20a63ca91fc88fd.tar.gz SonsOfSol-46efbf05fcade8199035f956e20a63ca91fc88fd.tar.bz2 SonsOfSol-46efbf05fcade8199035f956e20a63ca91fc88fd.zip | |
Run clang-format and add .clang-format
Diffstat (limited to 'sons_of_sol/Updaters.hpp')
| -rw-r--r-- | sons_of_sol/Updaters.hpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/sons_of_sol/Updaters.hpp b/sons_of_sol/Updaters.hpp index 1f81112..e2e8b2d 100644 --- a/sons_of_sol/Updaters.hpp +++ b/sons_of_sol/Updaters.hpp @@ -7,37 +7,37 @@ * Updaters.hpp: <description> */ -#include "sons_of_sol/AIShip.hpp" -#include "glox/GloxPoint.hpp" #include "glox/GloxCommon.hpp" +#include "glox/GloxPoint.hpp" +#include "sons_of_sol/AIShip.hpp" class EllipseUpdater : public AIShip::Updater { -public: - inline EllipseUpdater( const glox::GloxPoint<>& center, - const glox::GloxPoint<>& major, const glox::GloxPoint<>& minor, - float speed_factor ) : - m_center( center ), - m_major( major ), - m_minor( minor ), - m_speed( speed_factor ) { - m_a = major.getMagnitude(); - m_b = minor.getMagnitude(); - } + public: + inline EllipseUpdater(const glox::GloxPoint<>& center, + const glox::GloxPoint<>& major, + const glox::GloxPoint<>& minor, float speed_factor) + : m_center(center), + m_major(major), + m_minor(minor), + m_speed(speed_factor) { + m_a = major.getMagnitude(); + m_b = minor.getMagnitude(); + } + + inline glox::GloxPoint<> update(uint32_t time) { + float t = m_speed * time; + return m_center + (m_major * m_a * glox::GloxCos(t) + + m_minor * m_b * glox::GloxSin(t)); + } - inline glox::GloxPoint<> update( uint32_t time ) { - float t = m_speed * time ; - return m_center + ( m_major * m_a * glox::GloxCos( t ) + - m_minor * m_b * glox::GloxSin( t ) ); - } - -private: - glox::GloxPoint<> m_center; - glox::GloxPoint<> m_major; - glox::GloxPoint<> m_minor; + private: + glox::GloxPoint<> m_center; + glox::GloxPoint<> m_major; + glox::GloxPoint<> m_minor; - float m_a; - float m_b; - float m_speed ; + float m_a; + float m_b; + float m_speed; }; #endif /* UPDATERS_HPP_ */ |