added more framework code, setting up for the appropriate converter (static/animated)
This commit is contained in:
parent
2ac2dd5b61
commit
11939f9033
|
@ -81,11 +81,14 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\assimputils\assimpsceneinfo.cpp" />
|
||||
<ClCompile Include="src\convert\skeletalanimated.cpp" />
|
||||
<ClCompile Include="src\convert\static.cpp" />
|
||||
<ClCompile Include="src\main.cpp" />
|
||||
<ClCompile Include="src\utils\fileutils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\assimputils\utils.h" />
|
||||
<ClInclude Include="src\convert\convert.h" />
|
||||
<ClInclude Include="src\utils\utils.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
<ClCompile Include="src\assimputils\assimpsceneinfo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\convert\static.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\convert\skeletalanimated.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\utils\utils.h">
|
||||
|
@ -32,5 +38,8 @@
|
|||
<ClInclude Include="src\assimputils\utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\convert\convert.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
9
AssimpToMesh/src/convert/convert.h
Normal file
9
AssimpToMesh/src/convert/convert.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef __CONVERT_CONVERT_H_INCLUDED__
|
||||
#define __CONVERT_CONVERT_H_INCLUDED__
|
||||
|
||||
#include <aiScene.h>
|
||||
|
||||
void ConvertStatic(const aiScene *scene);
|
||||
void ConvertSkeletalAnimated(const aiScene *scene);
|
||||
|
||||
#endif
|
5
AssimpToMesh/src/convert/skeletalanimated.cpp
Normal file
5
AssimpToMesh/src/convert/skeletalanimated.cpp
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include "convert.h"
|
||||
|
||||
void ConvertSkeletalAnimated(const aiScene *scene)
|
||||
{
|
||||
}
|
5
AssimpToMesh/src/convert/static.cpp
Normal file
5
AssimpToMesh/src/convert/static.cpp
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include "convert.h"
|
||||
|
||||
void ConvertStatic(const aiScene *scene)
|
||||
{
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "utils/utils.h"
|
||||
#include "assimputils/utils.h"
|
||||
#include "convert/convert.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -48,7 +49,40 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
printf("Scene loaded.\n");
|
||||
printf("Animated? %d\nSkeletal? %d\nStatic? %d\n", IsSceneAnimated(scene), IsSceneSkeletal(scene), IsSceneStatic(scene));
|
||||
|
||||
if (IsSceneStatic(scene))
|
||||
{
|
||||
printf("Using static converter.\n");
|
||||
try
|
||||
{
|
||||
ConvertStatic(scene);
|
||||
}
|
||||
catch (std::exception &ex)
|
||||
{
|
||||
printf("Error: %s\n", ex.what());
|
||||
return 1;
|
||||
}
|
||||
printf("Convert complete.\n");
|
||||
}
|
||||
else if (IsSceneAnimated(scene) && IsSceneSkeletal(scene))
|
||||
{
|
||||
printf("Using skeletal animation converter.\n");
|
||||
try
|
||||
{
|
||||
ConvertSkeletalAnimated(scene);
|
||||
}
|
||||
catch (std::exception &ex)
|
||||
{
|
||||
printf("Error: %s\n", ex.what());
|
||||
return 1;
|
||||
}
|
||||
printf("Convert complete.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown scene format.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Reference in a new issue