• R/O
  • SSH
  • HTTPS

gdx64: Commit


Commit MetaInfo

Revisión273 (tree)
Tiempo2020-01-19 05:54:11
Autorhgtterry

Log Message

GD19 Ogre 1.9 Camera Follower 180120

Cambiar Resumen

Diferencia incremental

--- GD19_OSDN/GD19_OSDN.cpp (revision 272)
+++ GD19_OSDN/GD19_OSDN.cpp (revision 273)
@@ -231,6 +231,19 @@
231231 return 1;
232232 }
233233
234+ case ID_CAMERA_OBJECTPROPERTIES:
235+ {
236+ if (App->Cl_ImGui->Show_Camera_Object == 1)
237+ {
238+ App->Cl_ImGui->Show_Camera_Object = 0;
239+ }
240+ else
241+ {
242+ App->Cl_ImGui->Show_Camera_Object = 1;
243+ }
244+ return 1;
245+ }
246+
234247 //------------------------- Menu Test
235248 case ID_SETTINGS_TEST:
236249 {
--- GD19_OSDN/GD_ImGui.cpp (revision 272)
+++ GD19_OSDN/GD_ImGui.cpp (revision 273)
@@ -128,10 +128,20 @@
128128 Show_ImGui_Log = 0;
129129 Show_PhysicsConsole = 0;
130130 Show_Propertities = 0;
131+ Show_Camera_Object = 0;
131132
132133 Block = 0;
133134 Add_Log = 0;
134135
136+ BlockX = 0;
137+ Lock_X = 0;
138+ Lock_Y = 0;
139+ Lock_Z = 0;
140+
141+ SetAxis.setX(1);
142+ SetAxis.setY(1);
143+ SetAxis.setZ(1);
144+
135145 }
136146
137147
@@ -176,6 +186,12 @@
176186 {
177187 ImGui_Properties();
178188 }
189+
190+ if (Show_Camera_Object == 1)
191+ {
192+ Camera_Object();
193+ }
194+
179195 }
180196
181197 // *************************************************************************
@@ -246,6 +262,79 @@
246262 }
247263
248264 // *************************************************************************
265+// * Camera_Object Terry Bernie *
266+// *************************************************************************
267+void GD_ImGui::Camera_Object(void)
268+{
269+ if (!ImGui::Begin("Camera Object", &Show_Camera_Object))
270+ {
271+ ImGui::End();
272+ }
273+ else
274+ {
275+ ImGui::Text("Follow Object Properties");
276+ ImGui::Separator();
277+
278+
279+ btVector3 AngleFactor;
280+ AngleFactor = App->Cl_Scene_Data->Cl_Object[1]->bt_body->getAngularFactor();
281+ ImGui::Text("AngleFactor %f %f %f", AngleFactor.getX(), AngleFactor.getY(), AngleFactor.getZ());
282+
283+ // App->Cl_Scene_Data->Cl_Object[1]->bt_body->setAngularFactor().setX(0);
284+
285+ ImGui::Checkbox("Lock X", &Lock_X);
286+ if (Lock_X == 1)
287+ {
288+ if (BlockX == 0)
289+ {
290+ Toggle_X();
291+ BlockX = 1;
292+ }
293+ }
294+ else
295+ {
296+ if (BlockX == 1)
297+ {
298+ Toggle_X();
299+ BlockX = 0;
300+ }
301+ }
302+
303+ // ----------------------------------------------------------
304+ ImGui::Checkbox("Lock y", &Lock_Y);
305+ if (Lock_X == 1)
306+ {
307+ }
308+
309+ ImGui::Checkbox("Lock z", &Lock_Z);
310+ if (Lock_X == 1)
311+ {
312+ }
313+
314+ ImGui::End();
315+ }
316+}
317+
318+// *************************************************************************
319+// * Toggle_X Terry Bernie *
320+// *************************************************************************
321+void GD_ImGui::Toggle_X(void)
322+{
323+ if (SetAxis.getX() == 1)
324+ {
325+ SetAxis.setX(0);
326+ }
327+ else
328+ {
329+ SetAxis.setX(1);
330+ }
331+
332+ App->Cl_Scene_Data->Cl_Object[1]->bt_body->setAngularFactor(SetAxis);
333+
334+}
335+
336+
337+// *************************************************************************
249338 // * ImGui_Properties Terry Bernie *
250339 // *************************************************************************
251340 void GD_ImGui::ImGui_Properties(void)
--- GD19_OSDN/GD_ImGui.h (revision 272)
+++ GD19_OSDN/GD_ImGui.h (revision 273)
@@ -28,6 +28,8 @@
2828 void ImGui_Dimensions(void);
2929 void Debug_Player(bool* p_open);
3030
31+ void Camera_Object(void);
32+
3133 void ShowExampleAppPropertyEditor(bool* p_open);
3234
3335 void ImGui_FileView(void);
@@ -35,6 +37,8 @@
3537 void ImGui_Set_Colours(void);
3638 void Update_StaticData(void);
3739
40+ void Toggle_X(void);
41+
3842 bool StartPos;
3943 bool Show_OgreData;
4044 bool Show_ImGui_Test;
@@ -48,6 +52,7 @@
4852 bool Show_ImGui_Preferences;
4953 bool Show_ImGui_Log;
5054 bool Show_Propertities;
55+ bool Show_Camera_Object;
5156
5257 char Edit_Category_Str[255];
5358 char Edit_Type_Str[255];
@@ -62,8 +67,15 @@
6267
6368 int Block;
6469
70+ bool BlockX;
71+ bool Lock_X;
72+ bool Lock_Y;
73+ bool Lock_Z;
74+
6575 bool Add_Log;
6676
77+ btVector3 SetAxis;
78+
6779 protected:
6880
6981 static LRESULT CALLBACK ImGui_Selection_Dlg_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
--- GD19_OSDN/Resource.h (revision 272)
+++ GD19_OSDN/Resource.h (revision 273)
@@ -406,6 +406,8 @@
406406
407407 #define ID_CAMERA_FOLLOWOBJECT 32796
408+#define ID_CAMERA_OBJECTPROPERTIES 32797 +
408409 #define IDC_STATIC -1
409410 @@ -422,7 +424,7 @@
410411
411412 #define _APS_NEXT_RESOURCE_VALUE 168
412-#define _APS_NEXT_COMMAND_VALUE 32797 +#define _APS_NEXT_COMMAND_VALUE 32798
413413 #define _APS_NEXT_CONTROL_VALUE 1079
Show on old repository browser