3DSHelper.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. /*
  2. Open Asset Import Library (assimp)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2018, 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 "./../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() {
  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. {
  267. //! Default constructor
  268. Texture()
  269. : mOffsetU (0.0)
  270. , mOffsetV (0.0)
  271. , mScaleU (1.0)
  272. , mScaleV (1.0)
  273. , mRotation (0.0)
  274. , mMapMode (aiTextureMapMode_Wrap)
  275. , bPrivate()
  276. , iUVSrc (0)
  277. {
  278. mTextureBlend = get_qnan();
  279. }
  280. //! Specifies the blend factor for the texture
  281. ai_real mTextureBlend;
  282. //! Specifies the filename of the texture
  283. std::string mMapName;
  284. //! Specifies texture coordinate offsets/scaling/rotations
  285. ai_real mOffsetU;
  286. ai_real mOffsetV;
  287. ai_real mScaleU;
  288. ai_real mScaleV;
  289. ai_real mRotation;
  290. //! Specifies the mapping mode to be used for the texture
  291. aiTextureMapMode mMapMode;
  292. //! Used internally
  293. bool bPrivate;
  294. int iUVSrc;
  295. };
  296. #include "./../include/assimp/Compiler/poppack1.h"
  297. // ---------------------------------------------------------------------------
  298. /** Helper structure representing a 3ds material */
  299. struct Material
  300. {
  301. //! Default constructor has been deleted
  302. Material() = delete;
  303. //! Constructor with explicit name
  304. explicit Material(const std::string &name)
  305. : mName(name)
  306. , mDiffuse ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) // FIX ... we won't want object to be black
  307. , mSpecularExponent ( ai_real( 0.0 ) )
  308. , mShininessStrength ( ai_real( 1.0 ) )
  309. , mShading(Discreet3DS::Gouraud)
  310. , mTransparency ( ai_real( 1.0 ) )
  311. , mBumpHeight ( ai_real( 1.0 ) )
  312. , mTwoSided (false)
  313. {
  314. }
  315. Material(const Material &other) = default;
  316. Material &operator=(const Material &other) = default;
  317. //! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
  318. Material(Material &&other)
  319. : mName(std::move(other.mName))
  320. , mDiffuse(std::move(other.mDiffuse))
  321. , mSpecularExponent(std::move(other.mSpecularExponent))
  322. , mShininessStrength(std::move(other.mShininessStrength))
  323. , mSpecular(std::move(other.mSpecular))
  324. , mAmbient(std::move(other.mAmbient))
  325. , mShading(std::move(other.mShading))
  326. , mTransparency(std::move(other.mTransparency))
  327. , sTexDiffuse(std::move(other.sTexDiffuse))
  328. , sTexOpacity(std::move(other.sTexOpacity))
  329. , sTexSpecular(std::move(other.sTexSpecular))
  330. , sTexReflective(std::move(other.sTexReflective))
  331. , sTexBump(std::move(other.sTexBump))
  332. , sTexEmissive(std::move(other.sTexEmissive))
  333. , sTexShininess(std::move(other.sTexShininess))
  334. , mBumpHeight(std::move(other.mBumpHeight))
  335. , mEmissive(std::move(other.mEmissive))
  336. , sTexAmbient(std::move(other.sTexAmbient))
  337. , mTwoSided(std::move(other.mTwoSided))
  338. {
  339. }
  340. Material &operator=(Material &&other) {
  341. if (this == &other) {
  342. return *this;
  343. }
  344. mName = std::move(other.mName);
  345. mDiffuse = std::move(other.mDiffuse);
  346. mSpecularExponent = std::move(other.mSpecularExponent);
  347. mShininessStrength = std::move(other.mShininessStrength),
  348. mSpecular = std::move(other.mSpecular);
  349. mAmbient = std::move(other.mAmbient);
  350. mShading = std::move(other.mShading);
  351. mTransparency = std::move(other.mTransparency);
  352. sTexDiffuse = std::move(other.sTexDiffuse);
  353. sTexOpacity = std::move(other.sTexOpacity);
  354. sTexSpecular = std::move(other.sTexSpecular);
  355. sTexReflective = std::move(other.sTexReflective);
  356. sTexBump = std::move(other.sTexBump);
  357. sTexEmissive = std::move(other.sTexEmissive);
  358. sTexShininess = std::move(other.sTexShininess);
  359. mBumpHeight = std::move(other.mBumpHeight);
  360. mEmissive = std::move(other.mEmissive);
  361. sTexAmbient = std::move(other.sTexAmbient);
  362. mTwoSided = std::move(other.mTwoSided);
  363. return *this;
  364. }
  365. ~Material() {}
  366. //! Name of the material
  367. std::string mName;
  368. //! Diffuse color of the material
  369. aiColor3D mDiffuse;
  370. //! Specular exponent
  371. ai_real mSpecularExponent;
  372. //! Shininess strength, in percent
  373. ai_real mShininessStrength;
  374. //! Specular color of the material
  375. aiColor3D mSpecular;
  376. //! Ambient color of the material
  377. aiColor3D mAmbient;
  378. //! Shading type to be used
  379. Discreet3DS::shadetype3ds mShading;
  380. //! Opacity of the material
  381. ai_real mTransparency;
  382. //! Diffuse texture channel
  383. Texture sTexDiffuse;
  384. //! Opacity texture channel
  385. Texture sTexOpacity;
  386. //! Specular texture channel
  387. Texture sTexSpecular;
  388. //! Reflective texture channel
  389. Texture sTexReflective;
  390. //! Bump texture channel
  391. Texture sTexBump;
  392. //! Emissive texture channel
  393. Texture sTexEmissive;
  394. //! Shininess texture channel
  395. Texture sTexShininess;
  396. //! Scaling factor for the bump values
  397. ai_real mBumpHeight;
  398. //! Emissive color
  399. aiColor3D mEmissive;
  400. //! Ambient texture channel
  401. //! (used by the ASE format)
  402. Texture sTexAmbient;
  403. //! True if the material must be rendered from two sides
  404. bool mTwoSided;
  405. };
  406. // ---------------------------------------------------------------------------
  407. /** Helper structure to represent a 3ds file mesh */
  408. struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
  409. {
  410. //! Default constructor has been deleted
  411. Mesh() = delete;
  412. //! Constructor with explicit name
  413. explicit Mesh(const std::string &name)
  414. : mName(name)
  415. {
  416. }
  417. //! Name of the mesh
  418. std::string mName;
  419. //! Texture coordinates
  420. std::vector<aiVector3D> mTexCoords;
  421. //! Face materials
  422. std::vector<unsigned int> mFaceMaterials;
  423. //! Local transformation matrix
  424. aiMatrix4x4 mMat;
  425. };
  426. // ---------------------------------------------------------------------------
  427. /** Float key - quite similar to aiVectorKey and aiQuatKey. Both are in the
  428. C-API, so it would be difficult to make them a template. */
  429. struct aiFloatKey
  430. {
  431. double mTime; ///< The time of this key
  432. ai_real mValue; ///< The value of this key
  433. #ifdef __cplusplus
  434. // time is not compared
  435. bool operator == (const aiFloatKey& o) const
  436. {return o.mValue == this->mValue;}
  437. bool operator != (const aiFloatKey& o) const
  438. {return o.mValue != this->mValue;}
  439. // Only time is compared. This operator is defined
  440. // for use with std::sort
  441. bool operator < (const aiFloatKey& o) const
  442. {return mTime < o.mTime;}
  443. bool operator > (const aiFloatKey& o) const
  444. {return mTime > o.mTime;}
  445. #endif
  446. };
  447. // ---------------------------------------------------------------------------
  448. /** Helper structure to represent a 3ds file node */
  449. struct Node
  450. {
  451. Node() = delete;
  452. explicit Node(const std::string &name)
  453. : mParent(NULL)
  454. , mName(name)
  455. , mInstanceNumber(0)
  456. , mHierarchyPos (0)
  457. , mHierarchyIndex (0)
  458. , mInstanceCount (1)
  459. {
  460. aRotationKeys.reserve (20);
  461. aPositionKeys.reserve (20);
  462. aScalingKeys.reserve (20);
  463. }
  464. ~Node()
  465. {
  466. for (unsigned int i = 0; i < mChildren.size();++i)
  467. delete mChildren[i];
  468. }
  469. //! Pointer to the parent node
  470. Node* mParent;
  471. //! Holds all child nodes
  472. std::vector<Node*> mChildren;
  473. //! Name of the node
  474. std::string mName;
  475. //! InstanceNumber of the node
  476. int32_t mInstanceNumber;
  477. //! Dummy nodes: real name to be combined with the $$$DUMMY
  478. std::string mDummyName;
  479. //! Position of the node in the hierarchy (tree depth)
  480. int16_t mHierarchyPos;
  481. //! Index of the node
  482. int16_t mHierarchyIndex;
  483. //! Rotation keys loaded from the file
  484. std::vector<aiQuatKey> aRotationKeys;
  485. //! Position keys loaded from the file
  486. std::vector<aiVectorKey> aPositionKeys;
  487. //! Scaling keys loaded from the file
  488. std::vector<aiVectorKey> aScalingKeys;
  489. // For target lights (spot lights and directional lights):
  490. // The position of the target
  491. std::vector< aiVectorKey > aTargetPositionKeys;
  492. // For cameras: the camera roll angle
  493. std::vector< aiFloatKey > aCameraRollKeys;
  494. //! Pivot position loaded from the file
  495. aiVector3D vPivot;
  496. //instance count, will be kept only for the first node
  497. int32_t mInstanceCount;
  498. //! Add a child node, setup the right parent node for it
  499. //! \param pc Node to be 'adopted'
  500. inline Node& push_back(Node* pc)
  501. {
  502. mChildren.push_back(pc);
  503. pc->mParent = this;
  504. return *this;
  505. }
  506. };
  507. // ---------------------------------------------------------------------------
  508. /** Helper structure analogue to aiScene */
  509. struct Scene
  510. {
  511. //! List of all materials loaded
  512. //! NOTE: 3ds references materials globally
  513. std::vector<Material> mMaterials;
  514. //! List of all meshes loaded
  515. std::vector<Mesh> mMeshes;
  516. //! List of all cameras loaded
  517. std::vector<aiCamera*> mCameras;
  518. //! List of all lights loaded
  519. std::vector<aiLight*> mLights;
  520. //! Pointer to the root node of the scene
  521. // --- moved to main class
  522. // Node* pcRootNode;
  523. };
  524. } // end of namespace D3DS
  525. } // end of namespace Assimp
  526. #endif // AI_XFILEHELPER_H_INC