- Cal3D 0.11 API Reference - |
00001 //****************************************************************************// 00002 // loader.h // 00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger // 00004 //****************************************************************************// 00005 // This library is free software; you can redistribute it and/or modify it // 00006 // under the terms of the GNU Lesser General Public License as published by // 00007 // the Free Software Foundation; either version 2.1 of the License, or (at // 00008 // your option) any later version. // 00009 //****************************************************************************// 00010 00011 #ifndef CAL_LOADER_H 00012 #define CAL_LOADER_H 00013 00014 //****************************************************************************// 00015 // Includes // 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 // Forward declarations // 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 // Class declaration // 00046 //****************************************************************************// 00047 00048 /*****************************************************************************/ 00052 class CAL3D_API CalLoader 00053 { 00054 // member functions 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 //****************************************************************************//