GameDirectorSB 25-01-23 Dimensions
@@ -108,7 +108,7 @@ | ||
108 | 108 | style->Colors[ImGuiCol_Button] = ImVec4(0.8f, 0.8f, 0.8f, 1); |
109 | 109 | |
110 | 110 | //--------------------------------------- Rotation |
111 | - ImGui::SameLine(0.0f); | |
111 | + ImGui::SameLine(); | |
112 | 112 | |
113 | 113 | if (Show_Rotation == 1) |
114 | 114 | { |
@@ -129,7 +129,7 @@ | ||
129 | 129 | style->Colors[ImGuiCol_Button] = ImVec4(0.8f, 0.8f, 0.8f, 1); |
130 | 130 | |
131 | 131 | //--------------------------------------- Scale |
132 | - ImGui::SameLine(0.0f); | |
132 | + ImGui::SameLine(); | |
133 | 133 | |
134 | 134 | if (Show_Scale == 1) |
135 | 135 | { |
@@ -329,7 +329,7 @@ | ||
329 | 329 | } |
330 | 330 | } |
331 | 331 | |
332 | - ImGui::SameLine(0.0f, spacingX); | |
332 | + ImGui::SameLine(); | |
333 | 333 | if (ImGui::ArrowButton("##rightXX", ImGuiDir_Right)) |
334 | 334 | { |
335 | 335 | if (App->SBC_Scene->Scene_Loaded == 1) |
@@ -389,9 +389,14 @@ | ||
389 | 389 | Ogre::Vector3 Centre = App->SBC_Object->Get_BoundingBox_World_Centre(Index); |
390 | 390 | |
391 | 391 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); |
392 | + UpDate_Physics_And_Visuals(Index); | |
392 | 393 | } |
394 | + else | |
395 | + { | |
396 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
397 | + } | |
393 | 398 | |
394 | - UpDate_Physics_And_Visuals(Index); | |
399 | + | |
395 | 400 | } |
396 | 401 | |
397 | 402 | // ************************************************************************* |
@@ -554,7 +559,7 @@ | ||
554 | 559 | } |
555 | 560 | } |
556 | 561 | |
557 | - ImGui::SameLine(0.0f, spacingX); | |
562 | + ImGui::SameLine(); | |
558 | 563 | if (ImGui::ArrowButton("##rightSX", ImGuiDir_Right)) |
559 | 564 | { |
560 | 565 | if (App->SBC_Scene->Scene_Loaded == 1) |
@@ -637,10 +642,10 @@ | ||
637 | 642 | { |
638 | 643 | App->SBC_Scene->B_Object[Index]->Phys_Body->getCollisionShape()->setLocalScaling(btVector3(Scale.x, Scale.y, Scale.z)); |
639 | 644 | App->SBC_Scene->B_Object[Index]->Physics_Scale = Scale; |
640 | - | |
645 | + UpDate_Physics_And_Visuals(Index); | |
641 | 646 | } |
642 | 647 | |
643 | - UpDate_Physics_And_Visuals(Index); | |
648 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
644 | 649 | } |
645 | 650 | |
646 | 651 | // ************************************************************************* |
@@ -710,7 +715,7 @@ | ||
710 | 715 | RotationX_Selected = 0; |
711 | 716 | RotationY_Selected = 0; |
712 | 717 | } |
713 | - // ----------------------------------------------------------------------------- Scale | |
718 | + // ----------------------------------------------------------------------------- Rotation | |
714 | 719 | |
715 | 720 | ImGui::Indent(); |
716 | 721 |
@@ -742,10 +747,12 @@ | ||
742 | 747 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
743 | 748 | |
744 | 749 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
750 | + | |
751 | + UpDate_Physics_And_Visuals(Index); | |
745 | 752 | } |
746 | - | |
747 | - UpDate_Physics_And_Visuals(Index); | |
748 | - | |
753 | + | |
754 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
755 | + | |
749 | 756 | } |
750 | 757 | |
751 | 758 | if (RotationY_Selected == 1) |
@@ -765,10 +772,12 @@ | ||
765 | 772 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
766 | 773 | |
767 | 774 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
775 | + | |
776 | + UpDate_Physics_And_Visuals(Index); | |
768 | 777 | } |
769 | - | |
770 | - UpDate_Physics_And_Visuals(Index); | |
771 | - | |
778 | + | |
779 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
780 | + | |
772 | 781 | } |
773 | 782 | |
774 | 783 | if (RotationZ_Selected == 1) |
@@ -788,16 +797,19 @@ | ||
788 | 797 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
789 | 798 | |
790 | 799 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
800 | + | |
801 | + UpDate_Physics_And_Visuals(Index); | |
791 | 802 | } |
803 | + | |
804 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
805 | + | |
792 | 806 | |
793 | - UpDate_Physics_And_Visuals(Index); | |
794 | - | |
795 | 807 | } |
796 | 808 | |
797 | 809 | } |
798 | 810 | } |
799 | 811 | |
800 | - ImGui::SameLine(0.0f, spacingX); | |
812 | + ImGui::SameLine(); | |
801 | 813 | if (ImGui::ArrowButton("##rightRX", ImGuiDir_Right)) |
802 | 814 | { |
803 | 815 | if (App->SBC_Scene->Scene_Loaded == 1) |
@@ -820,10 +832,12 @@ | ||
820 | 832 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
821 | 833 | |
822 | 834 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
835 | + | |
836 | + UpDate_Physics_And_Visuals(Index); | |
823 | 837 | } |
824 | - | |
825 | - UpDate_Physics_And_Visuals(Index); | |
826 | - | |
838 | + | |
839 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
840 | + | |
827 | 841 | } |
828 | 842 | |
829 | 843 | if (RotationY_Selected == 1) |
@@ -843,10 +857,13 @@ | ||
843 | 857 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
844 | 858 | |
845 | 859 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
860 | + | |
861 | + UpDate_Physics_And_Visuals(Index); | |
846 | 862 | } |
863 | + | |
864 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
865 | + | |
847 | 866 | |
848 | - UpDate_Physics_And_Visuals(Index); | |
849 | - | |
850 | 867 | } |
851 | 868 | |
852 | 869 | if (RotationZ_Selected == 1) |
@@ -866,10 +883,12 @@ | ||
866 | 883 | float z = App->SBC_Scene->B_Object[Index]->Physics_Quat.z; |
867 | 884 | |
868 | 885 | App->SBC_Scene->B_Object[Index]->Phys_Body->getWorldTransform().setRotation(btQuaternion(x, y, z, w)); |
886 | + | |
887 | + UpDate_Physics_And_Visuals(Index); | |
869 | 888 | } |
870 | - | |
871 | - UpDate_Physics_And_Visuals(Index); | |
872 | - | |
889 | + | |
890 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
891 | + | |
873 | 892 | } |
874 | 893 | |
875 | 894 | } |
@@ -977,12 +996,17 @@ | ||
977 | 996 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
978 | 997 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
979 | 998 | |
980 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
981 | - | |
982 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
983 | - | |
984 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
999 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1000 | + { | |
1001 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1002 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1003 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1004 | + } | |
1005 | + | |
1006 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1007 | + | |
985 | 1008 | } |
1009 | + | |
986 | 1010 | |
987 | 1011 | if (PosY_Selected == 1) |
988 | 1012 | { |
@@ -990,10 +1014,15 @@ | ||
990 | 1014 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
991 | 1015 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
992 | 1016 | |
993 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
994 | - | |
995 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
996 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1017 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1018 | + { | |
1019 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1020 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1021 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1022 | + } | |
1023 | + | |
1024 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1025 | + | |
997 | 1026 | } |
998 | 1027 | |
999 | 1028 | if (PosZ_Selected == 1) |
@@ -1002,15 +1031,20 @@ | ||
1002 | 1031 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
1003 | 1032 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
1004 | 1033 | |
1005 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1006 | - | |
1007 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1008 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1034 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1035 | + { | |
1036 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1037 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1038 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1039 | + } | |
1040 | + | |
1041 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1042 | + | |
1009 | 1043 | } |
1010 | 1044 | } |
1011 | 1045 | } |
1012 | 1046 | |
1013 | - ImGui::SameLine(0.0f, spacingX); | |
1047 | + ImGui::SameLine(); | |
1014 | 1048 | if (ImGui::ArrowButton("##rightXX", ImGuiDir_Right)) |
1015 | 1049 | { |
1016 | 1050 | if (App->SBC_Scene->Scene_Loaded == 1) |
@@ -1021,10 +1055,15 @@ | ||
1021 | 1055 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
1022 | 1056 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
1023 | 1057 | |
1024 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1025 | - | |
1026 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1027 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1058 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1059 | + { | |
1060 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1061 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1062 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1063 | + } | |
1064 | + | |
1065 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1066 | + | |
1028 | 1067 | } |
1029 | 1068 | |
1030 | 1069 | if (PosY_Selected == 1) |
@@ -1033,10 +1072,15 @@ | ||
1033 | 1072 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
1034 | 1073 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
1035 | 1074 | |
1036 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1037 | - | |
1038 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1039 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1075 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1076 | + { | |
1077 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1078 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1079 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1080 | + } | |
1081 | + | |
1082 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1083 | + | |
1040 | 1084 | } |
1041 | 1085 | |
1042 | 1086 | if (PosZ_Selected == 1) |
@@ -1045,10 +1089,16 @@ | ||
1045 | 1089 | App->SBC_Scene->B_Area[Index]->Area_Node->setPosition(Pos); |
1046 | 1090 | App->SBC_Scene->B_Area[Index]->Mesh_Pos = Pos; |
1047 | 1091 | |
1048 | - Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1049 | 1092 | |
1050 | - App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1051 | - App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1093 | + if (App->SBC_Scene->B_Object[Index]->Phys_Body) | |
1094 | + { | |
1095 | + Ogre::Vector3 Centre = App->SBC_Com_Area->Get_BoundingBox_World_Centre(Index); | |
1096 | + App->SBC_Scene->B_Area[Index]->Phys_Body->getWorldTransform().setOrigin(btVector3(Centre.x, Centre.y, Centre.z)); | |
1097 | + App->SBC_Com_Area->UpDate_Physics_And_Visuals(Index); | |
1098 | + } | |
1099 | + | |
1100 | + App->SBC_Visuals->MarkerBB_Addjust(Index); | |
1101 | + | |
1052 | 1102 | } |
1053 | 1103 | } |
1054 | 1104 | } |
@@ -1221,7 +1271,7 @@ | ||
1221 | 1271 | } |
1222 | 1272 | } |
1223 | 1273 | |
1224 | - ImGui::SameLine(0.0f, spacingX); | |
1274 | + ImGui::SameLine(); | |
1225 | 1275 | if (ImGui::ArrowButton("##rightRX", ImGuiDir_Right)) |
1226 | 1276 | { |
1227 | 1277 | if (App->SBC_Scene->Scene_Loaded == 1) |
@@ -1448,7 +1498,7 @@ | ||
1448 | 1498 | } |
1449 | 1499 | } |
1450 | 1500 | |
1451 | - ImGui::SameLine(0.0f, spacingX); | |
1501 | + ImGui::SameLine(); | |
1452 | 1502 | if (ImGui::ArrowButton("##rightSX", ImGuiDir_Right)) |
1453 | 1503 | { |
1454 | 1504 | if (App->SBC_Scene->Scene_Loaded == 1) |