CAM: Simulator - Reset camera

This commit is contained in:
tarman3
2025-05-12 23:54:26 +03:00
parent f9d79627b5
commit da8a82628e
8 changed files with 33 additions and 14 deletions

View File

@@ -144,6 +144,7 @@
<file>gl_simulator/Path.png</file>
<file>gl_simulator/View.png</file>
<file>gl_simulator/AmbientOclusion.png</file>
<file>gl_simulator/Home.png</file>
<file>preferences/Advanced.ui</file>
<file>preferences/PathDressupHoldingTags.ui</file>
<file>preferences/PathJob.ui</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -32,23 +32,24 @@
using namespace MillSim;
GuiItem guiItems[] = {
{eGuiItemSlider, 0, 0, 40, -80, 0},
{eGuiItemSlider, 0, 0, 28, -80, 0},
{eGuiItemThumb, 0, 0, 328, -94, 1},
{eGuiItemPause, 0, 0, 40, -50, 'P', true},
{eGuiItemPlay, 0, 0, 40, -50, 'S', false},
{eGuiItemSingleStep, 0, 0, 80, -50, 'T'},
{eGuiItemSlower, 0, 0, 125, -50, ' '},
{eGuiItemFaster, 0, 0, 170, -50, 'F'},
{eGuiItemX, 0, 0, 220, -45, 0, false, 0},
{eGuiItem1, 0, 0, 242, -50, 0, false, 0},
{eGuiItem5, 0, 0, 242, -50, 0, true, 0},
{eGuiItem10, 0, 0, 242, -50, 0, true, 0},
{eGuiItem25, 0, 0, 242, -50, 0, true, 0},
{eGuiItem50, 0, 0, 242, -50, 0, true, 0},
{eGuiItemPause, 0, 0, 28, -50, 'P', true},
{eGuiItemPlay, 0, 0, 28, -50, 'S', false},
{eGuiItemSingleStep, 0, 0, 68, -50, 'T'},
{eGuiItemSlower, 0, 0, 113, -50, ' '},
{eGuiItemFaster, 0, 0, 158, -50, 'F'},
{eGuiItemX, 0, 0, 208, -45, 0, false, 0},
{eGuiItem1, 0, 0, 230, -50, 0, false, 0},
{eGuiItem5, 0, 0, 230, -50, 0, true, 0},
{eGuiItem10, 0, 0, 230, -50, 0, true, 0},
{eGuiItem25, 0, 0, 230, -50, 0, true, 0},
{eGuiItem50, 0, 0, 230, -50, 0, true, 0},
{eGuiItemRotate, 0, 0, -140, -50, ' ', false, GUIITEM_CHECKABLE},
{eGuiItemPath, 0, 0, -100, -50, 'L', false, GUIITEM_CHECKABLE},
{eGuiItemAmbientOclusion, 0, 0, -60, -50, 'A', false, GUIITEM_CHECKABLE},
{eGuiItemView, 0, 0, -180, -50, 'V', false},
{eGuiItemHome, 0, 0, -220, -50, 'H'},
};
#define NUM_GUI_ITEMS (sizeof(guiItems) / sizeof(GuiItem))
@@ -70,7 +71,8 @@ std::vector<std::string> guiFileNames = {"Slider.png",
"Rotate.png",
"Path.png",
"AmbientOclusion.png",
"View.png"};
"View.png",
"Home.png"};
void GuiDisplay::UpdateProjection()
{

View File

@@ -52,7 +52,8 @@ enum eGuiItems
eGuiItemPath,
eGuiItemAmbientOclusion,
eGuiItemView,
eGuiItemMax
eGuiItemMax,
eGuiItemHome
};
struct GuiItem

View File

@@ -516,6 +516,10 @@ void MillSimulation::HandleGuiAction(eGuiItems actionItem, bool checked)
simDisplay.updateDisplay = true;
break;
case eGuiItemHome:
simDisplay.MoveEyeCenter();
break;
default:
break;
}

View File

@@ -532,6 +532,15 @@ void SimDisplay::MoveEye(float x, float z)
updateDisplay = true;
}
void SimDisplay::MoveEyeCenter()
{
mEyeRoration = 0;
mEyeInclination = PI / 6;
mEyeX = 0;
mEyeZ = 0;
UpdateEyeFactor(0.1f);
}
void SimDisplay::UpdateEyeFactor(float factor)
{
if (mEyeDistFactor == factor) {

View File

@@ -60,6 +60,7 @@ public:
void TiltEye(float tiltStep);
void RotateEye(float rotStep);
void MoveEye(float x, float z);
void MoveEyeCenter();
void UpdateEyeFactor(float factor);
void UpdateWindowScale();

View File

@@ -42,6 +42,7 @@ TextureItem texItems[] = {
{95, 50, 0, 0},
{130, 50, 0, 0},
{170, 50, 0, 0},
{210, 50, 0, 0},
};