3DSHelper.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2019, 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 helper data structures for the import of 3DS files */
  34. #ifndef AI_3DSFILEHELPER_H_INC
  35. #define AI_3DSFILEHELPER_H_INC
  36. #include <assimp/SpatialSort.h>
  37. #include <assimp/SmoothingGroups.h>
  38. #include <assimp/StringUtils.h>
  39. #include <assimp/qnan.h>
  40. #include <assimp/material.h>
  41. #include <assimp/camera.h>
  42. #include <assimp/light.h>
  43. #include <assimp/anim.h>
  44. #include <stdio.h> //sprintf
  45. namespace Assimp {
  46. namespace D3DS {
  47. #include <assimp/Compiler/pushpack1.h>
  48. // ---------------------------------------------------------------------------
  49. /** Discreet3DS class: Helper class for loading 3ds files. Defines chunks
  50. * and data structures.
  51. */
  52. class Discreet3DS {
  53. private:
  54. Discreet3DS() AI_NO_EXCEPT {
  55. // empty
  56. }
  57. ~Discreet3DS() {
  58. // empty
  59. }
  60. public:
  61. //! data structure for a single chunk in a .3ds file
  62. struct Chunk {
  63. uint16_t Flag;
  64. uint32_t Size;
  65. } PACK_STRUCT;
  66. //! Used for shading field in material3ds structure
  67. //! From AutoDesk 3ds SDK
  68. typedef enum
  69. {
  70. // translated to gouraud shading with wireframe active
  71. Wire = 0x0,
  72. // if this material is set, no vertex normals will
  73. // be calculated for the model. Face normals + gouraud
  74. Flat = 0x1,
  75. // standard gouraud shading
  76. Gouraud = 0x2,
  77. // phong shading
  78. Phong = 0x3,
  79. // cooktorrance or anistropic phong shading ...
  80. // the exact meaning is unknown, if you know it
  81. // feel free to tell me ;-)
  82. Metal = 0x4,
  83. // required by the ASE loader
  84. Blinn = 0x5
  85. } shadetype3ds;
  86. // Flags for animated keys
  87. enum
  88. {
  89. KEY_USE_TENS = 0x1,
  90. KEY_USE_CONT = 0x2,
  91. KEY_USE_BIAS = 0x4,
  92. KEY_USE_EASE_TO = 0x8,
  93. KEY_USE_EASE_FROM = 0x10
  94. } ;
  95. enum
  96. {
  97. // ********************************************************************
  98. // Basic chunks which can be found everywhere in the file
  99. CHUNK_VERSION = 0x0002,
  100. CHUNK_RGBF = 0x0010, // float4 R; float4 G; float4 B
  101. CHUNK_RGBB = 0x0011, // int1 R; int1 G; int B
  102. // Linear color values (gamma = 2.2?)
  103. CHUNK_LINRGBF = 0x0013, // float4 R; float4 G; float4 B
  104. CHUNK_LINRGBB = 0x0012, // int1 R; int1 G; int B
  105. CHUNK_PERCENTW = 0x0030, // int2 percentage
  106. CHUNK_PERCENTF = 0x0031, // float4 percentage
  107. CHUNK_PERCENTD = 0x0032, // float8 percentage
  108. // ********************************************************************
  109. // Prj master chunk
  110. CHUNK_PRJ = 0xC23D,
  111. // MDLI master chunk
  112. CHUNK_MLI = 0x3DAA,
  113. // Primary main chunk of the .3ds file
  114. CHUNK_MAIN = 0x4D4D,
  115. // Mesh main chunk
  116. CHUNK_OBJMESH = 0x3D3D,
  117. // Specifies the background color of the .3ds file
  118. // This is passed through the material system for
  119. // viewing purposes.
  120. CHUNK_BKGCOLOR = 0x1200,
  121. // Specifies the ambient base color of the scene.
  122. // This is added to all materials in the file
  123. CHUNK_AMBCOLOR = 0x2100,
  124. // Specifies the background image for the whole scene
  125. // This value is passed through the material system
  126. // to the viewer
  127. CHUNK_BIT_MAP = 0x1100,
  128. CHUNK_BIT_MAP_EXISTS = 0x1101,
  129. // ********************************************************************
  130. // Viewport related stuff. Ignored
  131. CHUNK_DEFAULT_VIEW = 0x3000,
  132. CHUNK_VIEW_TOP = 0x3010,
  133. CHUNK_VIEW_BOTTOM = 0x3020,
  134. CHUNK_VIEW_LEFT = 0x3030,
  135. CHUNK_VIEW_RIGHT = 0x3040,
  136. CHUNK_VIEW_FRONT = 0x3050,
  137. CHUNK_VIEW_BACK = 0x3060,
  138. CHUNK_VIEW_USER = 0x3070,
  139. CHUNK_VIEW_CAMERA = 0x3080,
  140. // ********************************************************************
  141. // Mesh chunks
  142. CHUNK_OBJBLOCK = 0x4000,
  143. CHUNK_TRIMESH = 0x4100,
  144. CHUNK_VERTLIST = 0x4110,
  145. CHUNK_VERTFLAGS = 0x4111,
  146. CHUNK_FACELIST = 0x4120,
  147. CHUNK_FACEMAT = 0x4130,
  148. CHUNK_MAPLIST = 0x4140,
  149. CHUNK_SMOOLIST = 0x4150,
  150. CHUNK_TRMATRIX = 0x4160,
  151. CHUNK_MESHCOLOR = 0x4165,
  152. CHUNK_TXTINFO = 0x4170,
  153. CHUNK_LIGHT = 0x4600,
  154. CHUNK_CAMERA = 0x4700,
  155. CHUNK_HIERARCHY = 0x4F00,
  156. // Specifies the global scaling factor. This is applied
  157. // to the root node's transformation matrix
  158. CHUNK_MASTER_SCALE = 0x0100,
  159. // ********************************************************************
  160. // Material chunks
  161. CHUNK_MAT_MATERIAL = 0xAFFF,
  162. // asciiz containing the name of the material
  163. CHUNK_MAT_MATNAME = 0xA000,
  164. CHUNK_MAT_AMBIENT = 0xA010, // followed by color chunk
  165. CHUNK_MAT_DIFFUSE = 0xA020, // followed by color chunk
  166. CHUNK_MAT_SPECULAR = 0xA030, // followed by color chunk
  167. // Specifies the shininess of the material
  168. // followed by percentage chunk
  169. CHUNK_MAT_SHININESS = 0xA040,
  170. CHUNK_MAT_SHININESS_PERCENT = 0xA041 ,
  171. // Specifies the shading mode to be used
  172. // followed by a short
  173. CHUNK_MAT_SHADING = 0xA100,
  174. // NOTE: Emissive color (self illumination) seems not
  175. // to be a color but a single value, type is unknown.
  176. // Make the parser accept both of them.
  177. // followed by percentage chunk (?)
  178. CHUNK_MAT_SELF_ILLUM = 0xA080,
  179. // Always followed by percentage chunk (?)
  180. CHUNK_MAT_SELF_ILPCT = 0xA084,
  181. // Always followed by percentage chunk
  182. CHUNK_MAT_TRANSPARENCY = 0xA050,
  183. // Diffuse texture channel 0
  184. CHUNK_MAT_TEXTURE = 0xA200,
  185. // Contains opacity information for each texel
  186. CHUNK_MAT_OPACMAP = 0xA210,
  187. // Contains a reflection map to be used to reflect
  188. // the environment. This is partially supported.
  189. CHUNK_MAT_REFLMAP = 0xA220,
  190. // Self Illumination map (emissive colors)
  191. CHUNK_MAT_SELFIMAP = 0xA33d,
  192. // Bumpmap. Not specified whether it is a heightmap
  193. // or a normal map. Assme it is a heightmap since
  194. // artist normally prefer this format.
  195. CHUNK_MAT_BUMPMAP = 0xA230,
  196. // Specular map. Seems to influence the specular color
  197. CHUNK_MAT_SPECMAP = 0xA204,
  198. // Holds shininess data.
  199. CHUNK_MAT_MAT_SHINMAP = 0xA33C,
  200. // Scaling in U/V direction.
  201. // (need to gen separate UV coordinate set
  202. // and do this by hand)
  203. CHUNK_MAT_MAP_USCALE = 0xA354,
  204. CHUNK_MAT_MAP_VSCALE = 0xA356,
  205. // Translation in U/V direction.
  206. // (need to gen separate UV coordinate set
  207. // and do this by hand)
  208. CHUNK_MAT_MAP_UOFFSET = 0xA358,
  209. CHUNK_MAT_MAP_VOFFSET = 0xA35a,
  210. // UV-coordinates rotation around the z-axis
  211. // Assumed to be in radians.
  212. CHUNK_MAT_MAP_ANG = 0xA35C,
  213. // Tiling flags for 3DS files
  214. CHUNK_MAT_MAP_TILING = 0xa351,
  215. // Specifies the file name of a texture
  216. CHUNK_MAPFILE = 0xA300,
  217. // Specifies whether a materail requires two-sided rendering
  218. CHUNK_MAT_TWO_SIDE = 0xA081,
  219. // ********************************************************************
  220. // Main keyframer chunk. Contains translation/rotation/scaling data
  221. CHUNK_KEYFRAMER = 0xB000,
  222. // Supported sub chunks
  223. CHUNK_TRACKINFO = 0xB002,
  224. CHUNK_TRACKOBJNAME = 0xB010,
  225. CHUNK_TRACKDUMMYOBJNAME = 0xB011,
  226. CHUNK_TRACKPIVOT = 0xB013,
  227. CHUNK_TRACKPOS = 0xB020,
  228. CHUNK_TRACKROTATE = 0xB021,
  229. CHUNK_TRACKSCALE = 0xB022,
  230. // ********************************************************************
  231. // Keyframes for various other stuff in the file
  232. // Partially ignored
  233. CHUNK_AMBIENTKEY = 0xB001,
  234. CHUNK_TRACKMORPH = 0xB026,
  235. CHUNK_TRACKHIDE = 0xB029,
  236. CHUNK_OBJNUMBER = 0xB030,
  237. CHUNK_TRACKCAMERA = 0xB003,
  238. CHUNK_TRACKFOV = 0xB023,
  239. CHUNK_TRACKROLL = 0xB024,
  240. CHUNK_TRACKCAMTGT = 0xB004,
  241. CHUNK_TRACKLIGHT = 0xB005,
  242. CHUNK_TRACKLIGTGT = 0xB006,
  243. CHUNK_TRACKSPOTL = 0xB007,
  244. CHUNK_FRAMES = 0xB008,
  245. // ********************************************************************
  246. // light sub-chunks
  247. CHUNK_DL_OFF = 0x4620,
  248. CHUNK_DL_OUTER_RANGE = 0x465A,
  249. CHUNK_DL_INNER_RANGE = 0x4659,
  250. CHUNK_DL_MULTIPLIER = 0x465B,
  251. CHUNK_DL_EXCLUDE = 0x4654,
  252. CHUNK_DL_ATTENUATE = 0x4625,
  253. CHUNK_DL_SPOTLIGHT = 0x4610,
  254. // camera sub-chunks
  255. CHUNK_CAM_RANGES = 0x4720
  256. };
  257. };
  258. // ---------------------------------------------------------------------------
  259. /** Helper structure representing a 3ds mesh face */
  260. struct Face : public FaceWithSmoothingGroup
  261. {
  262. };
  263. // ---------------------------------------------------------------------------
  264. /** Helper structure representing a texture */
  265. struct Texture {
  266. //! Default constructor
  267. Texture() AI_NO_EXCEPT
  268. : mOffsetU (0.0)
  269. , mOffsetV (0.0)
  270. , mScaleU (1.0)
  271. , mScaleV (1.0)
  272. , mRotation (0.0)
  273. , mMapMode (aiTextureMapMode_Wrap)
  274. , bPrivate()
  275. , iUVSrc (0) {
  276. mTextureBlend = get_qnan();
  277. }
  278. //! Specifies the blend factor for the texture
  279. ai_real mTextureBlend;
  280. //! Specifies the filename of the texture
  281. std::string mMapName;
  282. //! Specifies texture coordinate offsets/scaling/rotations
  283. ai_real mOffsetU;
  284. ai_real mOffsetV;
  285. ai_real mScaleU;
  286. ai_real mScaleV;
  287. ai_real mRotation;
  288. //! Specifies the mapping mode to be used for the texture
  289. aiTextureMapMode mMapMode;
  290. //! Used internally
  291. bool bPrivate;
  292. int iUVSrc;
  293. };
  294. #include <assimp/Compiler/poppack1.h>
  295. // ---------------------------------------------------------------------------
  296. /** Helper structure representing a 3ds material */
  297. struct Material
  298. {
  299. //! Default constructor has been deleted
  300. Material() = delete;
  301. //! Constructor with explicit name
  302. explicit Material(const std::string &name)
  303. : mName(name)
  304. , mDiffuse ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) // FIX ... we won't want object to be black
  305. , mSpecularExponent ( ai_real( 0.0 ) )
  306. , mShininessStrength ( ai_real( 1.0 ) )
  307. , mShading(Discreet3DS::Gouraud)
  308. , mTransparency ( ai_real( 1.0 ) )
  309. , mBumpHeight ( ai_real( 1.0 ) )
  310. , mTwoSided (false)
  311. {
  312. }
  313. Material(const Material &other) = default;
  314. Material &operator=(const Material &other) = default;
  315. //! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
  316. Material(Material &&other) AI_NO_EXCEPT
  317. : mName(std::move(other.mName))
  318. , mDiffuse(std::move(other.mDiffuse))
  319. , mSpecularExponent(std::move(other.mSpecularExponent))
  320. , mShininessStrength(std::move(other.mShininessStrength))
  321. , mSpecular(std::move(other.mSpecular))
  322. , mAmbient(std::move(other.mAmbient))
  323. , mShading(std::move(other.mShading))
  324. , mTransparency(std::move(other.mTransparency))
  325. , sTexDiffuse(std::move(other.sTexDiffuse))
  326. , sTexOpacity(std::move(other.sTexOpacity))
  327. , sTexSpecular(std::move(other.sTexSpecular))
  328. , sTexReflective(std::move(other.sTexReflective))
  329. , sTexBump(std::move(other.sTexBump))
  330. , sTexEmissive(std::move(other.sTexEmissive))
  331. , sTexShininess(std::move(other.sTexShininess))
  332. , mBumpHeight(std::move(other.mBumpHeight))
  333. , mEmissive(std::move(other.mEmissive))
  334. , sTexAmbient(std::move(other.sTexAmbient))
  335. , mTwoSided(std::move(other.mTwoSided))
  336. {
  337. }
  338. Material &operator=(Material &&other) AI_NO_EXCEPT {
  339. if (this == &other) {
  340. return *this;
  341. }
  342. mName = std::move(other.mName);
  343. mDiffuse = std::move(other.mDiffuse);
  344. mSpecularExponent = std::move(other.mSpecularExponent);
  345. mShininessStrength = std::move(other.mShininessStrength),
  346. mSpecular = std::move(other.mSpecular);
  347. mAmbient = std::move(other.mAmbient);
  348. mShading = std::move(other.mShading);
  349. mTransparency = std::move(other.mTransparency);
  350. sTexDiffuse = std::move(other.sTexDiffuse);
  351. sTexOpacity = std::move(other.sTexOpacity);
  352. sTexSpecular = std::move(other.sTexSpecular);
  353. sTexReflective = std::move(other.sTexReflective);
  354. sTexBump = std::move(other.sTexBump);
  355. sTexEmissive = std::move(other.sTexEmissive);
  356. sTexShininess = std::move(other.sTexShininess);
  357. mBumpHeight = std::move(other.mBumpHeight);
  358. mEmissive = std::move(other.mEmissive);
  359. sTexAmbient = std::move(other.sTexAmbient);
  360. mTwoSided = std::move(other.mTwoSided);
  361. return *this;
  362. }
  363. virtual ~Material() {}
  364. //! Name of the material
  365. std::string mName;
  366. //! Diffuse color of the material
  367. aiColor3D mDiffuse;
  368. //! Specular exponent
  369. ai_real mSpecularExponent;
  370. //! Shininess strength, in percent
  371. ai_real mShininessStrength;
  372. //! Specular color of the material
  373. aiColor3D mSpecular;
  374. //! Ambient color of the material
  375. aiColor3D mAmbient;
  376. //! Shading type to be used
  377. Discreet3DS::shadetype3ds mShading;
  378. //! Opacity of the material
  379. ai_real mTransparency;
  380. //! Diffuse texture channel
  381. Texture sTexDiffuse;
  382. //! Opacity texture channel
  383. Texture sTexOpacity;
  384. //! Specular texture channel
  385. Texture sTexSpecular;
  386. //! Reflective texture channel
  387. Texture sTexReflective;
  388. //! Bump texture channel
  389. Texture sTexBump;
  390. //! Emissive texture channel
  391. Texture sTexEmissive;
  392. //! Shininess texture channel
  393. Texture sTexShininess;
  394. //! Scaling factor for the bump values
  395. ai_real mBumpHeight;
  396. //! Emissive color
  397. aiColor3D mEmissive;
  398. //! Ambient texture channel
  399. //! (used by the ASE format)
  400. Texture sTexAmbient;
  401. //! True if the material must be rendered from two sides
  402. bool mTwoSided;
  403. };
  404. // ---------------------------------------------------------------------------
  405. /** Helper structure to represent a 3ds file mesh */
  406. struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
  407. {
  408. //! Default constructor has been deleted
  409. Mesh() = delete;
  410. //! Constructor with explicit name
  411. explicit Mesh(const std::string &name)
  412. : mName(name)
  413. {
  414. }
  415. //! Name of the mesh
  416. std::string mName;
  417. //! Texture coordinates
  418. std::vector<aiVector3D> mTexCoords;
  419. //! Face materials
  420. std::vector<unsigned int> mFaceMaterials;
  421. //! Local transformation matrix
  422. aiMatrix4x4 mMat;
  423. };
  424. // ---------------------------------------------------------------------------
  425. /** Float key - quite similar to aiVectorKey and aiQuatKey. Both are in the
  426. C-API, so it would be difficult to make them a template. */
  427. struct aiFloatKey
  428. {
  429. double mTime; ///< The time of this key
  430. ai_real mValue; ///< The value of this key
  431. #ifdef __cplusplus
  432. // time is not compared
  433. bool operator == (const aiFloatKey& o) const
  434. {return o.mValue == this->mValue;}
  435. bool operator != (const aiFloatKey& o) const
  436. {return o.mValue != this->mValue;}
  437. // Only time is compared. This operator is defined
  438. // for use with std::sort
  439. bool operator < (const aiFloatKey& o) const
  440. {return mTime < o.mTime;}
  441. bool operator > (const aiFloatKey& o) const
  442. {return mTime > o.mTime;}
  443. #endif
  444. };
  445. // ---------------------------------------------------------------------------
  446. /** Helper structure to represent a 3ds file node */
  447. struct Node
  448. {
  449. Node() = delete;
  450. explicit Node(const std::string &name)
  451. : mParent(NULL)
  452. , mName(name)
  453. , mInstanceNumber(0)
  454. , mHierarchyPos (0)
  455. , mHierarchyIndex (0)
  456. , mInstanceCount (1)
  457. {
  458. aRotationKeys.reserve (20);
  459. aPositionKeys.reserve (20);
  460. aScalingKeys.reserve (20);
  461. }
  462. ~Node()
  463. {
  464. for (unsigned int i = 0; i < mChildren.size();++i)
  465. delete mChildren[i];
  466. }
  467. //! Pointer to the parent node
  468. Node* mParent;
  469. //! Holds all child nodes
  470. std::vector<Node*> mChildren;
  471. //! Name of the node
  472. std::string mName;
  473. //! InstanceNumber of the node
  474. int32_t mInstanceNumber;
  475. //! Dummy nodes: real name to be combined with the $$$DUMMY
  476. std::string mDummyName;
  477. //! Position of the node in the hierarchy (tree depth)
  478. int16_t mHierarchyPos;
  479. //! Index of the node
  480. int16_t mHierarchyIndex;
  481. //! Rotation keys loaded from the file
  482. std::vector<aiQuatKey> aRotationKeys;
  483. //! Position keys loaded from the file
  484. std::vector<aiVectorKey> aPositionKeys;
  485. //! Scaling keys loaded from the file
  486. std::vector<aiVectorKey> aScalingKeys;
  487. // For target lights (spot lights and directional lights):
  488. // The position of the target
  489. std::vector< aiVectorKey > aTargetPositionKeys;
  490. // For cameras: the camera roll angle
  491. std::vector< aiFloatKey > aCameraRollKeys;
  492. //! Pivot position loaded from the file
  493. aiVector3D vPivot;
  494. //instance count, will be kept only for the first node
  495. int32_t mInstanceCount;
  496. //! Add a child node, setup the right parent node for it
  497. //! \param pc Node to be 'adopted'
  498. inline Node& push_back(Node* pc)
  499. {
  500. mChildren.push_back(pc);
  501. pc->mParent = this;
  502. return *this;
  503. }
  504. };
  505. // ---------------------------------------------------------------------------
  506. /** Helper structure analogue to aiScene */
  507. struct Scene
  508. {
  509. //! List of all materials loaded
  510. //! NOTE: 3ds references materials globally
  511. std::vector<Material> mMaterials;
  512. //! List of all meshes loaded
  513. std::vector<Mesh> mMeshes;
  514. //! List of all cameras loaded
  515. std::vector<aiCamera*> mCameras;
  516. //! List of all lights loaded
  517. std::vector<aiLight*> mLights;
  518. //! Pointer to the root node of the scene
  519. // --- moved to main class
  520. // Node* pcRootNode;
  521. };
  522. } // end of namespace D3DS
  523. } // end of namespace Assimp
  524. #endif // AI_XFILEHELPER_H_INC