00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_LOADER_H
00012 #define CAL_LOADER_H
00013
00014
00015
00016
00017
00018
00019 #include <string>
00020 #include <istream>
00021 #include "cal3d/global.h"
00022 #include "cal3d/datasource.h"
00023 #include "cal3d/coreanimation.h"
00024 #include "cal3d/corematerial.h"
00025 #include "cal3d/coremesh.h"
00026 #include "cal3d/coreskeleton.h"
00027
00028
00029
00030
00031
00032 class CalCoreModel;
00033 class CalCoreBone;
00034 class CalCoreSubmesh;
00035 class CalCoreKeyframe;
00036
00037 enum
00038 {
00039 LOADER_ROTATE_X_AXIS = 1,
00040 LOADER_INVERT_V_COORD = 2,
00041 LOADER_FLIP_WINDING = 4
00042 };
00043
00044
00045
00046
00047
00048
00052 class CAL3D_API CalLoader
00053 {
00054
00055 public:
00056 static CalCoreAnimationPtr loadCoreAnimation(const std::string& strFilename, CalCoreSkeleton *skel=NULL);
00057 static CalCoreMaterialPtr loadCoreMaterial(const std::string& strFilename);
00058 static CalCoreMeshPtr loadCoreMesh(const std::string& strFilename);
00059 static CalCoreSkeletonPtr loadCoreSkeleton(const std::string& strFilename);
00060
00061 static CalCoreAnimationPtr loadCoreAnimation(std::istream& inputStream, CalCoreSkeleton *skel=NULL);
00062 static CalCoreMaterialPtr loadCoreMaterial(std::istream& inputStream);
00063 static CalCoreMeshPtr loadCoreMesh(std::istream& inputStream);
00064 static CalCoreSkeletonPtr loadCoreSkeleton(std::istream& inputStream);
00065
00066 static CalCoreAnimationPtr loadCoreAnimation(void* inputBuffer, CalCoreSkeleton *skel=NULL);
00067 static CalCoreMaterialPtr loadCoreMaterial(void* inputBuffer);
00068 static CalCoreMeshPtr loadCoreMesh(void* inputBuffer);
00069 static CalCoreSkeletonPtr loadCoreSkeleton(void* inputBuffer);
00070
00071 static CalCoreAnimationPtr loadCoreAnimation(CalDataSource& inputSrc, CalCoreSkeleton *skel=NULL);
00072 static CalCoreMaterialPtr loadCoreMaterial(CalDataSource& inputSrc);
00073 static CalCoreMeshPtr loadCoreMesh(CalDataSource& inputSrc);
00074 static CalCoreSkeletonPtr loadCoreSkeleton(CalDataSource& inputSrc);
00075
00076 static void setLoadingMode(int flags);
00077
00078 private:
00079 static CalCoreBone *loadCoreBones(CalDataSource& dataSrc);
00080 static CalCoreKeyframe *loadCoreKeyframe(CalDataSource& dataSrc);
00081 static CalCoreSubmesh *loadCoreSubmesh(CalDataSource& dataSrc);
00082 static CalCoreTrack *loadCoreTrack(CalDataSource& dataSrc, CalCoreSkeleton *skel, float duration);
00083
00084 static CalCoreAnimationPtr loadXmlCoreAnimation(const std::string& strFilename, CalCoreSkeleton *skel=NULL);
00085 static CalCoreSkeletonPtr loadXmlCoreSkeleton(const std::string& strFilename);
00086 static CalCoreMeshPtr loadXmlCoreMesh(const std::string& strFilename);
00087 static CalCoreMaterialPtr loadXmlCoreMaterial(const std::string& strFilename);
00088
00089 static int loadingMode;
00090 };
00091
00092 #endif
00093
00094