2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
7 #ifndef CAFU_HL1_MDL_MODEL_LOADER_HPP_INCLUDED
8 #define CAFU_HL1_MDL_MODEL_LOADER_HPP_INCLUDED
15 struct StudioSequenceT
;
16 struct StudioSequenceGroupT
;
17 struct StudioTextureT
;
18 struct StudioBodyPartT
;
21 /// This class imports a HL1 (.mdl) model file into a new Cafu model.
22 class LoaderHL1mdlT
: public ModelLoaderT
26 /// The constructor for importing a HL1 (.mdl) model file into a new Cafu model.
27 /// @param FileName The name of the .mdl file to import.
28 /// @param Flags The flags to load the model with. See ModelLoaderT::FlagsT for details.
29 LoaderHL1mdlT(const std::string
& FileName
, int Flags
=NONE
);
31 void Load(ArrayT
<CafuModelT::JointT
>& Joints
, ArrayT
<CafuModelT::MeshT
>& Meshes
, ArrayT
<CafuModelT::AnimT
>& Anims
, MaterialManagerImplT
& MaterialMan
);
32 void Load(ArrayT
<CafuModelT::SkinT
>& Skins
, const MaterialManagerImplT
& MaterialMan
);
33 void Load(ArrayT
<CafuModelT::GuiFixtureT
>& GuiFixtures
) { }
34 void Load(ArrayT
<CafuModelT::ChannelT
>& Channels
) { }
35 bool Load(unsigned int Level
, CafuModelT
*& DlodModel
, float& DlodDist
) { return false; }
40 void Load(ArrayT
<CafuModelT::JointT
>& Joints
) const;
41 void Load(ArrayT
<CafuModelT::MeshT
>& Meshes
, ArrayT
<int>& MeshSkinRef
) const;
42 void Load(ArrayT
<CafuModelT::AnimT
>& Anims
) const;
44 ArrayT
<char> ModelData
; ///< Basic model data.
45 ArrayT
<char> TextureData
; ///< Texture data (if not already present in ModelData).
46 ArrayT
< ArrayT
<char> > AnimationData
; ///< Animation data ("demand loaded sequences").
47 ArrayT
<MaterialT
*> m_Materials
; ///< The MatSys materials used in the model.
48 ArrayT
<int> m_MeshSkinRef
; ///< For each mesh, the original StudioMeshT::SkinRef number.
50 // Convenient abbreviations into the above data arrays.
51 const StudioHeaderT
* StudioHeader
;
52 const StudioBoneT
* StudioBones
;
53 // const StudioBoneControllerT* StudioBoneControllers;
54 // const StudioHitBoxT* StudioHitBoxes;
55 const StudioSequenceT
* StudioSequences
;
56 const StudioSequenceGroupT
* StudioSequenceGroups
;
57 const StudioHeaderT
* StudioTextureHeader
;
58 const StudioTextureT
* StudioTextures
;
59 const StudioBodyPartT
* StudioBodyParts
;
60 // const StudioAttachmentT* StudioAttachments;
61 // const StudioTransitionT* StudioTransitions;