• R/O
  • SSH
  • HTTPS

gdx64: Commit


Commit MetaInfo

Revisión274 (tree)
Tiempo2020-01-19 06:34:19
Autorhgtterry

Log Message

GD19 Ogre 1.9 Camera Follower 180120

Cambiar Resumen

Diferencia incremental

--- GD19_OSDN/GD_ImGui.cpp (revision 273)
+++ GD19_OSDN/GD_ImGui.cpp (revision 274)
@@ -134,7 +134,9 @@
134134 Add_Log = 0;
135135
136136 BlockX = 0;
137- Lock_X = 0;
137+ BlockY = 0;
138+ BlockX = 0;
139+ Lock_Z = 0;
138140 Lock_Y = 0;
139141 Lock_Z = 0;
140142
@@ -280,36 +282,40 @@
280282 AngleFactor = App->Cl_Scene_Data->Cl_Object[1]->bt_body->getAngularFactor();
281283 ImGui::Text("AngleFactor %f %f %f", AngleFactor.getX(), AngleFactor.getY(), AngleFactor.getZ());
282284
283- // App->Cl_Scene_Data->Cl_Object[1]->bt_body->setAngularFactor().setX(0);
284-
285+ // ------------------------------ X AngularFactor
285286 ImGui::Checkbox("Lock X", &Lock_X);
286287 if (Lock_X == 1)
287288 {
288- if (BlockX == 0)
289- {
290- Toggle_X();
291- BlockX = 1;
292- }
289+ if (BlockX == 0){Toggle_X(1,0,0);BlockX = 1;}
293290 }
294291 else
295292 {
296- if (BlockX == 1)
297- {
298- Toggle_X();
299- BlockX = 0;
300- }
293+ if (BlockX == 1){Toggle_X(1,0,0);BlockX = 0;}
301294 }
302295
303- // ----------------------------------------------------------
304- ImGui::Checkbox("Lock y", &Lock_Y);
305- if (Lock_X == 1)
296+ // ------------------------------ Y AngularFactor
297+ ImGui::SameLine();
298+ ImGui::Checkbox("Lock Y", &Lock_Y);
299+ if (Lock_Y == 1)
306300 {
301+ if (BlockY == 0){Toggle_X(0, 1, 0);BlockY = 1;}
307302 }
303+ else
304+ {
305+ if (BlockY == 1){Toggle_X(0, 1, 0);BlockY = 0;}
306+ }
308307
309- ImGui::Checkbox("Lock z", &Lock_Z);
310- if (Lock_X == 1)
308+ // ------------------------------ Z AngularFactor
309+ ImGui::SameLine();
310+ ImGui::Checkbox("Lock Z", &Lock_Z);
311+ if (Lock_Z == 1)
311312 {
313+ if (BlockZ == 0){Toggle_X(0, 0, 1);BlockZ = 1;}
312314 }
315+ else
316+ {
317+ if (BlockZ == 1){Toggle_X(0, 0, 1);BlockZ = 0; }
318+ }
313319
314320 ImGui::End();
315321 }
@@ -318,17 +324,44 @@
318324 // *************************************************************************
319325 // * Toggle_X Terry Bernie *
320326 // *************************************************************************
321-void GD_ImGui::Toggle_X(void)
327+void GD_ImGui::Toggle_X(bool x, bool y, bool z)
322328 {
323- if (SetAxis.getX() == 1)
329+ if (x == 1)
324330 {
325- SetAxis.setX(0);
331+ if (SetAxis.getX() == 1)
332+ {
333+ SetAxis.setX(0);
334+ }
335+ else
336+ {
337+ SetAxis.setX(1);
338+ }
326339 }
327- else
340+
341+ if (y == 1)
328342 {
329- SetAxis.setX(1);
343+ if (SetAxis.getY() == 1)
344+ {
345+ SetAxis.setY(0);
346+ }
347+ else
348+ {
349+ SetAxis.setY(1);
350+ }
330351 }
331352
353+ if (z == 1)
354+ {
355+ if (SetAxis.getZ() == 1)
356+ {
357+ SetAxis.setZ(0);
358+ }
359+ else
360+ {
361+ SetAxis.setZ(1);
362+ }
363+ }
364+
332365 App->Cl_Scene_Data->Cl_Object[1]->bt_body->setAngularFactor(SetAxis);
333366
334367 }
--- GD19_OSDN/GD_ImGui.h (revision 273)
+++ GD19_OSDN/GD_ImGui.h (revision 274)
@@ -37,7 +37,7 @@
3737 void ImGui_Set_Colours(void);
3838 void Update_StaticData(void);
3939
40- void Toggle_X(void);
40+ void Toggle_X(bool x, bool y, bool z);
4141
4242 bool StartPos;
4343 bool Show_OgreData;
@@ -68,6 +68,8 @@
6868 int Block;
6969
7070 bool BlockX;
71+ bool BlockY;
72+ bool BlockZ;
7173 bool Lock_X;
7274 bool Lock_Y;
7375 bool Lock_Z;
Show on old repository browser