VR-Engage  2.3
Loading...
Searching...
No Matches
vortexMaterialDebugHelpers.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2026 MAK Technologies, Inc.
3 * All rights reserved.
4 ******************************************************************************/
5
6//! \file vortexMaterialDebugHelpers.h
7//! \brief Renders Vortex material and dynamics-contact diagnostics
8//! \ingroup vreVrfVortex
9
10#pragma once
11
12#include <vreVrfVortex/export.h>
13
14#include <VxMath/Types.h>
15
16#include <string>
17
18namespace Vx
19{
20class VxMaterialTable;
21class VxUniverse;
22} // namespace Vx
23
24namespace makVre
25{
27
28//! \brief Renders Vortex material and dynamics-contact diagnostics
29//!
30//! Owns the selection state for the runtime material table, terrain material
31//! mappings, and active dynamics contacts displayed by DtVortexDebug.
33{
34public:
35 //! \brief Tracks selected materials within one debug data source
37 {
38 std::string mySelectedMaterialName; //!< Material displayed by the single-material inspector.
39 std::string myFirstMaterialName; //!< First material in a rigid-body response-model pair.
40 std::string mySecondMaterialName; //!< Optional second material in a rigid-body response-model pair.
41 };
42
43 //! \brief Tracks an active dynamics contact across simulation frames
45 {
46 bool myValid = false; //!< Whether the remaining fields identify a selected contact.
47 unsigned int myPart0CreationIndex = 0; //!< Vortex creation index of the first colliding part.
48 unsigned int myPart1CreationIndex = 0; //!< Vortex creation index of the second colliding part.
49 unsigned int myGeometry0CreationIndex = 0; //!< Vortex creation index of the first collision geometry.
50 unsigned int myGeometry1CreationIndex = 0; //!< Vortex creation index of the second collision geometry.
51 VxMath::Vector3 myPosition; //!< Contact position used to select the nearest continuing contact.
52 };
53
54 //! \brief Identifies the source displayed by the material inspector window
56 {
57 None, //!< No material source is selected.
58 RigidBodyResponseModel, //!< The active universe rigid-body response-model material table.
59 SurfaceMaterialMapper //!< A material resolved by the terrain surface mapper.
60 };
61
62 //! \brief Constructor
64
65 //! \brief Destructor
67
68 //! \brief Deleted copy constructor
70
71 //! \brief Deleted copy-assignment operator
73
74 //! \brief Renders material and contact sections in the main Vortex debug panel
75 //!
76 //! Updates selections while rendering active contacts, runtime materials, and
77 //! terrain surface-to-material mappings.
78 //! \param physicalWorld Current Vortex physical world
79 //! \param universe Current Vortex universe, or nullptr when no universe is active
80 void renderMainImgui(DtVortexPhysicalWorld* physicalWorld, Vx::VxUniverse* universe);
81
82 //! \brief Renders the detached material and contact inspector windows
83 //!
84 //! Renders details for selections made by renderMainImgui().
85 //! \param universe Current Vortex universe, or nullptr when no universe is active
86 void renderExtraImguiWindows(Vx::VxUniverse* universe);
87
88protected:
89 //! \brief Returns the material table owned by the current universe response model
90 //! \param universe Current Vortex universe
91 //! \return A non-owning material-table pointer, or nullptr if unavailable
92 Vx::VxMaterialTable* rigidBodyResponseModelMaterialTable(Vx::VxUniverse* universe) const;
93
94 //! \brief Clears selections when the active universe changes
96
97 Vx::VxUniverse* myUniverse = nullptr; //!< Non-owning pointer used to detect universe changes.
98
99 bool myDynamicsContactInspectorOpen = false; //!< Whether the detached contact inspector is visible.
100 DtDynamicsContactSelection myDynamicsContactSelection; //!< Active contact selected for inspection
101
102 //! \brief Selection in the rigid-body response-model material table
103 //!
104 //! Supports selecting a material pair to inspect its contact material.
106 std::string mySelectedSurfaceMaterialMapperMaterialName; //!< Single material selected in the surface mapper.
107
108 bool myMaterialInspectorOpen = false; //!< Whether the detached material inspector is visible.
109
110 //! \brief Material source displayed in the detached inspector
111 //!
112 //! \note None when no inspector is open.
114};
115} // namespace makVre
void resetSelections()
Clears selections when the active universe changes.
DtVortexMaterialDebugHelpers(const DtVortexMaterialDebugHelpers &)=delete
Deleted copy constructor.
Vx::VxUniverse * myUniverse
Non-owning pointer used to detect universe changes.
Definition vortexMaterialDebugHelpers.h:97
void renderExtraImguiWindows(Vx::VxUniverse *universe)
Renders the detached material and contact inspector windows.
DtVortexMaterialDebugHelpers()=default
Constructor.
DtMaterialSelectionState myRigidBodyResponseModelMaterialSelection
Selection in the rigid-body response-model material table.
Definition vortexMaterialDebugHelpers.h:105
DtVortexMaterialDebugHelpers & operator=(const DtVortexMaterialDebugHelpers &)=delete
Deleted copy-assignment operator.
DtMaterialInspectorSource myMaterialInspectorSource
Material source displayed in the detached inspector.
Definition vortexMaterialDebugHelpers.h:113
void renderMainImgui(DtVortexPhysicalWorld *physicalWorld, Vx::VxUniverse *universe)
Renders material and contact sections in the main Vortex debug panel.
std::string mySelectedSurfaceMaterialMapperMaterialName
Single material selected in the surface mapper.
Definition vortexMaterialDebugHelpers.h:106
DtDynamicsContactSelection myDynamicsContactSelection
Active contact selected for inspection.
Definition vortexMaterialDebugHelpers.h:100
DtMaterialInspectorSource
Identifies the source displayed by the material inspector window.
Definition vortexMaterialDebugHelpers.h:56
@ SurfaceMaterialMapper
A material resolved by the terrain surface mapper.
Definition vortexMaterialDebugHelpers.h:59
@ RigidBodyResponseModel
The active universe rigid-body response-model material table.
Definition vortexMaterialDebugHelpers.h:58
@ None
No material source is selected.
Definition vortexMaterialDebugHelpers.h:57
bool myMaterialInspectorOpen
Whether the detached material inspector is visible.
Definition vortexMaterialDebugHelpers.h:108
Vx::VxMaterialTable * rigidBodyResponseModelMaterialTable(Vx::VxUniverse *universe) const
Returns the material table owned by the current universe response model.
bool myDynamicsContactInspectorOpen
Whether the detached contact inspector is visible.
Definition vortexMaterialDebugHelpers.h:99
~DtVortexMaterialDebugHelpers()=default
Destructor.
Main class responsible for managing the Vortex physics simulation environment.
Definition vortexPhysicalWorld.h:65
Export macros for the VR-Forces Vortex extension library.
#define VREVRFVORTEX_DLL
Export macro for non-Windows platforms.
Definition export.h:30
Wheel articulated part IDs used in the system.
Definition surfaceToVxMaterialMapper.h:20
!
Definition glsVreMessageUtil.h:50
Tracks an active dynamics contact across simulation frames.
Definition vortexMaterialDebugHelpers.h:45
VxMath::Vector3 myPosition
Contact position used to select the nearest continuing contact.
Definition vortexMaterialDebugHelpers.h:51
unsigned int myPart1CreationIndex
Vortex creation index of the second colliding part.
Definition vortexMaterialDebugHelpers.h:48
bool myValid
Whether the remaining fields identify a selected contact.
Definition vortexMaterialDebugHelpers.h:46
unsigned int myPart0CreationIndex
Vortex creation index of the first colliding part.
Definition vortexMaterialDebugHelpers.h:47
unsigned int myGeometry0CreationIndex
Vortex creation index of the first collision geometry.
Definition vortexMaterialDebugHelpers.h:49
unsigned int myGeometry1CreationIndex
Vortex creation index of the second collision geometry.
Definition vortexMaterialDebugHelpers.h:50
Tracks selected materials within one debug data source.
Definition vortexMaterialDebugHelpers.h:37
std::string myFirstMaterialName
First material in a rigid-body response-model pair.
Definition vortexMaterialDebugHelpers.h:39
std::string mySelectedMaterialName
Material displayed by the single-material inspector.
Definition vortexMaterialDebugHelpers.h:38
std::string mySecondMaterialName
Optional second material in a rigid-body response-model pair.
Definition vortexMaterialDebugHelpers.h:40