28 #ifndef HPL_MESH_LOADER_COLLADA_H 29 #define HPL_MESH_LOADER_COLLADA_H 31 #include "common/list.h" 32 #include "hpl1/engine/graphics/VertexBuffer.h" 33 #include "hpl1/engine/math/MathTypes.h" 34 #include "hpl1/engine/physics/PhysicsJoint.h" 35 #include "hpl1/engine/resources/MeshLoader.h" 36 #include "hpl1/engine/system/MemoryManager.h" 47 class cAnimationTrack;
53 class cColliderEntity;
153 if (mlVtx == aData.mlVtx && mlNorm == aData.mlNorm && mlTex == aData.mlTex) {
170 cColladaGeometry() : mlPosArrayIdx(-1), mlNormArrayIdx(-1), mlTexArrayIdx(-1),
171 mlPosIdxNum(-1), mlNormIdxNum(-1), mlTexIdxNum(-1) {}
176 for (
int i = 0; i < (int)mvArrayVec.size(); i++) {
177 mvArrayVec[i].mvArray.clear();
189 tColladaExtraVtxListVec mvExtraVtxVec;
195 tColladaVtxArrayVec mvArrayVec;
196 tColladaVtxIndexVec mvIndices;
244 tColladaJointPairListVec mvPairs;
285 tColladaChannelVec mvChannels;
286 tColladaSamplerVec mvSamplers;
288 tColladaAnimSourceVec mvSources;
291 for (
size_t i = 0; i < mvSources.
size(); i++) {
292 if (mvSources[i].msId == asId) {
293 return &mvSources[i].mvValues;
321 cColladaNode() : mlCount(0), pParent(NULL), mvScale(1, 1, 1), mbSourceIsFile(
false) {}
339 tColladaNodeList mlstChildren;
341 tColladaTransformList mlstTransforms;
351 pNode->pParent =
this;
356 tColladaTransformListIt it = mlstTransforms.
begin();
357 for (; it != mlstTransforms.
end(); it++) {
359 if (Trans.msSid == asSid) {
370 mRoot.m_mtxTransform = cMatrixf::Identity;
371 mRoot.m_mtxWorldTransform = cMatrixf::Identity;
378 STLDeleteAll(mlstNodes);
382 STLDeleteAll(mlstNodes);
383 mRoot.mlstChildren.clear();
387 tColladaNodeListIt it = mlstNodes.begin();
388 for (; it != mlstNodes.end(); ++it) {
390 if (pNode->msId == asId || pNode->msName == asId) {
399 tColladaNodeListIt it = mlstNodes.begin();
400 for (; it != mlstNodes.end(); ++it) {
402 if (pNode->msSource == asSource) {
416 tColladaNodeList mlstNodes;
426 cMesh *LoadMesh(
const tString &asFile, tMeshLoadFlag aFlags);
427 bool SaveMesh(
cMesh *apMesh,
const tString &asFile) {
return false; }
433 bool IsSupported(
const tString asFileType);
435 void AddSupportedTypes(
tStringVec *avFileTypes);
440 tWorldLoadFlag mFlags;
446 tColladaGeometryVec &avColladaGeom);
448 void CreateHierarchyNodes(
cMesh *apMesh,
cNode3D *mpParentNode,
450 tColladaGeometryVec &avColladaGeom);
457 tColladaMaterialVec &avColladaMaterials,
458 tColladaTextureVec &avColladaTextures,
459 tColladaImageVec &avColladaImages);
463 tColladaMaterialVec &avColladaMaterials,
464 tColladaTextureVec &avColladaTextures,
465 tColladaImageVec &avColladaImages,
466 bool abCharacterCollider);
469 tColladaGeometryVec &avColladaGeometries, tColladaLightVec &avColladaLights,
470 tColladaMaterialVec &avColladaMaterials, tColladaTextureVec &avColladaTextures,
471 tColladaImageVec &avColladaImages,
cColladaScene *apColladaScene);
474 tColladaGeometryVec &avColladaGeometries, tColladaLightVec &avColladaLights,
475 tColladaMaterialVec &avColladaMaterials, tColladaTextureVec &avColladaTextures,
476 tColladaImageVec &avColladaImages);
481 void CalcLocalMatrixRec(
cBone *apBone,
cMatrixf a_mtxParentGlobal,
int alDepth);
486 eVertexBufferUsageType aUsageType);
489 bool FillStructures(
const tString &asFile,
490 tColladaImageVec *apColladaImageVec,
491 tColladaTextureVec *apColladaTextureVec,
492 tColladaMaterialVec *apColladaMaterialVec,
493 tColladaLightVec *apColladaLightVec,
494 tColladaGeometryVec *apColladaGeometryVec,
495 tColladaControllerVec *apColladaControllerVec,
496 tColladaAnimationVec *apColladaAnimVec,
500 bool SaveStructures(
const tString &asFile,
501 tColladaImageVec *apColladaImageVec,
502 tColladaTextureVec *apColladaTextureVec,
503 tColladaMaterialVec *apColladaMaterialVec,
504 tColladaLightVec *apColladaLightVec,
505 tColladaGeometryVec *apColladaGeometryVec,
506 tColladaControllerVec *apColladaControllerVec,
507 tColladaAnimationVec *apColladaAnimVec,
510 bool LoadStructures(
const tString &asFile,
511 tColladaImageVec *apColladaImageVec,
512 tColladaTextureVec *apColladaTextureVec,
513 tColladaMaterialVec *apColladaMaterialVec,
514 tColladaLightVec *apColladaLightVec,
515 tColladaGeometryVec *apColladaGeometryVec,
516 tColladaControllerVec *apColladaControllerVec,
517 tColladaAnimationVec *apColladaAnimVec,
521 tColladaLightVec *apColladaLightVec);
523 void LoadAnimations(
TiXmlElement *apRootElem, tColladaAnimationVec &avAnimations,
526 void LoadImages(
TiXmlElement *apRootElem, tColladaImageVec &avColladaImageVec);
528 void LoadTextures(
TiXmlElement *apRootElem, tColladaTextureVec &avColladaTextureVec);
530 void LoadMaterials(
TiXmlElement *apRootElem, tColladaMaterialVec &avColladaMaterialVec);
532 void LoadLights(
TiXmlElement *apRootElem, tColladaLightVec &avColladaLightVec);
537 void LoadControllers(
TiXmlElement *apRootElem, tColladaControllerVec &avColladaControllerVec,
538 tColladaGeometryVec *apColladaGeometryVec);
542 void SplitVertices(
cColladaGeometry &aGeometry, tColladaExtraVtxListVec &avExtraVtxVec,
545 void FillVertexVec(
const char *apChars,
tVector3fVec &avVtxVec,
int alElements,
int alVtxCount);
547 tString GetMaterialTextureFile(
const tString &asMaterial, tColladaMaterialVec &avColladaMaterialVec,
548 tColladaTextureVec &avColladaTextureVec,
549 tColladaImageVec &avColladaImageVec);
552 cVector3f GetVectorPosFromPtr(
float *apVec);
553 cVector3f GetVectorScaleFromPtr(
float *apVec);
558 #endif // HPL_MESH_LOADER_COLLADA_H
Definition: MeshLoaderCollada.h:228
Definition: AnimationTrack.h:40
Definition: MeshLoaderCollada.h:271
Definition: Skeleton.h:46
Definition: VertexBuffer.h:90
Definition: MeshLoaderCollada.h:168
Definition: BoundingVolume.h:71
Definition: MeshLoaderCollada.h:97
Definition: ColliderEntity.h:40
Definition: MeshLoaderCollada.h:111
Definition: Animation.h:44
iterator end()
Definition: list.h:240
iterator begin()
Definition: list.h:227
Definition: World3D.h:179
Definition: MeshLoaderCollada.h:211
size_type size() const
Definition: array.h:315
Definition: MeshLoaderCollada.h:421
Definition: MeshLoaderCollada.h:260
Definition: MeshLoaderCollada.h:251
Definition: MeshLoaderCollada.h:124
Definition: tinyxml.h:864
Definition: list_intern.h:51
Definition: MeshEntity.h:96
Definition: MeshLoader.h:60
void push_back(const t_T &element)
Definition: list.h:140
Definition: MeshLoaderCollada.h:319
Definition: MeshLoaderCollada.h:367
Definition: MeshLoaderCollada.h:60
Definition: MeshLoaderCollada.h:72
Definition: LowLevelGraphics.h:200
Definition: MeshLoaderCollada.h:84
Definition: MeshLoaderCollada.h:279