• R/O
  • SSH
  • HTTPS

vima19: Commit


Commit MetaInfo

Revision652 (tree)
Time2022-07-06 03:35:17
Authorhgtterry

Log Message

Equity_ME 050722 Dimensions (WIP)

Change Summary

Incremental Difference

--- Equity_ME/Equity_ME/ME_Groups.cpp (revision 651)
+++ Equity_ME/Equity_ME/ME_Groups.cpp (revision 652)
@@ -81,7 +81,7 @@
8181 {
8282 case WM_INITDIALOG:
8383 {
84-
84+ SendDlgItemMessage(hDlg, IDC_STMATERIAL, WM_SETFONT, (WPARAM)App->Font_CB18, MAKELPARAM(TRUE, 0));
8585 SendDlgItemMessage(hDlg, IDC_RGGROUPNAME, WM_SETFONT, (WPARAM)App->Font_CB18, MAKELPARAM(TRUE, 0));
8686 SendDlgItemMessage(hDlg, IDC_RGTEXTURENAME, WM_SETFONT, (WPARAM)App->Font_CB18, MAKELPARAM(TRUE, 0));
8787
@@ -108,6 +108,13 @@
108108 return (UINT)App->AppBackground;
109109 }
110110
111+ if (GetDlgItem(hDlg, IDC_STMATERIAL) == (HWND)lParam)
112+ {
113+ SetTextColor((HDC)wParam, RGB(0, 0, 0));
114+ SetBkMode((HDC)wParam, TRANSPARENT);
115+ return (UINT)App->AppBackground;
116+ }
117+
111118 return FALSE;
112119 }
113120
@@ -271,6 +278,8 @@
271278 int Index = Selected_Group;
272279
273280 SetDlgItemText(RightGroups_Hwnd, IDC_RGGROUPNAME, App->CL_Model->Group[Index]->GroupName);
281+
282+ SetDlgItemText(RightGroups_Hwnd, IDC_STMATERIAL, App->CL_Model->Group[Index]->MaterialName);
274283 SetDlgItemText(RightGroups_Hwnd, IDC_RGTEXTURENAME, App->CL_Model->Group[Index]->Text_FileName);
275284
276285 RightGroups_Visable = 1;
--- Equity_ME/Equity_ME/ME_ImGui.cpp (revision 651)
+++ Equity_ME/Equity_ME/ME_ImGui.cpp (revision 652)
@@ -39,6 +39,10 @@
3939 Show_FPS = 1;
4040 StartPos = 0;
4141 Show_Dimensions = 0;
42+
43+ PosX_Selected = 1;
44+ PosY_Selected = 0;
45+ PosZ_Selected = 0;
4246 }
4347
4448
@@ -175,112 +179,127 @@
175179 }
176180 else
177181 {
182+ App->CL_Ogre->RenderListener->Show_Crosshair = 1;
183+
178184 ImGui::Text("Position");
179185 ImGui::Separator();
180186 ImGui::Spacing();
181187
182- //geVec3d pos = App->CL_Vm_Genesis3D->Actor_Position;
183- //ImGui::Text("X %.3f Y %.3f Z %.3f", pos.X, pos.Y, pos.Z);
188+ Ogre::Vector3 pos;
189+ if (App->CL_Model->Model_Type == Enums::LoadedFile_Assimp)
190+ {
191+ pos.x = App->CL_Model->S_BoundingBox[0]->Centre->x;
192+ pos.y = App->CL_Model->S_BoundingBox[0]->Centre->y;
193+ pos.z = App->CL_Model->S_BoundingBox[0]->Centre->z;
184194
195+ App->CL_Ogre->RenderListener->Hair_1PosX = pos.x;
196+ App->CL_Ogre->RenderListener->Hair_1PosY = pos.y;
197+ App->CL_Ogre->RenderListener->Hair_1PosZ = pos.z;
198+ }
199+
200+ ImGui::Indent();
201+ ImGui::Indent();
202+ ImGui::Text("X %.3f Y %.3f Z %.3f", pos.x, pos.y, pos.z);
203+
185204 ImGui::Spacing();
186205
187- // ---------------------------------------------------------------------------------- Position X
188- style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 0.0f, 1.0f, 1.00f);
189- ImGui::Text("X ");
190- style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 0.0f, 0.0f, 1.00f);
191- ImGui::SameLine();
192-
206+ // ----------------------------------------------------------------------------- Position
193207
194- float spacingPos = ImGui::GetStyle().ItemInnerSpacing.x;
208+ float spacingX = ImGui::GetStyle().ItemInnerSpacing.x;
195209 ImGui::PushButtonRepeat(true);
196-
197- if (ImGui::ArrowButton("##leftPosX", ImGuiDir_Left))
210+ if (ImGui::ArrowButton("##leftXX", ImGuiDir_Left))
198211 {
199- App->CL_Dimensions->Translate_Model(-App->CL_Dimensions->Model_X_Position, 0, 0);
200- }
212+ if (App->CL_Model->Model_Type == Enums::LoadedFile_Assimp)
213+ {
214+ if (PosX_Selected == 1)
215+ {
216+ App->CL_Dimensions->Translate_Model(-App->CL_Dimensions->Model_X_Position, 0, 0);
217+ }
201218
202- ImGui::SameLine(0.0f, spacingPos);
203- if (ImGui::ArrowButton("##rightPosX", ImGuiDir_Right))
204- {
205- App->CL_Dimensions->Translate_Model(App->CL_Dimensions->Model_X_Position, 0, 0);
219+ if (PosY_Selected == 1)
220+ {
221+ App->CL_Dimensions->Translate_Model(0, -App->CL_Dimensions->Model_X_Position, 0);
222+ }
223+
224+ if (PosZ_Selected == 1)
225+ {
226+ App->CL_Dimensions->Translate_Model(0, 0, -App->CL_Dimensions->Model_X_Position);
227+ }
228+ }
206229 }
207- ImGui::PopButtonRepeat();
208230
209- ImGui::SameLine();
210- ImGui::SetNextItemWidth(100);
211- const char* XitemsPosX[] = { "0.001","0.01","0.1","1", "2", "5", "10", "20" };
212- static int XitemPosX = 3;
213- bool ChangedPos = ImGui::Combo("Step Pos X", &XitemPosX, XitemsPosX, IM_ARRAYSIZE(XitemsPosX)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
214- if (ChangedPos == 1)
231+ ImGui::SameLine(0.0f, spacingX);
232+ if (ImGui::ArrowButton("##rightXX", ImGuiDir_Right))
215233 {
216- App->CL_Dimensions->Model_X_Position = (float)atof(XitemsPosX[XitemPosX]);
217- }
234+ if (App->CL_Model->Model_Type == Enums::LoadedFile_Assimp)
235+ {
236+ if (PosX_Selected == 1)
237+ {
238+ App->CL_Dimensions->Translate_Model(App->CL_Dimensions->Model_X_Position, 0, 0);
239+ }
218240
219- // ------------------------------------------ Position y
220- style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 1.0f, 0.0f, 1.00f);
221- ImGui::Text("Y ");
222- style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 0.0f, 0.0f, 1.00f);
223- ImGui::SameLine();
241+ if (PosY_Selected == 1)
242+ {
243+ App->CL_Dimensions->Translate_Model(0, App->CL_Dimensions->Model_X_Position, 0);
244+ }
224245
225- float spacingPos2 = ImGui::GetStyle().ItemInnerSpacing.x;
226- ImGui::PushButtonRepeat(true);
227-
228- if (ImGui::ArrowButton("##leftPosY", ImGuiDir_Left))
229- {
230- App->CL_Dimensions->Translate_Model(0,-App->CL_Dimensions->Model_Y_Position, 0);
246+ if (PosZ_Selected == 1)
247+ {
248+ App->CL_Dimensions->Translate_Model(0, 0, App->CL_Dimensions->Model_X_Position);
249+ }
250+ }
231251 }
232- ImGui::SameLine(0.0f, spacingPos2);
233- if (ImGui::ArrowButton("##rightPosY", ImGuiDir_Right))
234- {
235- App->CL_Dimensions->Translate_Model(0, App->CL_Dimensions->Model_Y_Position, 0);
236- }
237252 ImGui::PopButtonRepeat();
238253
239254 ImGui::SameLine();
240255 ImGui::SetNextItemWidth(100);
241- const char* XitemsPosY[] = { "0.001","0.01","0.1","1", "2", "5", "10", "20" };
242- static int XitemPosY = 3;
243- bool ChangedPosY = ImGui::Combo("Step Pos Y", &XitemPosY, XitemsPosY, IM_ARRAYSIZE(XitemsPosY)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
244- if (ChangedPosY == 1)
256+ const char* XitemsPosXX[] = { "0.001","0.01","0.1","1", "2", "5", "10", "20" };
257+ static int XitemPosXX = 3;
258+ bool ChangedPosX = ImGui::Combo("Step Pos", &XitemPosXX, XitemsPosXX, IM_ARRAYSIZE(XitemsPosXX)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
259+ if (ChangedPosX == 1)
245260 {
246- App->CL_Dimensions->Model_Y_Position = (float)atof(XitemsPosY[XitemPosY]);
261+ App->CL_Dimensions->Model_X_Position = (float)atof(XitemsPosXX[XitemPosXX]);
247262 }
248263
249- // ------------------------------------------ Position z
250- style->Colors[ImGuiCol_Text] = ImVec4(1.0f, 0.0f, 0.0f, 1.00f);
251- ImGui::Text("Z ");
252- style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 0.0f, 0.0f, 1.00f);
253- ImGui::SameLine();
264+ // ----------------------------------------------------------------------------- Pos X
265+ ImGui::Indent();
254266
255- float spacingPos3 = ImGui::GetStyle().ItemInnerSpacing.x;
256- ImGui::PushButtonRepeat(true);
257-
258- if (ImGui::ArrowButton("##leftPosZ", ImGuiDir_Left))
267+ style->Colors[ImGuiCol_FrameBg] = ImVec4(0.0f, 0.0f, 1.0f, 1.00f);
268+ ImGui::Checkbox("X", &PosX_Selected);
269+ if (PosX_Selected == 1)
259270 {
260- App->CL_Dimensions->Translate_Model( 0, 0, -App->CL_Dimensions->Model_Z_Position);
271+ PosY_Selected = 0;
272+ PosZ_Selected = 0;
261273 }
262- ImGui::SameLine(0.0f, spacingPos3);
263- if (ImGui::ArrowButton("##rightPosZ", ImGuiDir_Right))
274+ style->Colors[ImGuiCol_FrameBg] = ImVec4(1.0f, 1.0f, 1.0f, 1.00f);
275+ //------------------------------------------------------------------------------- Pos Y
276+ ImGui::SameLine();
277+ style->Colors[ImGuiCol_FrameBg] = ImVec4(0.0f, 1.0f, 0.0f, 1.00f);
278+ ImGui::Checkbox("Y", &PosY_Selected);
279+ style->Colors[ImGuiCol_FrameBg] = ImVec4(1.0f, 1.0f, 1.0f, 1.00f);
280+
281+ if (PosY_Selected)
264282 {
265- App->CL_Dimensions->Translate_Model(0, 0, App->CL_Dimensions->Model_Z_Position);
283+ PosX_Selected = 0;
284+ PosZ_Selected = 0;
266285 }
267- ImGui::PopButtonRepeat();
268286
287+ //------------------------------------------------------------------------------- Pos Z
269288 ImGui::SameLine();
270- ImGui::SetNextItemWidth(100);
271- const char* XitemsPosZ[] = { "0.001","0.01","0.1","1", "2", "5", "10", "20" };
272- static int XitemPosZ = 3;
273- bool ChangedPosZ = ImGui::Combo("Step Pos Z", &XitemPosZ, XitemsPosZ, IM_ARRAYSIZE(XitemsPosZ)); // Combo using proper array. You can also pass a callback to retrieve array value, no need to create/copy an array just for that.
274- if (ChangedPosZ == 1)
289+ style->Colors[ImGuiCol_FrameBg] = ImVec4(1.0f, 0.0f, 0.0f, 1.00f);
290+ ImGui::Checkbox("Z", &PosZ_Selected);
291+ if (PosZ_Selected)
275292 {
276- App->CL_Dimensions->Model_Z_Position = (float)atof(XitemsPosZ[XitemPosZ]);
293+ PosX_Selected = 0;
294+ PosY_Selected = 0;
277295 }
296+ style->Colors[ImGuiCol_FrameBg] = ImVec4(1.0f, 1.0f, 1.0f, 1.00f);
297+
278298
279299 style->Colors[ImGuiCol_Text] = ImVec4(0.0f, 0.0f, 0.0f, 1.00f);
280300
281301 ImGui::Spacing();
282- ImGui::Indent();
283- ImGui::Indent();
302+ ImGui::Unindent();
284303
285304 if (ImGui::Button("Middle of Bounding Box", ImVec2(200, 40)))
286305 {
@@ -512,7 +531,10 @@
512531 App->CL_Panels->Show_Panels(1);
513532 App->CL_TopBar->Toggle_Dimensions_Flag = 0;
514533 RedrawWindow(App->CL_TopBar->Model_TB_hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
534+
535+ App->CL_Ogre->RenderListener->Show_Crosshair = 0;
515536 }
537+
516538 ImGui::End();
517539 }
518540 }
--- Equity_ME/Equity_ME/ME_ImGui.h (revision 651)
+++ Equity_ME/Equity_ME/ME_ImGui.h (revision 652)
@@ -46,5 +46,9 @@
4646 ImFont* font1;
4747 ImFont* font2;
4848 ImFont* fontDroid;
49+
50+ bool PosX_Selected;
51+ bool PosY_Selected;
52+ bool PosZ_Selected;
4953 };
5054
--- Equity_ME/Equity_ME/ME_Render.cpp (revision 651)
+++ Equity_ME/Equity_ME/ME_Render.cpp (revision 652)
@@ -277,11 +277,11 @@
277277 // As_RenderBones();
278278 //}
279279
280- //// ---------------------- Crosshair
281- //if (Show_Crosshair == 1)
282- //{
283- // RenderCrossHair();
284- //}
280+ // ---------------------- Crosshair
281+ if (Show_Crosshair == 1)
282+ {
283+ RenderCrossHair();
284+ }
285285
286286
287287 if (depthTestEnabled)
@@ -943,8 +943,9 @@
943943 void ME_Render::RenderCrossHair(void)
944944 {
945945 glDisable(GL_TEXTURE_2D);
946- glDisable(GL_DEPTH_TEST);
946+ //glDisable(GL_DEPTH_TEST);
947947
948+ //float Length = App->CL_Model->S_BoundingBox[0]->radius * 2;
948949 float Length = 40;
949950 glLineWidth(3);
950951
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Show on old repository browser