Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
GUI_FlexbodyDebug.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2022 Petr Ohlidal
4
5 For more information, see http://www.rigsofrods.org/
6
7 Rigs of Rods is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3, as
9 published by the Free Software Foundation.
10
11 Rigs of Rods is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
18*/
19
21
22#pragma once
23
24#include "Application.h"
25
26#include "SimData.h"
27
28namespace RoR {
29namespace GUI {
30
33{
34public:
35 bool IsVisible() const { return m_is_visible; }
36 bool IsHovered() const { return m_is_hovered; }
37 void SetVisible(bool value) { m_is_visible = value; m_is_hovered = false; }
38 void Draw();
40
41 void AnalyzeFlexbodies();
42 void DrawDebugView(FlexBody* flexbody, Prop* prop, NodeNum_t node_ref, NodeNum_t node_x, NodeNum_t node_y);
43
44private:
45
46 void UpdateVisibility();
47 void DrawMemoryOrderGraph(FlexBody* flexbody);
48 void DrawLocatorsTable(FlexBody* flexbody, bool& locators_visible);
49 void DrawMeshInfo(FlexBody* flexbody);
50 void DrawMeshInfo(Prop* prop);
51
52 // Display options
53 bool draw_mesh_wireframe = false;
54 bool show_base_nodes = false;
55 bool show_forset_nodes = false;
56 bool show_vertices = false;
57 bool hide_other_elements = false;
58 std::vector<bool> show_locator;
59 int hovered_vert = -1;
60
61 // Flexbody and prop selection combobox
62 std::string m_combo_items;
65
66 // Window state
67 bool m_is_visible = false;
68 bool m_is_hovered = false;
69};
70
71} // namespace GUI
72} // namespace RoR
Central state/object manager and communications hub.
Core data structures for simulation; Everything affected by by either physics, network or user intera...
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
Definition FlexBody.h:44
Flexbody and prop diagnostic.
void AnalyzeFlexbodies()
populates the combobox
std::string m_combo_items
Flexbodies come first, props second.
void DrawLocatorsTable(FlexBody *flexbody, bool &locators_visible)
void DrawMeshInfo(FlexBody *flexbody)
std::vector< bool > show_locator
void DrawDebugView(FlexBody *flexbody, Prop *prop, NodeNum_t node_ref, NodeNum_t node_x, NodeNum_t node_y)
void SetVisible(bool value)
int m_combo_props_start
Index of first prop in the combobox. -1 means no props.
bool IsHideOtherElementsModeActive() const
void DrawMemoryOrderGraph(FlexBody *flexbody)
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
A mesh attached to vehicle frame via 3 nodes.
Definition GfxData.h:156