Equity_ME 050322 Model Class
@@ -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 | +} |
@@ -0,0 +1,8 @@ | ||
1 | +#pragma once | |
2 | +class Base_Group | |
3 | +{ | |
4 | +public: | |
5 | + Base_Group(); | |
6 | + ~Base_Group(); | |
7 | +}; | |
8 | + |
@@ -75,7 +75,7 @@ | ||
75 | 75 | |
76 | 76 | GetBasicInfo(scene); |
77 | 77 | |
78 | -//// Create_MeshGroups(scene); | |
78 | + Create_MeshGroups(scene); | |
79 | 79 | |
80 | 80 | //// Get_Group_VertCount(scene); |
81 | 81 |
@@ -127,3 +127,69 @@ | ||
127 | 127 | App->CL_Model->Set_Motion_Count(pScene->mNumAnimations); |
128 | 128 | } |
129 | 129 | } |
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 | +} |
@@ -48,6 +48,7 @@ | ||
48 | 48 | void logInfo(std::string logString); |
49 | 49 | void logDebug(const char* logString); |
50 | 50 | |
51 | - void GetBasicInfo(const aiScene* pScene); | |
51 | + void GetBasicInfo(const aiScene* pScene); | |
52 | + void Create_MeshGroups(const aiScene* pScene); | |
52 | 53 | }; |
53 | 54 |
@@ -47,6 +47,14 @@ | ||
47 | 47 | } |
48 | 48 | |
49 | 49 | // ************************************************************************* |
50 | +// * Get_Groupt_Count Terry Flanigan * | |
51 | +// ************************************************************************* | |
52 | +int ME_Model::Get_Groupt_Count() | |
53 | +{ | |
54 | + return GroupCount; | |
55 | +} | |
56 | + | |
57 | +// ************************************************************************* | |
50 | 58 | // * Set_Groupt_Count Terry Flanigan * |
51 | 59 | // ************************************************************************* |
52 | 60 | void ME_Model::Set_Texture_Count(int Count) |
@@ -29,6 +29,8 @@ | ||
29 | 29 | ~ME_Model(); |
30 | 30 | |
31 | 31 | void Set_Groupt_Count(int Count); |
32 | + int Get_Groupt_Count(); | |
33 | + | |
32 | 34 | void Set_Texture_Count(int Count); |
33 | 35 | void Set_Motion_Count(int Count); |
34 | 36 |