This interface defines how to draw this component to property panel.
29 {
31
32 ImGui::Spacing();
33 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2{ 0, 3.0f });
35
36 {
38
41 if(ImGui::DragFloat(
"##", &
m_Camera->GetPerspectiveParam().fov, 0.1f, 1.0f, 179.0f,
"%.2f", ImGuiSliderFlags_AlwaysClamp))
42 {
44 }
45 ImGui::PopItemWidth();
46 ImGui::SameLine();
48 {
49 m_Camera->GetPerspectiveParam().fov = 45.0f;
51 }
52 });
53 }
54
55 {
57
60 if (ImGui::DragFloat(
"##", &
m_Camera->GetPerspectiveParam().nearPlane, 0.1f, 0.01f, 1000.0f,
"%.3f", ImGuiSliderFlags_AlwaysClamp))
61 {
63 }
64 ImGui::PopItemWidth();
65 ImGui::SameLine();
67 {
68 m_Camera->GetPerspectiveParam().nearPlane = 0.01f;
70 }
71 });
72 }
73
74 {
76
79 float aspectRatio =
m_Camera->GetPerspectiveParam().aspectRatio;
80 ImGui::DragFloat("##", &aspectRatio, 10.0f, 0.0f, 100.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
81 ImGui::PopItemWidth();
82 ImGui::SameLine();
84 });
85 }
86
87 ImGui::PopStyleVar();
88 ImGui::Spacing();
89 }
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
std::shared_ptr< Camera > m_Camera
The camera this component handled.
static FrameInfo & Get()
Get FrameInfo.
std::shared_ptr< World > m_World
The shared pointer of specific world.
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.