@@ -386,290 +386,313 @@ void imguiManager::WidgetAddObject()
}
ImGui : : SameLine ( ) ;
ImGui : : Text ( " Number of cubes: %d " , app_ - > get_cube_count ( ) ) ;
ImGui : : Text ( " Number of cubes: %d " , 1 ) ;
}
}
void imguiManager : : WidgetObjectWindow ( )
{
ImGui : : Begin ( " Objects " , & showObjectWindow ) ;
// Obtenir toutes les entit<69> s avec un composant d'identit<69> et de transformation
auto entities = app_ - > get_entity_manager ( ) - > GetEntitiesWithComponent < ecs : : IdentityComponent > ( ) ;
int index = 0 ;
for ( auto & object : app_ - > get_kobjects ( ) )
for ( auto & entity : entities )
{
std : : string headerName = object - > GetName ( ) + " " + std : : to_string ( index ) ;
if ( ImGui : : CollapsingHeader ( headerName . c_str ( ) ) )
auto identity = entity - > GetComponent < ecs : : IdentityComponent > ( ) ;
auto transform = entity - > GetComponent < ecs : : TransformComponent > ( ) ;
auto render = entity - > GetComponent < ecs : : RenderComponent > ( ) ;
auto shader = entity - > GetComponent < ecs : : ShaderComponent > ( ) ;
auto physics = entity - > GetComponent < ecs : : PhysicsComponent > ( ) ;
if ( identity & & transform )
{
XMVECTOR position = object - > GetPosition ( ) ;
XMVECTOR rotation = object - > GetRotation ( ) ;
XMVECTOR scale = object - > GetScale ( ) ;
float pos [ 3 ] = { XMVectorGetX ( position ) , XMVectorGetY ( position ) , XMVectorGetZ ( position ) } ;
std : : string posLabel = " Position## " + std : : to_string ( index ) ;
if ( ImGui : : DragFloat3 ( posLabel . c_str ( ) , pos ) )
std : : string headerName = identity - > GetName ( ) + " " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : CollapsingHeader ( headerName . c_str ( ) ) )
{
object - > SetPosition ( XMVectorSet ( pos [ 0 ] , pos [ 1 ] , pos [ 2 ] , 0.0f ) ) ;
}
// Position, Rotation, Scale
XMVECTOR position = transform - > GetPosition ( ) ;
XMVECTOR rotation = transform - > GetRotation ( ) ;
XMVECTOR scale = transform - > GetScale ( ) ;
float rot [ 3 ] = { XMVectorGetX ( rota tion) , XMVectorGetY ( rota tion) , XMVectorGetZ ( rota tion) } ;
std : : string rot Label = " Rota tion##" + std : : to_string ( index ) ;
if ( ImGui : : DragFloat3 ( rot Label. c_str ( ) , rot ) )
{
object - > SetRotation ( XMVectorSet ( rot [ 0 ] , rot [ 1 ] , rot [ 2 ] , 0.0f ) ) ;
}
float scl [ 3 ] = { XMVectorGetX ( scale ) , XMVectorGetY ( scale ) , XMVectorGetZ ( scale ) } ;
std : : string sclLabel = " Scale## " + std : : to_string ( index ) ;
if ( ImGui : : DragFloat3 ( sclLabel . c_str ( ) , scl ) )
{
object - > SetScale ( XMVectorSet ( scl [ 0 ] , scl [ 1 ] , scl [ 2 ] , 0.0f ) ) ;
}
ImGui : : Separator ( ) ;
// D<> finir les types de textures_
std : : vector < std : : string > textureCategories = {
" Diffuse " , " Normal " , " Specular " , " Alpha "
} ;
std : : vector < TextureType > textureTypes = {
TextureType : : Diffuse , TextureType : : Normal ,
TextureType : : Specular , TextureType : : Alpha
} ;
// Cr<43> er un espace pour afficher les textures_ avec d<> filement
ImGui : : BeginChild ( " TextureChild " , ImVec2 ( 0 , 200 ) , true , ImGuiWindowFlags_HorizontalScrollbar ) ;
// Pour chaque type de texture
for ( int typeIndex = 0 ; typeIndex < textureCategories . size ( ) ; typeIndex + + )
{
TextureType type = textureTypes [ typeIndex ] ;
std : : string typeName = textureCategories [ typeIndex ] ;
// Afficher le titre de la cat<61> gorie
ImGui : : Text ( " %s: " , typeName . c_str ( ) ) ;
ImGui : : SameLine ( ) ;
// Compter combien de textures_ de ce type existent
int textureCount = 0 ;
while ( object - > get_model ( ) - > GetTexture ( type , textureCount ) ! = nullptr )
{
textureCount + + ;
}
// Afficher toutes les textures_ existantes
ImGui : : BeginGroup ( ) ;
for ( int texIndex = 0 ; texIndex < textureCount ; texIndex + + )
{
ID3D11ShaderResourceView * texture = object - > get_model ( ) - > GetTexture ( type , texIndex ) ;
if ( texture )
{
// ID unique pour chaque bouton de texture
std : : string buttonId = " tex## " + std : : to_string ( index ) + " _ " +
std : : to_string ( typeIndex ) + " _ " +
std : : to_string ( texIndex ) ;
if ( ImGui : : ImageButton ( buttonId . c_str ( ) , ( ImTextureID ) texture , ImVec2 ( 48 , 48 ) ) )
{
// Ouvrir une bo<62> te de dialogue pour changer la texture
OPENFILENAME ofn ;
WCHAR szFile [ 260 ] ;
ZeroMemory ( & ofn , sizeof ( ofn ) ) ;
ofn . lStructSize = sizeof ( ofn ) ;
ofn . hwndOwner = NULL ;
ofn . lpstrFile = szFile ;
szFile [ 0 ] = ' \0 ' ;
ofn . nMaxFile = sizeof ( szFile ) ;
ofn . lpstrFilter = L " Texture \0 *.png;*.jpg;*.dds \0 " ;
ofn . nFilterIndex = 1 ;
ofn . lpstrInitialDir = NULL ;
ofn . Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
if ( GetOpenFileName ( & ofn ) )
{
// Changer la texture existante
object - > get_model ( ) - > ChangeTexture ( m_device , m_deviceContext , ofn . lpstrFile , type , texIndex ) ;
}
}
// Afficher l'indice de texture et pr<70> visualisation au survol
if ( ImGui : : IsItemHovered ( ) )
{
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " %s %d " , typeName . c_str ( ) , texIndex ) ;
ImGui : : Image ( ( ImTextureID ) texture , ImVec2 ( 192 , 192 ) ) ;
ImGui : : EndTooltip ( ) ;
}
ImGui : : SameLine ( ) ;
}
}
// Bouton pour ajouter une nouvelle texture
std : : string addButtonLabel = " +## " + std : : to_string ( index ) + " _ " + std : : to_string ( typeIndex ) ;
if ( ImGui : : Button ( addButtonLabel . c_str ( ) , ImVec2 ( 48 , 48 ) ) )
{
// Ouvrir une bo<62> te de dialogue pour ajouter une texture
OPENFILENAME ofn ;
WCHAR szFile [ 260 ] ;
ZeroMemory ( & ofn , sizeof ( ofn ) ) ;
ofn . lStructSize = sizeof ( ofn ) ;
ofn . hwndOwner = NULL ;
ofn . lpstrFile = szFile ;
szFile [ 0 ] = ' \0 ' ;
ofn . nMaxFile = sizeof ( szFile ) ;
ofn . lpstrFilter = L " Texture \0 *.png;*.jpg;*.dds \0 " ;
ofn . nFilterIndex = 1 ;
ofn . lpstrInitialDir = NULL ;
ofn . Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
if ( GetOpenFileName ( & ofn ) )
{
// Ajouter une nouvelle texture
object - > get_model ( ) - > AddTexture ( m_device , m_deviceContext , ofn . lpstrFile , type ) ;
}
}
ImGui : : EndGroup ( ) ;
ImGui : : Separator ( ) ;
}
ImGui : : EndChild ( ) ;
ImGui : : Separator ( ) ;
// Delete button
std : : string deleteLabel = " Delete## " + std : : to_string ( index ) ;
if ( ImGui : : Button ( deleteLabel . c_str ( ) ) )
{
app_ - > delete_kobject ( index ) ;
}
ImGui : : Separator ( ) ;
// Liste des options
const char * shaderOptions [ ] = {
" Enable Global Lighting " ,
" Enable Lighting " ,
" Enable Cel Shading " ,
" Enable Normal Mapping " ,
" Enable Specular Mapping " ,
" Enable Alpha Mapping "
} ;
ShaderType shaderTypes [ ] = {
ShaderType : : SUNLIGHT ,
ShaderType : : LIGHTING ,
ShaderType : : CEL_SHADING ,
ShaderType : : NORMAL_MAPPING ,
ShaderType : : SPECULAR_MAPPING ,
ShaderType : : ALPHA_MAPPING
} ;
// Variable pour stocker l'option s<> lectionn<6E> e
static int currentShader = 0 ; // Index de l'option actuellement s<> lectionn<6E> e
// Cr<43> ation du menu d<> roulant
if ( ImGui : : BeginCombo ( " Shader Options " , shaderOptions [ currentShader ] ) )
{
for ( int i = 0 ; i < IM_ARRAYSIZE ( shaderOptions ) ; i + + )
float pos [ 3 ] = { XMVectorGetX ( posi tion) , XMVectorGetY ( posi tion) , XMVectorGetZ ( posi tion) } ;
std : : string pos Label = " Posi tion##" + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : DragFloat3 ( pos Label. c_str ( ) , pos ) )
{
// Cr<43> e une option s<> lectionnable pour chaque shader
bool isSelected = ( currentShader = = i ) ;
if ( ImGui : : Selectable ( shaderOptions [ i ] , isSelected ) )
transform - > SetPosition ( XMVectorSet ( pos [ 0 ] , pos [ 1 ] , pos [ 2 ] , 0.0f ) ) ;
transform - > UpdateWorldMatrix ( ) ;
}
float rot [ 3 ] = { XMVectorGetX ( rotation ) , XMVectorGetY ( rotation ) , XMVectorGetZ ( rotation ) } ;
std : : string rotLabel = " Rotation## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : DragFloat3 ( rotLabel . c_str ( ) , rot ) )
{
transform - > SetRotation ( XMVectorSet ( rot [ 0 ] , rot [ 1 ] , rot [ 2 ] , 0.0f ) ) ;
transform - > UpdateWorldMatrix ( ) ;
}
float scl [ 3 ] = { XMVectorGetX ( scale ) , XMVectorGetY ( scale ) , XMVectorGetZ ( scale ) } ;
std : : string sclLabel = " Scale## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : DragFloat3 ( sclLabel . c_str ( ) , scl ) )
{
transform - > SetScale ( XMVectorSet ( scl [ 0 ] , scl [ 1 ] , scl [ 2 ] , 0.0f ) ) ;
transform - > UpdateWorldMatrix ( ) ;
}
ImGui : : Separator ( ) ;
// Textures - Seulement si le composant de rendu existe
if ( render & & render - > GetModel ( ) )
{
// D<> finir les types de textures_
std : : vector < std : : string > textureCategories = {
" Diffuse " , " Normal " , " Specular " , " Alpha "
} ;
std : : vector < TextureType > textureTypes = {
TextureType : : Diffuse , TextureType : : Normal ,
TextureType : : Specular , TextureType : : Alpha
} ;
// Cr<43> er un espace pour afficher les textures_ avec d<> filement
std : : string textureChildId = " TextureChild## " + std : : to_string ( identity - > GetId ( ) ) ;
ImGui : : BeginChild ( textureChildId . c_str ( ) , ImVec2 ( 0 , 200 ) , true , ImGuiWindowFlags_HorizontalScrollbar ) ;
// Pour chaque type de texture
for ( int typeIndex = 0 ; typeIndex < textureCategories . size ( ) ; typeIndex + + )
{
// Met <20> jour l'option s<> lectionn<6E> e
currentShader = i ;
object - > SetActiveShader ( shaderTypes [ i ] ) ;
TextureType type = textureTypes [ typeIndex ] ;
std : : string typeName = textureCategories [ typeIndex ] ;
// Afficher le titre de la cat<61> gorie
std : : string categoryLabel = typeName + " ## " + std : : to_string ( identity - > GetId ( ) ) ;
ImGui : : Text ( " %s: " , typeName . c_str ( ) ) ;
ImGui : : SameLine ( ) ;
// Compter combien de textures_ de ce type existent
int textureCount = 0 ;
while ( render - > GetModel ( ) - > GetTexture ( type , textureCount ) ! = nullptr )
{
textureCount + + ;
}
// Afficher toutes les textures_ existantes
std : : string groupId = " TextureGroup_ " + std : : to_string ( identity - > GetId ( ) ) + " _ " + std : : to_string ( typeIndex ) ;
ImGui : : BeginGroup ( ) ;
for ( int texIndex = 0 ; texIndex < textureCount ; texIndex + + )
{
ID3D11ShaderResourceView * texture = render - > GetModel ( ) - > GetTexture ( type , texIndex ) ;
if ( texture )
{
// ID unique pour chaque bouton de texture
std : : string buttonId = " tex## " + std : : to_string ( identity - > GetId ( ) ) + " _ " +
std : : to_string ( typeIndex ) + " _ " +
std : : to_string ( texIndex ) ;
if ( ImGui : : ImageButton ( buttonId . c_str ( ) , ( ImTextureID ) texture , ImVec2 ( 48 , 48 ) ) )
{
// Ouvrir une bo<62> te de dialogue pour changer la texture
OPENFILENAME ofn ;
WCHAR szFile [ 260 ] = { 0 } ;
ZeroMemory ( & ofn , sizeof ( ofn ) ) ;
ofn . lStructSize = sizeof ( ofn ) ;
ofn . hwndOwner = NULL ;
ofn . lpstrFile = szFile ;
ofn . nMaxFile = sizeof ( szFile ) ;
ofn . lpstrFilter = L " Texture \0 *.png;*.jpg;*.dds \0 " ;
ofn . nFilterIndex = 1 ;
ofn . lpstrInitialDir = NULL ;
ofn . Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
if ( GetOpenFileName ( & ofn ) )
{
// Changer la texture existante
render - > GetModel ( ) - > ChangeTexture ( m_device , m_deviceContext , ofn . lpstrFile , type , texIndex ) ;
}
}
// Afficher l'indice de texture et pr<70> visualisation au survol
if ( ImGui : : IsItemHovered ( ) )
{
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " %s %d " , typeName . c_str ( ) , texIndex ) ;
ImGui : : Image ( ( ImTextureID ) texture , ImVec2 ( 192 , 192 ) ) ;
ImGui : : EndTooltip ( ) ;
}
ImGui : : SameLine ( ) ;
}
}
// Bouton pour ajouter une nouvelle texture
std : : string addButtonLabel = " +## " + std : : to_string ( identity - > GetId ( ) ) + " _ " + std : : to_string ( typeIndex ) ;
if ( ImGui : : Button ( addButtonLabel . c_str ( ) , ImVec2 ( 48 , 48 ) ) )
{
// Ouvrir une bo<62> te de dialogue pour ajouter une texture
OPENFILENAME ofn ;
WCHAR szFile [ 260 ] = { 0 } ;
ZeroMemory ( & ofn , sizeof ( ofn ) ) ;
ofn . lStructSize = sizeof ( ofn ) ;
ofn . hwndOwner = NULL ;
ofn . lpstrFile = szFile ;
ofn . nMaxFile = sizeof ( szFile ) ;
ofn . lpstrFilter = L " Texture \0 *.png;*.jpg;*.dds \0 " ;
ofn . nFilterIndex = 1 ;
ofn . lpstrInitialDir = NULL ;
ofn . Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
if ( GetOpenFileName ( & ofn ) )
{
// Ajouter une nouvelle texture
render - > GetModel ( ) - > AddTexture ( m_device , m_deviceContext , ofn . lpstrFile , type ) ;
}
}
ImGui : : EndGroup ( ) ;
ImGui : : Separator ( ) ;
}
ImGui : : EndChild ( ) ;
}
ImGui : : Separator ( ) ;
// Delete button
std : : string deleteLabel = " Delete## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : Button ( deleteLabel . c_str ( ) ) )
{
app_ - > delete_entity_by_id ( identity - > GetId ( ) ) ;
// Sortir du boucle apr<70> s suppression pour <20> viter des acc<63> s invalides
break ;
}
ImGui : : Separator ( ) ;
// Shader options
if ( shader )
{
// Liste des options de shader
const char * shaderOptions [ ] = {
" Enable Global Lighting " ,
" Enable Lighting " ,
" Enable Cel Shading " ,
" Enable Normal Mapping " ,
" Enable Specular Mapping " ,
" Enable Alpha Mapping "
} ;
std : : vector < ecs : : ShaderType > shaderTypes = {
ecs : : ShaderType : : SUNLIGHT ,
ecs : : ShaderType : : LIGHTING ,
ecs : : ShaderType : : CEL_SHADING ,
ecs : : ShaderType : : NORMAL_MAPPING ,
ecs : : ShaderType : : SPECULAR_MAPPING ,
ecs : : ShaderType : : ALPHA_MAPPING
} ;
// Trouver l'index actuel du shader pour cette entit<69> sp<73> cifique
int currentShader = 0 ;
ecs : : ShaderType activeShader = shader - > GetActiveShader ( ) ;
for ( size_t i = 0 ; i < shaderTypes . size ( ) ; i + + )
{
if ( shaderTypes [ i ] = = activeShader )
{
currentShader = static_cast < int > ( i ) ;
break ;
}
}
// Si l'option s<> lectionn<6E> e est active, nous mettons en surbrillance
if ( isSelected )
ImGui : : SetItemDefaultFocus ( ) ;
// Cr<EFBFBD> ation du menu d<> roulant avec un ID unique pour chaque entit<69>
std : : string shaderComboId = " Shader Options## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : BeginCombo ( shaderComboId . c_str ( ) , shaderOptions [ currentShader ] ) )
{
for ( int i = 0 ; i < IM_ARRAYSIZE ( shaderOptions ) ; i + + )
{
// Cr<43> e une option s<> lectionnable pour chaque shader avec ID unique
std : : string shaderSelectableId = std : : to_string ( i ) + " ##shader_ " + std : : to_string ( identity - > GetId ( ) ) ;
bool isSelected = ( currentShader = = i ) ;
if ( ImGui : : Selectable ( shaderOptions [ i ] , isSelected ) )
{
// Met <20> jour l'option s<> lectionn<6E> e uniquement pour cette entit<69>
currentShader = i ;
shader - > SetActiveShader ( shaderTypes [ i ] ) ;
}
// Si l'option s<> lectionn<6E> e est active, nous mettons en surbrillance
if ( isSelected )
ImGui : : SetItemDefaultFocus ( ) ;
}
ImGui : : EndCombo ( ) ;
}
}
ImGui : : EndCombo ( ) ;
}
ImGui : : Separator ( ) ;
ImGui : : Separator ( ) ;
// Physics
bool isPhysicsEnabled = ( physics ! = nullptr ) ;
std : : string physicsLabel = " Physics## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : Checkbox ( physicsLabel . c_str ( ) , & isPhysicsEnabled ) )
{
if ( isPhysicsEnabled & & ! physics )
{
// Ajouter un composant de physique
physics = entity - > AddComponent < ecs : : PhysicsComponent > ( ) ;
physics - > Initialize ( ) ;
}
else if ( ! isPhysicsEnabled & & physics )
{
// Retirer le composant de physique
entity - > RemoveComponent < ecs : : PhysicsComponent > ( ) ;
physics = nullptr ;
}
}
// physics
std : : string physicsLabel = " physics## " + std : : to_string ( index ) ;
if ( ImGui : : Checkbox ( physicsLabel . c_str ( ) , & m_isPhyiscs Enabled ) )
{
object - > SetPhysicsEnabled ( m_isPhyiscs Enabled) ;
}
if ( physics)
{
// Gravity Enabled checkbox
bool gravityEnabled = physics - > IsGravity Enabled( ) ;
std : : string gravityLabel = " Gravity## " + std : : to_string ( identity - > GetId ( ) ) ;
if ( ImGui : : Checkbox ( gravityLabel . c_str ( ) , & gravity Enabled) )
{
physics - > SetGravityEnabled ( gravityEnabled ) ;
}
// Gravity Enabled checkbox
std : : string gravi tyLabel = " Gravity ##" + std : : to_string ( in dex ) ;
if ( ImGui : : Checkbox ( gravityLabel . c_str ( ) , & object - > m_gravityEnabled ) )
{
object - > SetGravityEnabled ( object - > m_gravityEnabled ) ;
}
// 3 radio buttons pour le type d'objet physique avec IDs uniques
std : : string type Label = " Type ##" + std : : to_string ( identity - > GetId ( ) ) ;
ecs : : ObjectType type = identity - > GetType ( ) ;
// 3 r adio b utton on the same line to set the ObjectType
std : : string typeLabel = " Type## " + std : : to_string ( index ) ;
ObjectType type = object - > GetType ( ) ;
if ( ImGui : : RadioButton ( " None " , type = = ObjectType : : Unknown ) )
{
object - > SetType ( ObjectType : : Unknown ) ;
}
ImGui : : SameLine ( ) ;
if ( ImGui : : RadioButton ( " Cube " , type = = ObjectType : : Cube ) )
{
object - > SetType ( ObjectType : : Cube ) ;
}
ImGui : : SameLine ( ) ;
if ( ImGui : : RadioButton ( " Sphere " , type = = ObjectType : : Sphere ) )
{
object - > SetType ( ObjectType : : Sphere ) ;
}
if ( ImGui : : R adioB utton( ( " None## " + std : : to_string ( identity - > GetId ( ) ) ) . c_str ( ) ,
type = = ecs : : ObjectType : : Unknown ) )
{
identity - > SetType ( ecs : : ObjectType : : Unknown ) ;
}
ImGui : : SameLine ( ) ;
if ( ImGui : : RadioButton ( ( " Cube## " + std : : to_string ( identity - > GetId ( ) ) ) . c_str ( ) ,
type = = ecs : : ObjectType : : Cube ) )
{
identity - > SetType ( ecs : : ObjectType : : Cube ) ;
}
ImGui : : SameLine ( ) ;
if ( ImGui : : RadioButton ( ( " Sphere## " + std : : to_string ( identity - > GetId ( ) ) ) . c_str ( ) ,
type = = ecs : : ObjectType : : Sphere ) )
{
identity - > SetType ( ecs : : ObjectType: : Sphere ) ;
}
ImGui : : SameLine ( ) ;
if ( ImGui : : RadioButton ( ( " Terrain## " + std : : to_string ( identity - > GetId ( ) ) ) . c_str ( ) ,
type = = ecs : : ObjectType : : Terrain ) )
{
identity - > SetType ( ecs : : ObjectType : : Terrain ) ;
}
// button to launch the object
std : : string launchLabel = " Launch## " + std : : to_string ( index ) ;
}
// paraeter to set the alpha, initial stretch and spring constant
float alpha = object - > GetAlpha ( ) ;
float initialStretch = object - > GetInitialStretch ( ) ;
float springConstant = object - > GetSpringConstant ( ) ;
if ( ImGui : : DragFloat ( " Alpha## " , & alpha , 0.01f , 0.0f , 1.0f ) )
{
object - > SetAlpha ( alpha ) ;
ImGui : : Separator ( ) ;
}
if ( ImGui : : DragFloat ( " Initial Stretch## " , & initialStretch , 0.01f , 0.0f , 1.0f ) )
{
object - > SetInitialStretch ( initialStretch ) ;
}
if ( ImGui : : DragFloat ( " Spring Constant## " , & springConstant , 0.01f , 0.0f , 100.0f ) )
{
object - > SetSpringConstant ( springConstant ) ;
}
if ( ImGui : : Button ( launchLabel . c_str ( ) ) )
{
object - > LaunchObject ( ) ;
}
ImGui : : SameLine ( ) ;
// button to stop the object
std : : string stopLabel = " Stop## " + std : : to_string ( index ) ;
if ( ImGui : : Button ( stopLabel . c_str ( ) ) )
{
object - > SetVelocity ( XMVectorSet ( 0.0f , 0.0f , 0.0f , 0.0f ) ) ;
object - > SetPosition ( XMVectorSet ( 0.0f , 0.0f , 0.0f , 0.0f ) ) ;
}
ImGui : : Separator ( ) ;
// Demo spinning
std : : string demoLabel = " Demo spinning## " + std : : to_string ( index ) ;
ImGui : : Checkbox ( demoLabel . c_str ( ) , & object - > m_demoSpinning ) ;
index + + ;
}
index + + ;
}
ImGui : : End ( ) ;
@@ -679,7 +702,7 @@ void imguiManager::WidgetTerrainWindow()
{
ImGui : : Begin ( " Terrain " , & showTerrainWindow ) ;
ImGui : : Text ( " Number of terrain cubes: %d " , app_ - > get_terrain_cube_count ( ) ) ;
ImGui : : Text ( " Number of terrain cubes: %d " , 1 ) ;
ImGui : : Separator ( ) ;
@@ -1106,4 +1129,5 @@ void imguiManager::WidgetRenderStats()
ImGui : : Columns ( 1 ) ;
ImGui : : End ( ) ;
}
}