• R/O
  • SSH
  • HTTPS

gd10: Commit


Commit MetaInfo

Revisão110 (tree)
Hora2019-08-09 03:21:39
Autorhgtterry

Mensagem de Log

Entities change Environment Change Level Change Area 080819

Mudança Sumário

Diff

--- Equity10/GD10_Objects_New.cpp (revision 109)
+++ Equity10/GD10_Objects_New.cpp (revision 110)
@@ -881,6 +881,118 @@
881881 }
882882
883883 // *************************************************************************
884+// Add_New_Area_Change Terry Bernie *
885+// *************************************************************************
886+bool GD10_Objects_New::Add_New_Area_Change()
887+{
888+ int Index = App->GDCL_Scene_Data->ObjectCount;
889+
890+ App->GDCL_Scene_Data->CL_Object[Index] = new GD10_Objects();
891+ App->GDCL_Scene_Data->CL_Object[Index]->Object_ID = App->GDCL_Scene_Data->Object_ID_Counter;
892+
893+ // Only on newly created objects
894+ App->GDCL_Scene_Data->Object_ID_Counter++;
895+
896+ GD10_Objects* Object = App->GDCL_Scene_Data->CL_Object[Index];
897+
898+ // Create Teleport and use Player Start Position as Default
899+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0] = new Teleport_type2;
900+
901+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Name, App->GDCL_Scene_Data->S_Player_Locations[0]->Name);
902+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Player_Position = App->GDCL_Scene_Data->S_Player_Locations[0]->Current_Position;
903+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Physics_Position = App->GDCL_Scene_Data->S_Player_Locations[0]->Physics_Position;
904+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Physics_Rotation = App->GDCL_Scene_Data->S_Player_Locations[0]->Physics_Rotation;
905+
906+ // Create Sound
907+ App->GDCL_Scene_Data->CL_Object[Index]->HasSound = 1;
908+ App->GDCL_Scene_Data->CL_Object[Index]->S_Sounds[0] = new Sound_Type2;
909+ App->GDCL_Scene_Data->CL_Object[Index]->Set_Sound_Defaults();
910+
911+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->Entity[0].mTextItem, "Test Text");
912+
913+ App->GDCL_Scene_Data->CL_Object[Index]->Type = Enums::Bullet_Type_Static;
914+ App->GDCL_Scene_Data->CL_Object[Index]->Shape = Enums::Shape_Box;
915+
916+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->MeshName, "TeleportSend.mesh");
917+
918+ char ConNum[256];
919+ char ATest[256];
920+ char Name[256];
921+
922+ strcpy_s(Name, "Env_");
923+ itoa(Index, ConNum, 10);
924+ strcat(Name, ConNum);
925+
926+ strcpy_s(ATest, "GDEnt_");
927+ itoa(Index, ConNum, 10);
928+ strcat(ATest, ConNum);
929+
930+ strcpy(Object->Name, Name);
931+ strcpy(Object->MeshName, "TeleportSend.mesh"); // Needs Chaning to Environment
932+ strcpy(Object->MeshName_FullPath, "TeleportSend.mesh");
933+
934+ Object->OgreEntity = App->Cl_Ogre->mSceneMgr->createEntity(ATest, "TeleportSend.mesh", App->Cl_Ogre->PermResourceGroup);
935+ Object->OgreNode = App->Cl_Ogre->mSceneMgr->getRootSceneNode()->createChildSceneNode();
936+ Object->OgreNode->attachObject(Object->OgreEntity);
937+ Object->OgreNode->scale(1, 1, 1);
938+
939+ Ogre::Vector3 Pos = Object->GetPlacement();
940+ Object->Mesh_Pos = Pos;
941+ Object->OgreNode->setPosition(Pos);
942+ //------------------
943+
944+ Ogre::Vector3 Size = App->CL10_Objects_Com->GetMesh_BB_Size(Object->OgreNode);
945+ float sx = Size.x / 2;
946+ float sy = Size.y / 2; // Size by Bounding Box
947+ float sz = Size.z / 2;
948+
949+ Object->Physics_Size = Ogre::Vector3(sx, sy, sz);
950+
951+ btCollisionShape* newRigidShape = new btBoxShape(btVector3(sx, sy, sz));
952+ newRigidShape->calculateLocalInertia(0, btVector3(0, 0, 0));
953+
954+ btTransform startTransform;
955+ startTransform.setIdentity();
956+ startTransform.setRotation(btQuaternion(0.0f, 0.0f, 0.0f, 1));
957+
958+ Ogre::Vector3 Centre = Object->Get_BoundingBox_World_Centre();
959+ Object->Physics_Pos = Ogre::Vector3(Centre.x, Centre.y, Centre.z);
960+
961+ btVector3 initialPosition(btVector3(Centre.x, Centre.y, Centre.z));
962+ startTransform.setOrigin(initialPosition);
963+
964+ btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
965+
966+ btRigidBody::btRigidBodyConstructionInfo rbInfo(0, myMotionState, newRigidShape, btVector3(0, 0, 0));
967+
968+ Object->bt_body = new btRigidBody(rbInfo);
969+ Object->bt_body->setRestitution(1.0);
970+ Object->bt_body->setFriction(1.5);
971+ Object->bt_body->setUserPointer(Object->OgreNode);
972+ Object->bt_body->setWorldTransform(startTransform);
973+
974+ Object->bt_body->setCollisionFlags(btCollisionObject::CF_KINEMATIC_OBJECT | btCollisionObject::CF_NO_CONTACT_RESPONSE);
975+
976+ Object->Usage = Enums::Usage_Teleport;
977+ Object->bt_body->setUserIndex(Enums::Usage_Teleport);
978+ Object->bt_body->setUserIndex2(Index);
979+
980+ App->GDCL_Bullet->dynamicsWorld->addRigidBody(Object->bt_body);
981+
982+ Object->Folder = Enums::Folder_Teleports;
983+ Object->Physics_Valid = 1;
984+
985+ HTREEITEM Temp = App->GDCL_FileView->Add_Environment(Object->Name, Index);
986+ Object->ListViewItem = Temp;
987+
988+ ShowWindow(App->GD_Properties_Hwnd, 1);
989+
990+ App->GDCL_Scene_Data->ObjectCount++; // Must be last line
991+ return 1;
992+}
993+
994+
995+// *************************************************************************
884996 // Add_New_Physics_Static_Box Terry Bernie *
885997 // *************************************************************************
886998 void GD10_Objects_New::Add_New_Physics_Static_Box(bool Dynamic)
--- Equity10/GD10_Objects_New.h (revision 109)
+++ Equity10/GD10_Objects_New.h (revision 110)
@@ -37,6 +37,7 @@
3737 bool Add_New_SoundEntity();
3838 bool Add_New_TeleportEntity();
3939 bool Add_New_EnvironmentEntity();
40+ bool Add_New_Area_Change();
4041
4142 bool Add_New_Area(void);
4243
--- Equity10/GD_FileView.cpp (revision 109)
+++ Equity10/GD_FileView.cpp (revision 110)
@@ -601,7 +601,9 @@
601601 return;
602602 }
603603
604- // Collectables Folder on click
604+ // *************************************************************************
605+ // * Collectables Terry Bernie *
606+ // *************************************************************************
605607 if (!strcmp(FileView_Folder, "Collectables")) // Folder
606608 {
607609 if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
@@ -670,7 +672,9 @@
670672 return;
671673 }
672674
673- // Teleporters Folder on click
675+ // *************************************************************************
676+ // * "Teleporters Terry Bernie *
677+ // *************************************************************************
674678 if (!strcmp(FileView_Folder, "Teleporters")) // Folder
675679 {
676680 if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
@@ -736,7 +740,9 @@
736740 return;
737741 }
738742
739- // Environment
743+ // *************************************************************************
744+ // * "Environment Terry Bernie *
745+ // *************************************************************************
740746 if (!strcmp(FileView_Folder, "Environment")) // Folder
741747 {
742748 if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
@@ -786,7 +792,9 @@
786792 return;
787793 }
788794
789- // Area_Change
795+ // *************************************************************************
796+ // * Area_Change Terry Bernie *
797+ // *************************************************************************
790798 if (!strcmp(FileView_Folder, "Area_Change")) // Folder
791799 {
792800 if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
@@ -795,12 +803,11 @@
795803 return;
796804 }
797805
798-
799806 App->CL_Dialogs->YesNo("Add Entity", "Do you want to add a new Area Change Entity now");
800807 bool Doit = App->GDCL_Dialogs->Canceled;
801808 if (Doit == 0)
802809 {
803- App->CL10_Objects_New->Add_New_EnvironmentEntity();
810+ App->CL10_Objects_New->Add_New_Area_Change();
804811 }
805812
806813 return;
@@ -819,7 +826,7 @@
819826 App->GDCL_Visuals->MarkerBB_Addjust(Index);
820827
821828
822- App->CL10_Properties->Edit_Category = Enums::Edit_Environment;
829+ App->CL10_Properties->Edit_Category = Enums::Edit_Area_Change;
823830 App->CL10_Properties->Current_Selected_Object = Index;
824831
825832 App->CL10_Properties->Update_Transform_Dlg();
@@ -836,7 +843,10 @@
836843 return;
837844 }
838845
839- // Change_Level
846+
847+ // *************************************************************************
848+ // * Change_Level Terry Bernie *
849+ // *************************************************************************
840850 if (!strcmp(FileView_Folder, "Change_Level")) // Folder
841851 {
842852 if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
@@ -855,7 +865,7 @@
855865
856866 return;
857867 }
858- if (!strcmp(FileView_File, "Area_Change"))
868+ if (!strcmp(FileView_File, "Change_Level"))
859869 {
860870
861871 HideRightPanes();
@@ -869,7 +879,7 @@
869879 App->GDCL_Visuals->MarkerBB_Addjust(Index);
870880
871881
872- App->CL10_Properties->Edit_Category = Enums::Edit_Environment;
882+ App->CL10_Properties->Edit_Category = Enums::Edit_Change_Level;
873883 App->CL10_Properties->Current_Selected_Object = Index;
874884
875885 App->CL10_Properties->Update_Transform_Dlg();
--- Equity10/VersionNo2.h (revision 109)
+++ Equity10/VersionNo2.h (revision 110)
@@ -39,21 +39,21 @@
3939 #ifndef _VERSIONNO__H_
4040 #define _VERSIONNO__H_
4141
42-#define VERSION_FULL 1.20.219.47
42+#define VERSION_FULL 1.20.219.51
4343
4444 #define VERSION_BASEYEAR 2019
4545 #define VERSION_DATE "2019-08-08"
46-#define VERSION_TIME "17:42:22"
46+#define VERSION_TIME "19:20:02"
4747
4848 #define VERSION_MAJOR 1
4949 #define VERSION_MINOR 20
5050 #define VERSION_BUILDNO 219
51-#define VERSION_EXTEND 47
51+#define VERSION_EXTEND 51
5252
53-#define VERSION_FILE 1,20,219,47
54-#define VERSION_PRODUCT 1,20,219,54
55-#define VERSION_FILESTR "1,20,219,47\0"
56-#define VERSION_PRODUCTSTR "1,20,219,54\0"
53+#define VERSION_FILE 1,20,219,51
54+#define VERSION_PRODUCT 1,20,219,58
55+#define VERSION_FILESTR "1,20,219,51\0"
56+#define VERSION_PRODUCTSTR "1,20,219,58\0"
5757 #define VERSION_EVERSION "0.3.4.0\0"
5858
5959 #endif
\ No newline at end of file
--- Equity10/stdafx.h (revision 109)
+++ Equity10/stdafx.h (revision 110)
@@ -108,7 +108,10 @@
108108 Edit_Sounds = 6,
109109 Edit_Collectable = 7,
110110 Edit_Teleport = 8,
111- Edit_Environment = 9
111+ Edit_Environment = 9,
112+ Edit_Area_Change = 10,
113+ Edit_Change_Level = 11
114+
112115 };
113116
114117 enum Usage
Show on old repository browser