• R/O
  • SSH
  • HTTPS

vima19: 提交


Commit MetaInfo

修訂566 (tree)
時間2022-03-08 01:51:31
作者hgtterry

Log Message

Equity_ME 050322 Model Class

Change Summary

差異

--- Equity_ME/Equity_ME/Base_Group.cpp (nonexistent)
+++ Equity_ME/Equity_ME/Base_Group.cpp (revision 566)
@@ -0,0 +1,12 @@
1+#include "stdafx.h"
2+#include "Base_Group.h"
3+
4+
5+Base_Group::Base_Group()
6+{
7+}
8+
9+
10+Base_Group::~Base_Group()
11+{
12+}
--- Equity_ME/Equity_ME/Base_Group.h (nonexistent)
+++ Equity_ME/Equity_ME/Base_Group.h (revision 566)
@@ -0,0 +1,8 @@
1+#pragma once
2+class Base_Group
3+{
4+public:
5+ Base_Group();
6+ ~Base_Group();
7+};
8+
--- Equity_ME/Equity_ME/ME_Assimp.cpp (revision 565)
+++ Equity_ME/Equity_ME/ME_Assimp.cpp (revision 566)
@@ -75,7 +75,7 @@
7575
7676 GetBasicInfo(scene);
7777
78-//// Create_MeshGroups(scene);
78+ Create_MeshGroups(scene);
7979
8080 //// Get_Group_VertCount(scene);
8181
@@ -127,3 +127,69 @@
127127 App->CL_Model->Set_Motion_Count(pScene->mNumAnimations);
128128 }
129129 }
130+
131+// *************************************************************************
132+// * Create_MeshGroups_ByIndex Terry Flanigan *
133+// *************************************************************************
134+void ME_Assimp::Create_MeshGroups(const aiScene* pScene)
135+{
136+
137+ int Count = 0;
138+
139+ char GroupName[255];
140+ char MaterialName[255];
141+ char GroupNum[255];
142+
143+ //App->CL_Vm_Model->S_Texture[0]->UsedTextureCount = App->CL_Vm_Model->GroupCount;
144+ //App->CL_Vm_Textures->CreateTextureInfo();
145+
146+ int mGroupCount = App->CL_Model->Get_Groupt_Count();
147+
148+ while (Count < mGroupCount)
149+ {
150+ aiMesh* mesh = pScene->mMeshes[Count];
151+
152+ App->CL_Vm_Model->Create_S_MeshGroup(Count);
153+
154+ _itoa(Count, GroupNum, 10);
155+ strcpy(GroupName, "Group_");
156+ strcat(GroupName, GroupNum);
157+ strcpy(App->CL_Vm_Model->S_MeshGroup[Count]->GroupName, GroupName);
158+
159+ strcpy(MaterialName, "Material_");
160+ strcat(MaterialName, GroupNum);
161+ strcpy(App->CL_Vm_Model->S_MeshGroup[Count]->MaterialName, MaterialName);
162+
163+ ////---------------
164+
165+ App->CL_Vm_Model->S_MeshGroup[Count]->GroupVertCount = 0;
166+ App->CL_Vm_Model->S_MeshGroup[Count]->MaterialIndex = -1;
167+
168+ App->CL_Vm_Model->S_MeshGroup[Count]->MaterialIndex = Count;//= mesh->mMaterialIndex;
169+
170+ strcpy(App->CL_Vm_Model->S_MeshGroup[Count]->Text_FileName, "No_Texture");
171+
172+ App->CL_Vm_Model->S_MeshGroup[Count]->HasBones = mesh->HasBones();
173+ App->CL_Vm_Model->S_MeshGroup[Count]->BoneCount = mesh->mNumBones;
174+
175+ /*if (App->S_MeshGroup[Count]->HasBones == 1)
176+ {
177+ mHasBones = 1;
178+ }*/
179+
180+ // Get Texture Path/Name
181+ aiString texPath;
182+ aiMaterial* mtl = pScene->mMaterials[mesh->mMaterialIndex];
183+ if (AI_SUCCESS == mtl->GetTexture(aiTextureType_DIFFUSE, 0, &texPath))
184+ {
185+ strcpy(App->CL_Vm_Model->S_MeshGroup[Count]->Text_FileName, texPath.C_Str());
186+ }
187+ else
188+ {
189+ strcpy(App->CL_Vm_Model->S_MeshGroup[Count]->Text_FileName, "No_Texture");
190+ //App->CL_Model_Data->S_MeshGroup[Count]->MaterialIndex = -1;
191+ }
192+
193+ Count++;
194+ }
195+}
--- Equity_ME/Equity_ME/ME_Assimp.h (revision 565)
+++ Equity_ME/Equity_ME/ME_Assimp.h (revision 566)
@@ -48,6 +48,7 @@
4848 void logInfo(std::string logString);
4949 void logDebug(const char* logString);
5050
51- void GetBasicInfo(const aiScene* pScene);
51+ void GetBasicInfo(const aiScene* pScene);
52+ void Create_MeshGroups(const aiScene* pScene);
5253 };
5354
--- Equity_ME/Equity_ME/ME_Model.cpp (revision 565)
+++ Equity_ME/Equity_ME/ME_Model.cpp (revision 566)
@@ -47,6 +47,14 @@
4747 }
4848
4949 // *************************************************************************
50+// * Get_Groupt_Count Terry Flanigan *
51+// *************************************************************************
52+int ME_Model::Get_Groupt_Count()
53+{
54+ return GroupCount;
55+}
56+
57+// *************************************************************************
5058 // * Set_Groupt_Count Terry Flanigan *
5159 // *************************************************************************
5260 void ME_Model::Set_Texture_Count(int Count)
--- Equity_ME/Equity_ME/ME_Model.h (revision 565)
+++ Equity_ME/Equity_ME/ME_Model.h (revision 566)
@@ -29,6 +29,8 @@
2929 ~ME_Model();
3030
3131 void Set_Groupt_Count(int Count);
32+ int Get_Groupt_Count();
33+
3234 void Set_Texture_Count(int Count);
3335 void Set_Motion_Count(int Count);
3436
Show on old repository browser