cstool/animeshtools.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2011-2012 Christian Van Brussel, Institute of Information 00003 and Communication Technologies, Electronics and Applied Mathematics 00004 at Universite catholique de Louvain, Belgium 00005 http://www.uclouvain.be/en-icteam.html 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public 00018 License along with this library; if not, write to the Free 00019 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 00022 #ifndef __CS_CSTOOL_ANIMESHTOOLS_H__ 00023 #define __CS_CSTOOL_ANIMESHTOOLS_H__ 00024 00029 #include "ivaria/reporter.h" 00030 00031 #include "csutil/dirtyaccessarray.h" 00032 00033 struct iGeneralFactoryState; 00034 struct iLoader; 00035 struct iObjectRegistry; 00036 00037 namespace CS { 00038 namespace Mesh { 00039 00040 struct iAnimatedMeshFactory; 00041 00045 class CS_CRYSTALSPACE_EXPORT AnimatedMeshTools 00046 { 00047 static void ReportError (const char* msg, ...) 00048 { 00049 #ifdef CS_DEBUG 00050 va_list arg; 00051 va_start (arg, msg); 00052 csReportV (iSCF::SCF->object_reg, CS_REPORTER_SEVERITY_ERROR, 00053 "crystalspace.mesh.animeshtools", msg, arg); 00054 va_end (arg); 00055 #endif 00056 } 00057 00058 static void ReportWarning (const char* msg, ...) 00059 { 00060 #ifdef CS_DEBUG 00061 va_list arg; 00062 va_start (arg, msg); 00063 csReportV (iSCF::SCF->object_reg, CS_REPORTER_SEVERITY_WARNING, 00064 "crystalspace.mesh.animeshtools", msg, arg); 00065 va_end (arg); 00066 #endif 00067 } 00068 00069 static csPtr<iAnimatedMeshFactory> LoadAnimesh (iObjectRegistry* object_reg, 00070 iLoader* loader, 00071 const char* factoryName, 00072 const char* filename); 00073 00074 struct BBoxPopulationData 00075 { 00076 csBox3 bbox; 00077 int childrenCount; 00078 size_t index1; 00079 size_t index2; 00080 size_t index3; 00081 00082 BBoxPopulationData () 00083 : childrenCount (0), index1 (0), index2 (0), index3 (0) {} 00084 }; 00085 00086 00087 public: 00088 00113 static csPtr<iAnimatedMeshFactory> ImportSplitMorphMesh 00114 (iObjectRegistry* object_reg, const char* path, const char* baseMesh, 00115 const char* factoryName, const char* meshMask = ""); 00116 00133 static bool ImportMorphMesh 00134 (iObjectRegistry* object_reg, iAnimatedMeshFactory* baseMesh, 00135 iAnimatedMeshFactory* morphMesh, const char* morphName, 00136 bool deleteMesh = true); 00137 00148 static csPtr<iAnimatedMeshFactory> ImportGeneralMesh 00149 (iObjectRegistry* object_reg, iGeneralFactoryState* genmesh, 00150 bool deleteMesh = true); 00151 00167 static void PopulateSkeletonBoundingBoxes 00168 (CS::Mesh::iAnimatedMeshFactory* animeshFactory, csBitArray* boneMask = nullptr); 00169 }; 00170 00171 } //namespace Mesh 00172 } //namespace CS 00173 00174 #endif // __CS_CSTOOL_ANIMESHTOOLS_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
