• R/O
  • SSH
  • HTTPS

gdx64: Commit


Commit MetaInfo

Revision266 (tree)
Time2020-01-14 06:17:43
Authorhgtterry

Log Message

Basic Shapes 1.9 Textures 130120

Change Summary

Incremental Difference

--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_Ogre.cpp (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_Ogre.cpp (revision 266)
@@ -42,6 +42,7 @@
4242 OgreModel_Node =nullptr;;
4343
4444 PermResourceGroup = "PermanentResourceGroup";
45+ TempResourceGroup = "TemporyResourceGroup";
4546 }
4647
4748 GD19_Ogre::~GD19_Ogre(void)
@@ -71,6 +72,8 @@
7172 m_imgui.Init(mSceneMgr, RenderHwnd);
7273
7374 createFrameListener();
75+
76+ Ogre::ResourceGroupManager::getSingleton().createResourceGroup(TempResourceGroup);
7477
7578 return 1;
7679 }
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_Ogre.h (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_Ogre.h (revision 266)
@@ -65,6 +65,7 @@
6565
6666 Ogre::String mResourcePath;
6767
68+ Ogre::String TempResourceGroup; // Tempory Reosource Group
6869 Ogre::String PermResourceGroup; // permanent Resource Group
6970
7071 Ogre::OverlaySystem *mOverlaySystem;
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_OgreListener.cpp (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD19_OgreListener.cpp (revision 266)
@@ -223,6 +223,12 @@
223223 App->Cl_Grid->GridNode->yaw(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
224224 App->Cl_Grid->HairNode->yaw(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
225225 App->Cl19_Ogre->ModelNode->yaw(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
226+
227+ if (App->Cl19_Ogre->OgreModel_Node)
228+ {
229+ App->Cl19_Ogre->OgreModel_Node->yaw(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
230+ }
231+
226232 SetCursorPos(500, 500);
227233 }
228234 }
@@ -236,6 +242,12 @@
236242 App->Cl_Grid->GridNode->yaw(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
237243 App->Cl_Grid->HairNode->yaw(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
238244 App->Cl19_Ogre->ModelNode->yaw(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
245+
246+ if (App->Cl19_Ogre->OgreModel_Node)
247+ {
248+ App->Cl19_Ogre->OgreModel_Node->yaw(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_LOCAL);
249+ }
250+
239251 SetCursorPos(500, 500);
240252 }
241253 }
@@ -251,6 +263,12 @@
251263 App->Cl_Grid->GridNode->pitch(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
252264 App->Cl_Grid->HairNode->pitch(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
253265 App->Cl19_Ogre->ModelNode->pitch(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
266+
267+ if (App->Cl19_Ogre->OgreModel_Node)
268+ {
269+ App->Cl19_Ogre->OgreModel_Node->pitch(Ogre::Degree(-Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
270+ }
271+
254272 SetCursorPos(500, 500);
255273 }
256274 }
@@ -264,6 +282,12 @@
264282 App->Cl_Grid->GridNode->pitch(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
265283 App->Cl_Grid->HairNode->pitch(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
266284 App->Cl19_Ogre->ModelNode->pitch(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
285+
286+ if (App->Cl19_Ogre->OgreModel_Node)
287+ {
288+ App->Cl19_Ogre->OgreModel_Node->pitch(Ogre::Degree(Pl_DeltaMouse * (mMoveSensitivityMouse / 1000) * 2), Ogre::Node::TS_PARENT);
289+ }
290+
267291 SetCursorPos(500, 500);
268292 }
269293 }
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ImGui.cpp (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ImGui.cpp (revision 266)
@@ -20,6 +20,8 @@
2020 Show_OgreData = 1;
2121 Show_ImGui_Demo = 0;
2222 Show_Model_Data = 0;
23+
24+ Block_Texture_Update = 0;
2325 }
2426
2527
@@ -100,6 +102,8 @@
100102 // *************************************************************************
101103 void GD_ImGui::Model_Data(void)
102104 {
105+ static int selected_Texture = -1;
106+
103107 if (!ImGui::Begin("Model Data", &Show_Model_Data, ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize))
104108 {
105109 ImGui::End();
@@ -145,12 +149,26 @@
145149 if (ImGui::CollapsingHeader("Textures"))
146150 {
147151 ImGui::Text("Texture Count:- %i", App->Cl_Model->TextureCount);
152+
153+
148154 int Count = 0;
149155 while (Count < App->Cl_Model->GroupCount)
150156 {
151- ImGui::Text("Texture Name:- %s", App->Cl_Model->S_MeshGroup[Count]->Text_FileName);
157+ ImGui::Bullet();
158+
159+ if (ImGui::Selectable(App->Cl_Model->S_MeshGroup[Count]->Text_FileName, selected_Texture == Count))
160+ {
161+ selected_Texture = Count;
162+ Block_Texture_Update = 1;
163+ }
152164 Count++;
153165 }
166+
167+ if (Block_Texture_Update == 1)
168+ {
169+ App->Cl_Right_Groups->Update_Dialog(selected_Texture);
170+ Block_Texture_Update = 0;
171+ }
154172 }
155173
156174 ImGui::End();
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ImGui.h (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ImGui.h (revision 266)
@@ -26,5 +26,7 @@
2626 ImFont* font2;
2727 ImFont* fontDroid;
2828
29+ bool Block_Texture_Update;
30+
2931 };
3032
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_Importer.cpp (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_Importer.cpp (revision 266)
@@ -231,7 +231,7 @@
231231
232232 App->Cl_Right_Groups->Update_Dialog(0);
233233
234-/// App->Cl_ToOgre->Init_Model();
234+ App->Cl_ToOgre->Init_Model();
235235
236236 /*App->CL_Model_Data->Model_Type = LoadedFile_Assimp;
237237 App->CL_Model_Data->Render_Mode = Render_As_Assimp;
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ToOgre.cpp (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ToOgre.cpp (revision 266)
@@ -20,9 +20,10 @@
2020 // *************************************************************************
2121 void GD_ToOgre::Init_Model(void)
2222 {
23+ Create_Meterials();
2324 CreateMeshFile();
25+
2426 /*App->Cl_Model->ItsAnOgreModel = 1;
25-
2627 App->CL_Import_Ogre->Get_SkeletonInstance();
2728 App->CL_Import_Ogre->Get_BoneNames();*/
2829 }
@@ -65,6 +66,9 @@
6566
6667 /*char MatName[255];
6768 strcpy(MatName,App->S_MeshGroup[i]->MatName);*/
69+ Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(MatName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
70+ material->getTechnique(0)->getPass(0)->createTextureUnitState(App->Cl_Model->S_MeshGroup[i]->Text_FileName);
71+
6872 ogreSubMesh->setMaterialName(MatName);
6973 }
7074 //------------------------------------------
@@ -194,8 +198,15 @@
194198
195199 ogreMesh->load();
196200
197- Create_Skeleton(ogreMesh);
201+ //Create_Skeleton(ogreMesh);
198202
203+ App->Cl19_Ogre->OgreModel_Ent = App->Cl19_Ogre->mSceneMgr->createEntity("cc", ogreMesh);
204+ App->Cl19_Ogre->OgreModel_Node = App->Cl19_Ogre->mSceneMgr->getRootSceneNode()->createChildSceneNode();
205+ App->Cl19_Ogre->OgreModel_Node->attachObject(App->Cl19_Ogre->OgreModel_Ent);
206+
207+ App->Cl19_Ogre->OgreModel_Node->setPosition(0, 0, 0);
208+ App->Cl19_Ogre->OgreModel_Node->setVisible(true);
209+
199210 return 1;
200211 }
201212
@@ -325,3 +336,52 @@
325336
326337 //}
327338 }
339+
340+// *************************************************************************
341+// * Create_Meterials *
342+// *************************************************************************
343+bool GD_ToOgre::Create_Meterials()
344+{
345+
346+ Ogre::ResourceGroupManager::getSingleton().destroyResourceGroup(App->Cl19_Ogre->TempResourceGroup);
347+ Ogre::ResourceGroupManager::getSingleton().createResourceGroup(App->Cl19_Ogre->TempResourceGroup);
348+
349+ Ogre::ResourceGroupManager::getSingleton().addResourceLocation(App->Cl_Model->Texture_FolderPath,
350+ "FileSystem",
351+ App->Cl19_Ogre->TempResourceGroup);
352+
353+ try
354+ {
355+ Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
356+ }
357+ catch (...)
358+ {
359+
360+ }
361+
362+ return 1;
363+ //-------------------------------------------------------------------------
364+ char MatName[255];
365+ strcpy(MatName, "poo");
366+
367+ char Folder[1024];
368+ strcpy(Folder, App->Cl_Model->Texture_FolderPath);
369+
370+ strcat(Folder, App->Cl_Model->S_MeshGroup[0]->Text_FileName);
371+
372+ /*Ogre::Image imageOgre;
373+ imageOgre.load(Folder, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);*/
374+
375+ Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(MatName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
376+ material->getTechnique(0)->getPass(0)->createTextureUnitState(App->Cl_Model->S_MeshGroup[0]->Text_FileName);
377+
378+ int Count = 0;
379+ while (Count < App->Cl_Model->GroupCount)
380+ {
381+ Ogre::SubMesh*subMesh = App->Cl19_Ogre->OgreModel_Ent->getSubEntity(Count)->getSubMesh();
382+ subMesh->setMaterialName("poo", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
383+ Count++;
384+ }
385+
386+ return 1;
387+}
--- Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ToOgre.h (revision 265)
+++ Basic_Shapes/Ogre_Basic/Ogre_Basic/GD_ToOgre.h (revision 266)
@@ -10,6 +10,8 @@
1010 bool Create_Skeleton(Ogre::MeshPtr& mesh);
1111 void Add_TestMotion(void);
1212
13+ bool Create_Meterials();
14+
1315 Ogre::MeshPtr ogreMesh;
1416
1517 char mBoneName[255];
Show on old repository browser