ASEParser.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2017, assimp team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the assimp team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the assimp team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file Defines the helper data structures for importing ASE files */
  34. #ifndef AI_ASEFILEHELPER_H_INC
  35. #define AI_ASEFILEHELPER_H_INC
  36. // public ASSIMP headers
  37. #include <assimp/types.h>
  38. #include <assimp/mesh.h>
  39. #include <assimp/anim.h>
  40. #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
  41. // for some helper routines like IsSpace()
  42. #include <assimp/ParsingUtils.h>
  43. #include <assimp/qnan.h>
  44. // ASE is quite similar to 3ds. We can reuse some structures
  45. #include "3DSLoader.h"
  46. namespace Assimp {
  47. namespace ASE {
  48. using namespace D3DS;
  49. // ---------------------------------------------------------------------------
  50. /** Helper structure representing an ASE material */
  51. struct Material : public D3DS::Material
  52. {
  53. //! Default constructor
  54. Material()
  55. : pcInstance(NULL)
  56. , bNeed (false)
  57. {}
  58. //! Constructor with explicit name
  59. explicit Material(const std::string &name)
  60. : D3DS::Material(name)
  61. , pcInstance(NULL)
  62. , bNeed (false)
  63. {}
  64. Material(const Material &other) = default;
  65. Material(Material &&other) = default;
  66. Material &operator=(const Material &other) = default;
  67. Material &operator=(Material &&other) = default;
  68. ~Material() {}
  69. //! Contains all sub materials of this material
  70. std::vector<Material> avSubMaterials;
  71. //! aiMaterial object
  72. aiMaterial* pcInstance;
  73. //! Can we remove this material?
  74. bool bNeed;
  75. };
  76. // ---------------------------------------------------------------------------
  77. /** Helper structure to represent an ASE file face */
  78. struct Face : public FaceWithSmoothingGroup
  79. {
  80. //! Default constructor. Initializes everything with 0
  81. Face()
  82. {
  83. mColorIndices[0] = mColorIndices[1] = mColorIndices[2] = 0;
  84. for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
  85. {
  86. amUVIndices[i][0] = amUVIndices[i][1] = amUVIndices[i][2] = 0;
  87. }
  88. iMaterial = DEFAULT_MATINDEX;
  89. iFace = 0;
  90. }
  91. //! special value to indicate that no material index has
  92. //! been assigned to a face. The default material index
  93. //! will replace this value later.
  94. static const unsigned int DEFAULT_MATINDEX = 0xFFFFFFFF;
  95. //! Indices into each list of texture coordinates
  96. unsigned int amUVIndices[AI_MAX_NUMBER_OF_TEXTURECOORDS][3];
  97. //! Index into the list of vertex colors
  98. unsigned int mColorIndices[3];
  99. //! (Sub)Material index to be assigned to this face
  100. unsigned int iMaterial;
  101. //! Index of the face. It is not specified whether it is
  102. //! a requirement of the file format that all faces are
  103. //! written in sequential order, so we have to expect this case
  104. unsigned int iFace;
  105. };
  106. // ---------------------------------------------------------------------------
  107. /** Helper structure to represent an ASE file bone */
  108. struct Bone
  109. {
  110. //! Constructor
  111. Bone()
  112. {
  113. static int iCnt = 0;
  114. // Generate a default name for the bone
  115. char szTemp[128];
  116. ::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
  117. mName = szTemp;
  118. }
  119. //! Construction from an existing name
  120. explicit Bone( const std::string& name)
  121. : mName (name)
  122. {}
  123. //! Name of the bone
  124. std::string mName;
  125. };
  126. // ---------------------------------------------------------------------------
  127. /** Helper structure to represent an ASE file bone vertex */
  128. struct BoneVertex
  129. {
  130. //! Bone and corresponding vertex weight.
  131. //! -1 for unrequired bones ....
  132. std::vector<std::pair<int,float> > mBoneWeights;
  133. //! Position of the bone vertex.
  134. //! MUST be identical to the vertex position
  135. //aiVector3D mPosition;
  136. };
  137. // ---------------------------------------------------------------------------
  138. /** Helper structure to represent an ASE file animation */
  139. struct Animation
  140. {
  141. enum Type
  142. {
  143. TRACK = 0x0,
  144. BEZIER = 0x1,
  145. TCB = 0x2
  146. } mRotationType, mScalingType, mPositionType;
  147. Animation()
  148. : mRotationType (TRACK)
  149. , mScalingType (TRACK)
  150. , mPositionType (TRACK)
  151. {}
  152. //! List of track rotation keyframes
  153. std::vector< aiQuatKey > akeyRotations;
  154. //! List of track position keyframes
  155. std::vector< aiVectorKey > akeyPositions;
  156. //! List of track scaling keyframes
  157. std::vector< aiVectorKey > akeyScaling;
  158. };
  159. // ---------------------------------------------------------------------------
  160. /** Helper structure to represent the inheritance information of an ASE node */
  161. struct InheritanceInfo
  162. {
  163. //! Default constructor
  164. InheritanceInfo()
  165. {
  166. // set the inheritance flag for all axes by default to true
  167. for (unsigned int i = 0; i < 3;++i)
  168. abInheritPosition[i] = abInheritRotation[i] = abInheritScaling[i] = true;
  169. }
  170. //! Inherit the parent's position?, axis order is x,y,z
  171. bool abInheritPosition[3];
  172. //! Inherit the parent's rotation?, axis order is x,y,z
  173. bool abInheritRotation[3];
  174. //! Inherit the parent's scaling?, axis order is x,y,z
  175. bool abInheritScaling[3];
  176. };
  177. // ---------------------------------------------------------------------------
  178. /** Represents an ASE file node. Base class for mesh, light and cameras */
  179. struct BaseNode
  180. {
  181. enum Type {Light, Camera, Mesh, Dummy} mType;
  182. //! Constructor. Creates a default name for the node
  183. explicit BaseNode(Type _mType)
  184. : mType (_mType)
  185. , mProcessed (false)
  186. {
  187. // generate a default name for the node
  188. static int iCnt = 0;
  189. char szTemp[128]; // should be sufficiently large
  190. ::ai_snprintf(szTemp, 128, "UNNAMED_%i",iCnt++);
  191. mName = szTemp;
  192. // Set mTargetPosition to qnan
  193. const ai_real qnan = get_qnan();
  194. mTargetPosition.x = qnan;
  195. }
  196. //! Name of the mesh
  197. std::string mName;
  198. //! Name of the parent of the node
  199. //! "" if there is no parent ...
  200. std::string mParent;
  201. //! Transformation matrix of the node
  202. aiMatrix4x4 mTransform;
  203. //! Target position (target lights and cameras)
  204. aiVector3D mTargetPosition;
  205. //! Specifies which axes transformations a node inherits
  206. //! from its parent ...
  207. InheritanceInfo inherit;
  208. //! Animation channels for the node
  209. Animation mAnim;
  210. //! Needed for lights and cameras: target animation channel
  211. //! Should contain position keys only.
  212. Animation mTargetAnim;
  213. bool mProcessed;
  214. };
  215. // ---------------------------------------------------------------------------
  216. /** Helper structure to represent an ASE file mesh */
  217. struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
  218. {
  219. //! Constructor.
  220. Mesh()
  221. : BaseNode (BaseNode::Mesh)
  222. , bSkip (false)
  223. {
  224. // use 2 texture vertex components by default
  225. for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
  226. this->mNumUVComponents[c] = 2;
  227. // setup the default material index by default
  228. iMaterialIndex = Face::DEFAULT_MATINDEX;
  229. }
  230. //! List of all texture coordinate sets
  231. std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
  232. //! List of all vertex color sets.
  233. std::vector<aiColor4D> mVertexColors;
  234. //! List of all bone vertices
  235. std::vector<BoneVertex> mBoneVertices;
  236. //! List of all bones
  237. std::vector<Bone> mBones;
  238. //! Material index of the mesh
  239. unsigned int iMaterialIndex;
  240. //! Number of vertex components for each UVW set
  241. unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
  242. //! used internally
  243. bool bSkip;
  244. };
  245. // ---------------------------------------------------------------------------
  246. /** Helper structure to represent an ASE light source */
  247. struct Light : public BaseNode
  248. {
  249. enum LightType
  250. {
  251. OMNI,
  252. TARGET,
  253. FREE,
  254. DIRECTIONAL
  255. };
  256. //! Constructor.
  257. Light()
  258. : BaseNode (BaseNode::Light)
  259. , mLightType (OMNI)
  260. , mColor (1.f,1.f,1.f)
  261. , mIntensity (1.f) // light is white by default
  262. , mAngle (45.f)
  263. , mFalloff (0.f)
  264. {
  265. }
  266. LightType mLightType;
  267. aiColor3D mColor;
  268. ai_real mIntensity;
  269. ai_real mAngle; // in degrees
  270. ai_real mFalloff;
  271. };
  272. // ---------------------------------------------------------------------------
  273. /** Helper structure to represent an ASE camera */
  274. struct Camera : public BaseNode
  275. {
  276. enum CameraType
  277. {
  278. FREE,
  279. TARGET
  280. };
  281. //! Constructor
  282. Camera()
  283. : BaseNode (BaseNode::Camera)
  284. , mFOV (0.75f) // in radians
  285. , mNear (0.1f)
  286. , mFar (1000.f) // could be zero
  287. , mCameraType (FREE)
  288. {
  289. }
  290. ai_real mFOV, mNear, mFar;
  291. CameraType mCameraType;
  292. };
  293. // ---------------------------------------------------------------------------
  294. /** Helper structure to represent an ASE helper object (dummy) */
  295. struct Dummy : public BaseNode
  296. {
  297. //! Constructor
  298. Dummy()
  299. : BaseNode (BaseNode::Dummy)
  300. {
  301. }
  302. };
  303. // Parameters to Parser::Parse()
  304. #define AI_ASE_NEW_FILE_FORMAT 200
  305. #define AI_ASE_OLD_FILE_FORMAT 110
  306. // Internally we're a little bit more tolerant
  307. #define AI_ASE_IS_NEW_FILE_FORMAT() (iFileFormat >= 200)
  308. #define AI_ASE_IS_OLD_FILE_FORMAT() (iFileFormat < 200)
  309. // -------------------------------------------------------------------------------
  310. /** \brief Class to parse ASE files
  311. */
  312. class Parser
  313. {
  314. private:
  315. Parser() {}
  316. public:
  317. // -------------------------------------------------------------------
  318. //! Construct a parser from a given input file which is
  319. //! guaranted to be terminated with zero.
  320. //! @param szFile Input file
  321. //! @param fileFormatDefault Assumed file format version. If the
  322. //! file format is specified in the file the new value replaces
  323. //! the default value.
  324. Parser (const char* szFile, unsigned int fileFormatDefault);
  325. // -------------------------------------------------------------------
  326. //! Parses the file into the parsers internal representation
  327. void Parse();
  328. private:
  329. // -------------------------------------------------------------------
  330. //! Parse the *SCENE block in a file
  331. void ParseLV1SceneBlock();
  332. // -------------------------------------------------------------------
  333. //! Parse the *MESH_SOFTSKINVERTS block in a file
  334. void ParseLV1SoftSkinBlock();
  335. // -------------------------------------------------------------------
  336. //! Parse the *MATERIAL_LIST block in a file
  337. void ParseLV1MaterialListBlock();
  338. // -------------------------------------------------------------------
  339. //! Parse a *<xxx>OBJECT block in a file
  340. //! \param mesh Node to be filled
  341. void ParseLV1ObjectBlock(BaseNode& mesh);
  342. // -------------------------------------------------------------------
  343. //! Parse a *MATERIAL blocks in a material list
  344. //! \param mat Material structure to be filled
  345. void ParseLV2MaterialBlock(Material& mat);
  346. // -------------------------------------------------------------------
  347. //! Parse a *NODE_TM block in a file
  348. //! \param mesh Node (!) object to be filled
  349. void ParseLV2NodeTransformBlock(BaseNode& mesh);
  350. // -------------------------------------------------------------------
  351. //! Parse a *TM_ANIMATION block in a file
  352. //! \param mesh Mesh object to be filled
  353. void ParseLV2AnimationBlock(BaseNode& mesh);
  354. void ParseLV3PosAnimationBlock(ASE::Animation& anim);
  355. void ParseLV3ScaleAnimationBlock(ASE::Animation& anim);
  356. void ParseLV3RotAnimationBlock(ASE::Animation& anim);
  357. // -------------------------------------------------------------------
  358. //! Parse a *MESH block in a file
  359. //! \param mesh Mesh object to be filled
  360. void ParseLV2MeshBlock(Mesh& mesh);
  361. // -------------------------------------------------------------------
  362. //! Parse a *LIGHT_SETTINGS block in a file
  363. //! \param light Light object to be filled
  364. void ParseLV2LightSettingsBlock(Light& light);
  365. // -------------------------------------------------------------------
  366. //! Parse a *CAMERA_SETTINGS block in a file
  367. //! \param cam Camera object to be filled
  368. void ParseLV2CameraSettingsBlock(Camera& cam);
  369. // -------------------------------------------------------------------
  370. //! Parse the *MAP_XXXXXX blocks in a material
  371. //! \param map Texture structure to be filled
  372. void ParseLV3MapBlock(Texture& map);
  373. // -------------------------------------------------------------------
  374. //! Parse a *MESH_VERTEX_LIST block in a file
  375. //! \param iNumVertices Value of *MESH_NUMVERTEX, if present.
  376. //! Otherwise zero. This is used to check the consistency of the file.
  377. //! A warning is sent to the logger if the validations fails.
  378. //! \param mesh Mesh object to be filled
  379. void ParseLV3MeshVertexListBlock(
  380. unsigned int iNumVertices,Mesh& mesh);
  381. // -------------------------------------------------------------------
  382. //! Parse a *MESH_FACE_LIST block in a file
  383. //! \param iNumFaces Value of *MESH_NUMFACES, if present.
  384. //! Otherwise zero. This is used to check the consistency of the file.
  385. //! A warning is sent to the logger if the validations fails.
  386. //! \param mesh Mesh object to be filled
  387. void ParseLV3MeshFaceListBlock(
  388. unsigned int iNumFaces,Mesh& mesh);
  389. // -------------------------------------------------------------------
  390. //! Parse a *MESH_TVERT_LIST block in a file
  391. //! \param iNumVertices Value of *MESH_NUMTVERTEX, if present.
  392. //! Otherwise zero. This is used to check the consistency of the file.
  393. //! A warning is sent to the logger if the validations fails.
  394. //! \param mesh Mesh object to be filled
  395. //! \param iChannel Output UVW channel
  396. void ParseLV3MeshTListBlock(
  397. unsigned int iNumVertices,Mesh& mesh, unsigned int iChannel = 0);
  398. // -------------------------------------------------------------------
  399. //! Parse a *MESH_TFACELIST block in a file
  400. //! \param iNumFaces Value of *MESH_NUMTVFACES, if present.
  401. //! Otherwise zero. This is used to check the consistency of the file.
  402. //! A warning is sent to the logger if the validations fails.
  403. //! \param mesh Mesh object to be filled
  404. //! \param iChannel Output UVW channel
  405. void ParseLV3MeshTFaceListBlock(
  406. unsigned int iNumFaces,Mesh& mesh, unsigned int iChannel = 0);
  407. // -------------------------------------------------------------------
  408. //! Parse an additional mapping channel
  409. //! (specified via *MESH_MAPPINGCHANNEL)
  410. //! \param iChannel Channel index to be filled
  411. //! \param mesh Mesh object to be filled
  412. void ParseLV3MappingChannel(
  413. unsigned int iChannel, Mesh& mesh);
  414. // -------------------------------------------------------------------
  415. //! Parse a *MESH_CVERTLIST block in a file
  416. //! \param iNumVertices Value of *MESH_NUMCVERTEX, if present.
  417. //! Otherwise zero. This is used to check the consistency of the file.
  418. //! A warning is sent to the logger if the validations fails.
  419. //! \param mesh Mesh object to be filled
  420. void ParseLV3MeshCListBlock(
  421. unsigned int iNumVertices, Mesh& mesh);
  422. // -------------------------------------------------------------------
  423. //! Parse a *MESH_CFACELIST block in a file
  424. //! \param iNumFaces Value of *MESH_NUMCVFACES, if present.
  425. //! Otherwise zero. This is used to check the consistency of the file.
  426. //! A warning is sent to the logger if the validations fails.
  427. //! \param mesh Mesh object to be filled
  428. void ParseLV3MeshCFaceListBlock(
  429. unsigned int iNumFaces, Mesh& mesh);
  430. // -------------------------------------------------------------------
  431. //! Parse a *MESH_NORMALS block in a file
  432. //! \param mesh Mesh object to be filled
  433. void ParseLV3MeshNormalListBlock(Mesh& mesh);
  434. // -------------------------------------------------------------------
  435. //! Parse a *MESH_WEIGHTSblock in a file
  436. //! \param mesh Mesh object to be filled
  437. void ParseLV3MeshWeightsBlock(Mesh& mesh);
  438. // -------------------------------------------------------------------
  439. //! Parse the bone list of a file
  440. //! \param mesh Mesh object to be filled
  441. //! \param iNumBones Number of bones in the mesh
  442. void ParseLV4MeshBones(unsigned int iNumBones,Mesh& mesh);
  443. // -------------------------------------------------------------------
  444. //! Parse the bone vertices list of a file
  445. //! \param mesh Mesh object to be filled
  446. //! \param iNumVertices Number of vertices to be parsed
  447. void ParseLV4MeshBonesVertices(unsigned int iNumVertices,Mesh& mesh);
  448. // -------------------------------------------------------------------
  449. //! Parse a *MESH_FACE block in a file
  450. //! \param out receive the face data
  451. void ParseLV4MeshFace(ASE::Face& out);
  452. // -------------------------------------------------------------------
  453. //! Parse a *MESH_VERT block in a file
  454. //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
  455. //! \param apOut Output buffer (3 floats)
  456. //! \param rIndexOut Output index
  457. void ParseLV4MeshFloatTriple(ai_real* apOut, unsigned int& rIndexOut);
  458. // -------------------------------------------------------------------
  459. //! Parse a *MESH_VERT block in a file
  460. //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
  461. //! \param apOut Output buffer (3 floats)
  462. void ParseLV4MeshFloatTriple(ai_real* apOut);
  463. // -------------------------------------------------------------------
  464. //! Parse a *MESH_TFACE block in a file
  465. //! (also works for MESH_CFACE)
  466. //! \param apOut Output buffer (3 ints)
  467. //! \param rIndexOut Output index
  468. void ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut);
  469. // -------------------------------------------------------------------
  470. //! Parse a *MESH_TFACE block in a file
  471. //! (also works for MESH_CFACE)
  472. //! \param apOut Output buffer (3 ints)
  473. void ParseLV4MeshLongTriple(unsigned int* apOut);
  474. // -------------------------------------------------------------------
  475. //! Parse a single float element
  476. //! \param fOut Output float
  477. void ParseLV4MeshFloat(ai_real& fOut);
  478. // -------------------------------------------------------------------
  479. //! Parse a single int element
  480. //! \param iOut Output integer
  481. void ParseLV4MeshLong(unsigned int& iOut);
  482. // -------------------------------------------------------------------
  483. //! Skip everything to the next: '*' or '\0'
  484. bool SkipToNextToken();
  485. // -------------------------------------------------------------------
  486. //! Skip the current section until the token after the closing }.
  487. //! This function handles embedded subsections correctly
  488. bool SkipSection();
  489. // -------------------------------------------------------------------
  490. //! Output a warning to the logger
  491. //! \param szWarn Warn message
  492. void LogWarning(const char* szWarn);
  493. // -------------------------------------------------------------------
  494. //! Output a message to the logger
  495. //! \param szWarn Message
  496. void LogInfo(const char* szWarn);
  497. // -------------------------------------------------------------------
  498. //! Output an error to the logger
  499. //! \param szWarn Error message
  500. AI_WONT_RETURN void LogError(const char* szWarn) AI_WONT_RETURN_SUFFIX;
  501. // -------------------------------------------------------------------
  502. //! Parse a string, enclosed in double quotation marks
  503. //! \param out Output string
  504. //! \param szName Name of the enclosing element -> used in error
  505. //! messages.
  506. //! \return false if an error occurred
  507. bool ParseString(std::string& out,const char* szName);
  508. public:
  509. //! Pointer to current data
  510. const char* filePtr;
  511. //! background color to be passed to the viewer
  512. //! QNAN if none was found
  513. aiColor3D m_clrBackground;
  514. //! Base ambient color to be passed to all materials
  515. //! QNAN if none was found
  516. aiColor3D m_clrAmbient;
  517. //! List of all materials found in the file
  518. std::vector<Material> m_vMaterials;
  519. //! List of all meshes found in the file
  520. std::vector<Mesh> m_vMeshes;
  521. //! List of all dummies found in the file
  522. std::vector<Dummy> m_vDummies;
  523. //! List of all lights found in the file
  524. std::vector<Light> m_vLights;
  525. //! List of all cameras found in the file
  526. std::vector<Camera> m_vCameras;
  527. //! Current line in the file
  528. unsigned int iLineNumber;
  529. //! First frame
  530. unsigned int iFirstFrame;
  531. //! Last frame
  532. unsigned int iLastFrame;
  533. //! Frame speed - frames per second
  534. unsigned int iFrameSpeed;
  535. //! Ticks per frame
  536. unsigned int iTicksPerFrame;
  537. //! true if the last character read was an end-line character
  538. bool bLastWasEndLine;
  539. //! File format version
  540. unsigned int iFileFormat;
  541. };
  542. } // Namespace ASE
  543. } // Namespace ASSIMP
  544. #endif // ASSIMP_BUILD_NO_3DS_IMPORTER
  545. #endif // !! include guard