22#include <sigc++/signal.h>
186 void RefreshShips(
void);
187 void AddShipTracks(
double atTime);
189 void CalculateShipPositionAtTime(
const Ship *s,
Orbit o,
double t,
vector3d &pos);
190 void CalculateFramePositionAtTime(
FrameId frameId,
double t,
vector3d &pos);
192 double CalculateStarportHeight(
const SystemBody *body);
197 std::unique_ptr<SystemMapViewport> m_map;
199 std::list<std::pair<Ship *, Orbit>> m_contacts;
202 bool m_viewingCurrentSystem;
235 void Update(
float deltaTime);
256 std::vector<Projectable::GroupInfo>
GroupProjectables(
vector2f groupThreshold,
const std::vector<Projectable> &specialObjects);
274 const std::vector<Projectable> &
GetProjected()
const {
return m_projected; }
307 using InputFrame::InputFrame;
308 void RegisterBindings()
override;
315 void DrawOrreryView();
316 void DrawAtlasView();
330 void DrawGrid(uint32_t radius);
341 std::vector<Projectable> m_objectTracks;
342 std::vector<ProjectedOrbit> m_orbitTracks;
344 std::vector<Projectable> m_projected;
350 float m_atlasZoom, m_atlasZoomTo, m_atlasZoomDefault;
351 vector2f m_atlasPos, m_atlasPosTo, m_atlasPosDefault;
352 float m_atlasViewW, m_atlasViewH;
354 bool m_showGravpoints;
359 bool m_rotateWithMouseButton =
false;
360 bool m_rotateView =
false;
361 bool m_zoomView =
false;
362 const float CAMERA_FOV = 50.f;
363 const float CAMERA_FOV_RADIANS = CAMERA_FOV / 57.295779f;
366 float m_rot_x, m_rot_y;
367 float m_rot_x_to, m_rot_y_to;
368 float m_zoom, m_zoomTo;
369 int m_animateTransition;
377 std::unique_ptr<Graphics::Drawables::Disk> m_bodyIcon;
378 std::unique_ptr<Graphics::Material> m_bodyMat;
379 std::unique_ptr<Graphics::Material> m_atlasMat;
380 std::unique_ptr<Graphics::Material> m_lineMat;
381 std::unique_ptr<Graphics::Material> m_gridMat;
384 std::unique_ptr<vector3f[]> m_orbitVts;
385 std::unique_ptr<Color[]> m_orbitColors;
387 std::unique_ptr<Graphics::VertexArray> m_lineVerts;
ShowLagrange
Definition: SystemView.h:48
@ LAG_ICONTEXT
Definition: SystemView.h:50
@ LAG_ICON
Definition: SystemView.h:49
@ LAG_OFF
Definition: SystemView.h:51
ShipDrawing
Definition: SystemView.h:36
@ ORBITS
Definition: SystemView.h:38
@ BOXES
Definition: SystemView.h:37
@ OFF
Definition: SystemView.h:39
GridDrawing
Definition: SystemView.h:42
Definition: Background.h:90
Definition: DeleteEmitter.h:16
Definition: Drawables.h:83
Definition: Renderer.h:45
Definition: GuiApplication.h:27
Definition: PiGuiView.h:11
Definition: RefCounted.h:36
Definition: StarSystem.h:28
Definition: SystemBody.h:137
Definition: SystemView.h:230
ShowLagrange GetShowLagrange()
Definition: SystemView.h:249
ShipDrawing GetShipDrawing()
Definition: SystemView.h:250
RefCountedPtr< StarSystem > GetCurrentSystem()
Definition: SystemView.cpp:370
void SetColor(ColorIndex color_index, Color *color_value)
Definition: SystemView.h:301
void SetShowGravpoints(bool enabled)
Definition: SystemView.h:280
std::vector< Projectable::GroupInfo > GroupProjectables(vector2f groupThreshold, const std::vector< Projectable > &specialObjects)
Definition: SystemView.cpp:965
void ClearSelectedObject()
Definition: SystemView.cpp:1125
sigc::slot< double(const SystemBody *)> GetStarportHeightAboveTerrain
Definition: SystemView.h:303
~SystemMapViewport()
Definition: SystemView.cpp:321
void SetCurrentSystem(RefCountedPtr< StarSystem > system)
Definition: SystemView.cpp:375
void AddOrbitTrack(Projectable p, const Orbit *orbit, Color color, double planetRadius)
Definition: SystemView.cpp:1055
void HandleInput(float deltaTime)
Definition: SystemView.cpp:820
void SetSelectedObject(Projectable p)
Definition: SystemView.h:240
void SetRotateMode(bool enable)
Definition: SystemView.cpp:1116
void ViewSelectedObject()
Definition: SystemView.h:243
float GetZoom() const
Definition: SystemView.cpp:1147
void SetVisibility(std::string param)
Definition: SystemView.cpp:1076
void AccelerateTime(float step)
Definition: SystemView.cpp:325
void SetDisplayMode(SystemView::Mode displayMode)
Definition: SystemView.h:278
Projectable * GetViewedObject()
Definition: SystemView.h:247
double ProjectedSize(double size, vector3d pos)
Definition: SystemView.cpp:1139
void Draw3D()
Definition: SystemView.cpp:532
ColorIndex
Definition: SystemView.h:289
@ SYSTEMBODY_ORBIT
Definition: SystemView.h:293
@ PLANNER_ORBIT
Definition: SystemView.h:295
@ SELECTED_SHIP_ORBIT
Definition: SystemView.h:296
@ GRID
Definition: SystemView.h:290
@ GRID_LEG
Definition: SystemView.h:291
@ SHIP_ORBIT
Definition: SystemView.h:297
@ SYSTEMBODY
Definition: SystemView.h:292
@ PLAYER_ORBIT
Definition: SystemView.h:294
void ResetViewpoint()
Definition: SystemView.cpp:336
void AddObjectTrack(Projectable p)
Definition: SystemView.cpp:1040
GridDrawing GetGridDrawing()
Definition: SystemView.h:251
Projectable * GetSelectedObject()
Definition: SystemView.h:239
const std::vector< Projectable > & GetProjected() const
Definition: SystemView.h:274
void Update(float deltaTime)
Definition: SystemView.cpp:880
float AtlasViewPixelPerUnit()
Definition: SystemView.cpp:1152
void SetViewedObject(Projectable p)
Definition: SystemView.cpp:1130
void SetRealTime()
Definition: SystemView.cpp:331
float AtlasViewPlanetGap(float planetRadius)
Definition: SystemView.h:283
void SetZoomMode(bool enable)
Definition: SystemView.cpp:1107
double GetTime()
Definition: SystemView.h:273
void SetBackground(Background::Container *bg)
Definition: SystemView.h:279
void SetReferenceTime(double time)
Definition: SystemView.h:272
Color svColor[8]
Definition: SystemView.h:300
Definition: SystemView.h:164
void SetDisplayMode(Mode displayMode)
Definition: SystemView.h:178
void Draw3D() override
Definition: SystemView.cpp:247
~SystemView() override
Definition: SystemView.cpp:79
Mode GetDisplayMode()
Definition: SystemView.h:177
void OnSwitchFrom() override
Definition: SystemView.cpp:266
double GetOrbitPlannerStartTime() const
Definition: SystemView.h:181
void Update() override
Definition: SystemView.cpp:165
SystemMapViewport * GetMap()
Definition: SystemView.h:183
Mode
Definition: SystemView.h:166
TransferPlanner * GetTransferPlanner() const
Definition: SystemView.h:180
Definition: TransferPlanner.h:8
double GetStartTime() const
Definition: TransferPlanner.cpp:71
Definition: Background.cpp:62
Definition: SystemView.h:144
float radius
Definition: SystemView.h:146
SystemBody * body
Definition: SystemView.h:145
vector2f size
Definition: SystemView.h:150
bool isVertical
Definition: SystemView.h:147
vector2f offset
Definition: SystemView.h:149
bool isBinary
Definition: SystemView.h:148
std::vector< AtlasBodyLayout > children
Definition: SystemView.h:152
Definition: Graphics.h:59
Definition: SystemView.h:125
types type
Definition: SystemView.h:134
bool hasSpecial(int index) const
Definition: SystemView.h:140
uint32_t specials
Definition: SystemView.h:136
GroupInfo(int trackIdx, vector3f screenpos, types type=OBJECT)
Definition: SystemView.h:126
void setSpecial(int index)
Definition: SystemView.h:139
vector3f screenpos
Definition: SystemView.h:135
std::vector< int > tracks
Definition: SystemView.h:137
Definition: SystemView.h:78
enum Projectable::bases base
Projectable(const types t, const bases b, const SystemBody *obj, const vector3d &pos=vector3d())
Definition: SystemView.h:110
const SystemBody * sbody
Definition: SystemView.h:98
const Body * body
Definition: SystemView.h:97
bases
Definition: SystemView.h:89
@ BODY
Definition: SystemView.h:91
@ SHIP
Definition: SystemView.h:92
@ PLAYER
Definition: SystemView.h:93
@ PLANNER
Definition: SystemView.h:94
@ SYSTEMBODY
Definition: SystemView.h:90
bool operator==(const Projectable &rhs) const
Definition: SystemView.h:120
union Projectable::@10 ref
int orbitIdx
Definition: SystemView.h:103
float screensize
Definition: SystemView.h:101
vector3f screenpos
Definition: SystemView.h:100
void * getRef() const
Definition: SystemView.h:118
Projectable()
Definition: SystemView.h:115
types
Definition: SystemView.h:79
@ L5
Definition: SystemView.h:83
@ L4
Definition: SystemView.h:82
@ ORBIT
Definition: SystemView.h:86
@ PERIAPSIS
Definition: SystemView.h:85
@ OBJECT
Definition: SystemView.h:81
@ APOAPSIS
Definition: SystemView.h:84
@ _MAX
Definition: SystemView.h:87
@ NONE
Definition: SystemView.h:80
vector3d worldpos
Definition: SystemView.h:102
Projectable(const types t, const bases b, const Body *obj, const vector3d &pos=vector3d())
Definition: SystemView.h:105
enum Projectable::types type
Definition: SystemView.h:54
double planetRadius
Definition: SystemView.h:57
Orbit orbit
Definition: SystemView.h:55
Color color
Definition: SystemView.h:56
vector3< double > vector3d
Definition: vector3.h:329