• R/O
  • SSH
  • HTTPS

gd10: Commit


Commit MetaInfo

Revisão105 (tree)
Hora2019-08-09 01:00:47
Autorhgtterry

Mensagem de Log

Environment Entity 080819

Mudança Sumário

Diff

--- Equity10/GD10_Objects_New.cpp (revision 104)
+++ Equity10/GD10_Objects_New.cpp (revision 105)
@@ -770,6 +770,117 @@
770770 }
771771
772772 // *************************************************************************
773+// Add_New_EnvironmentEntity Terry Bernie *
774+// *************************************************************************
775+bool GD10_Objects_New::Add_New_EnvironmentEntity()
776+{
777+ int Index = App->GDCL_Scene_Data->ObjectCount;
778+
779+ App->GDCL_Scene_Data->CL_Object[Index] = new GD10_Objects();
780+ App->GDCL_Scene_Data->CL_Object[Index]->Object_ID = App->GDCL_Scene_Data->Object_ID_Counter;
781+
782+ // Only on newly created objects
783+ App->GDCL_Scene_Data->Object_ID_Counter++;
784+
785+ GD10_Objects* Object = App->GDCL_Scene_Data->CL_Object[Index];
786+
787+ // Create Teleport and use Player Start Position as Default
788+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0] = new Teleport_type2;
789+
790+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Name, App->GDCL_Scene_Data->S_Player_Locations[0]->Name);
791+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Player_Position = App->GDCL_Scene_Data->S_Player_Locations[0]->Current_Position;
792+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Physics_Position = App->GDCL_Scene_Data->S_Player_Locations[0]->Physics_Position;
793+ App->GDCL_Scene_Data->CL_Object[Index]->S_Teleport[0]->Physics_Rotation = App->GDCL_Scene_Data->S_Player_Locations[0]->Physics_Rotation;
794+
795+ // Create Sound
796+ App->GDCL_Scene_Data->CL_Object[Index]->HasSound = 1;
797+ App->GDCL_Scene_Data->CL_Object[Index]->S_Sounds[0] = new Sound_Type2;
798+ App->GDCL_Scene_Data->CL_Object[Index]->Set_Sound_Defaults();
799+
800+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->Entity[0].mTextItem, "Test Text");
801+
802+ App->GDCL_Scene_Data->CL_Object[Index]->Type = Enums::Bullet_Type_Static;
803+ App->GDCL_Scene_Data->CL_Object[Index]->Shape = Enums::Shape_Box;
804+
805+ strcpy(App->GDCL_Scene_Data->CL_Object[Index]->MeshName, "TeleportSend.mesh");
806+
807+ char ConNum[256];
808+ char ATest[256];
809+ char Name[256];
810+
811+ strcpy_s(Name, "Teleport_");
812+ itoa(Index, ConNum, 10);
813+ strcat(Name, ConNum);
814+
815+ strcpy_s(ATest, "GDEnt_");
816+ itoa(Index, ConNum, 10);
817+ strcat(ATest, ConNum);
818+
819+ strcpy(Object->Name, Name);
820+ strcpy(Object->MeshName, "TeleportSend.mesh");
821+ strcpy(Object->MeshName_FullPath, "TeleportSend.mesh");
822+
823+ Object->OgreEntity = App->Cl_Ogre->mSceneMgr->createEntity(ATest, "TeleportSend.mesh", App->Cl_Ogre->PermResourceGroup);
824+ Object->OgreNode = App->Cl_Ogre->mSceneMgr->getRootSceneNode()->createChildSceneNode();
825+ Object->OgreNode->attachObject(Object->OgreEntity);
826+ Object->OgreNode->scale(1, 1, 1);
827+
828+ Ogre::Vector3 Pos = Object->GetPlacement();
829+ Object->Mesh_Pos = Pos;
830+ Object->OgreNode->setPosition(Pos);
831+ //------------------
832+
833+ Ogre::Vector3 Size = App->CL10_Objects_Com->GetMesh_BB_Size(Object->OgreNode);
834+ float sx = Size.x / 2;
835+ float sy = Size.y / 2; // Size by Bounding Box
836+ float sz = Size.z / 2;
837+
838+ Object->Physics_Size = Ogre::Vector3(sx, sy, sz);
839+
840+ btCollisionShape* newRigidShape = new btBoxShape(btVector3(sx, sy, sz));
841+ newRigidShape->calculateLocalInertia(0, btVector3(0, 0, 0));
842+
843+ btTransform startTransform;
844+ startTransform.setIdentity();
845+ startTransform.setRotation(btQuaternion(0.0f, 0.0f, 0.0f, 1));
846+
847+ Ogre::Vector3 Centre = Object->Get_BoundingBox_World_Centre();
848+ Object->Physics_Pos = Ogre::Vector3(Centre.x, Centre.y, Centre.z);
849+
850+ btVector3 initialPosition(btVector3(Centre.x, Centre.y, Centre.z));
851+ startTransform.setOrigin(initialPosition);
852+
853+ btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
854+
855+ btRigidBody::btRigidBodyConstructionInfo rbInfo(0, myMotionState, newRigidShape, btVector3(0, 0, 0));
856+
857+ Object->bt_body = new btRigidBody(rbInfo);
858+ Object->bt_body->setRestitution(1.0);
859+ Object->bt_body->setFriction(1.5);
860+ Object->bt_body->setUserPointer(Object->OgreNode);
861+ Object->bt_body->setWorldTransform(startTransform);
862+
863+ Object->bt_body->setCollisionFlags(btCollisionObject::CF_KINEMATIC_OBJECT | btCollisionObject::CF_NO_CONTACT_RESPONSE);
864+
865+ Object->Usage = Enums::Usage_Teleport;
866+ Object->bt_body->setUserIndex(Enums::Usage_Teleport);
867+ Object->bt_body->setUserIndex2(Index);
868+
869+ App->GDCL_Bullet->dynamicsWorld->addRigidBody(Object->bt_body);
870+
871+ Object->Folder = Enums::Folder_Teleports;
872+ Object->Physics_Valid = 1;
873+
874+ HTREEITEM Temp = App->GDCL_FileView->Add_Environment(Object->Name, Index);
875+ Object->ListViewItem = Temp;
876+
877+ ShowWindow(App->GD_Properties_Hwnd, 1);
878+
879+ App->GDCL_Scene_Data->ObjectCount++; // Must be last line
880+ return 1;
881+}
882+
883+// *************************************************************************
773884 // Add_New_Physics_Static_Box Terry Bernie *
774885 // *************************************************************************
775886 void GD10_Objects_New::Add_New_Physics_Static_Box(bool Dynamic)
--- Equity10/GD10_Objects_New.h (revision 104)
+++ Equity10/GD10_Objects_New.h (revision 105)
@@ -36,6 +36,7 @@
3636 bool Add_New_MoveEntity();
3737 bool Add_New_SoundEntity();
3838 bool Add_New_TeleportEntity();
39+ bool Add_New_EnvironmentEntity();
3940
4041 bool Add_New_Area(void);
4142
--- Equity10/GD_FileView.cpp (revision 104)
+++ Equity10/GD_FileView.cpp (revision 105)
@@ -741,23 +741,22 @@
741741 return;
742742 }
743743
744- // Teleporters Folder on click
744+ // Environment
745745 if (!strcmp(FileView_Folder, "Environment")) // Folder
746746 {
747- App->Say("Folder Env");
748- /* if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
747+ if (App->GDCL_Scene_Data->Scene_Has_Area == 0)
749748 {
750749 App->Say("An Area or Building must be Added Firest");
751-
752750 return;
753751 }
752+
754753
755- App->CL_Dialogs->YesNo("Add Entity", "Do you want to add a new Telport Entity now");
754+ App->CL_Dialogs->YesNo("Add Entity", "Do you want to add a new Environment Entity now");
756755 bool Doit = App->GDCL_Dialogs->Canceled;
757756 if (Doit == 0)
758757 {
759- App->CL10_Objects_New->Add_New_TeleportEntity();
760- }*/
758+ App->CL10_Objects_New->Add_New_EnvironmentEntity();
759+ }
761760
762761 return;
763762 }
@@ -1123,7 +1122,32 @@
11231122
11241123 return Temp;
11251124 }
1125+
11261126 // *************************************************************************
1127+// * Add_Environment Terry Bernie *
1128+// *************************************************************************
1129+HTREEITEM GD_FileView::Add_Environment(char* SFileName, int Index)
1130+{
1131+ HWND Temp2 = GetDlgItem(App->ListPanel, IDC_TREE1);
1132+
1133+ tvinsert.hParent = GD_Environment_Folder;
1134+ tvinsert.hInsertAfter = TVI_LAST;
1135+ tvinsert.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
1136+ tvinsert.item.pszText = SFileName;
1137+ tvinsert.item.iImage = 4;
1138+ tvinsert.item.iSelectedImage = 5;
1139+ tvinsert.item.lParam = Index;
1140+ HTREEITEM Temp = (HTREEITEM)SendDlgItemMessage(App->ListPanel, IDC_TREE1, TVM_INSERTITEM, 0, (LPARAM)& tvinsert);
1141+
1142+ if (App->GDCL_Load_Scene->File_Is_Loading == 0)
1143+ {
1144+ TreeView_Select(Temp2, Temp, TVGN_CARET);
1145+ }
1146+
1147+ return Temp;
1148+}
1149+
1150+// *************************************************************************
11271151 // * Add_Collectable Terry Bernie *
11281152 // *************************************************************************
11291153 HTREEITEM GD_FileView::Add_Collectable(char* SFileName, int Index)
--- Equity10/GD_FileView.h (revision 104)
+++ Equity10/GD_FileView.h (revision 105)
@@ -57,6 +57,7 @@
5757 HTREEITEM Add_Collectable(char* SFileName, int Index);
5858 HTREEITEM Add_Teleport(char* SFileName, int Index);
5959 HTREEITEM Add_Room_Object(char* SFileName, int Index);
60+ HTREEITEM Add_Environment(char* SFileName, int Index);
6061
6162 void Add_Stock_Message(char* SFileName, int Index); // May Need HTREEITEM
6263 void Add_Stock_Sound(char* SFileName, int Index);
--- Equity10/VersionNo2.h (revision 104)
+++ Equity10/VersionNo2.h (revision 105)
@@ -39,21 +39,21 @@
3939 #ifndef _VERSIONNO__H_
4040 #define _VERSIONNO__H_
4141
42-#define VERSION_FULL 1.20.219.29
42+#define VERSION_FULL 1.20.219.33
4343
4444 #define VERSION_BASEYEAR 2019
4545 #define VERSION_DATE "2019-08-08"
46-#define VERSION_TIME "16:20:06"
46+#define VERSION_TIME "17:00:04"
4747
4848 #define VERSION_MAJOR 1
4949 #define VERSION_MINOR 20
5050 #define VERSION_BUILDNO 219
51-#define VERSION_EXTEND 29
51+#define VERSION_EXTEND 33
5252
53-#define VERSION_FILE 1,20,219,29
54-#define VERSION_PRODUCT 1,20,219,36
55-#define VERSION_FILESTR "1,20,219,29\0"
56-#define VERSION_PRODUCTSTR "1,20,219,36\0"
53+#define VERSION_FILE 1,20,219,33
54+#define VERSION_PRODUCT 1,20,219,40
55+#define VERSION_FILESTR "1,20,219,33\0"
56+#define VERSION_PRODUCTSTR "1,20,219,40\0"
5757 #define VERSION_EVERSION "0.3.4.0\0"
5858
5959 #endif
\ No newline at end of file
Show on old repository browser