X3DImporter_Node.hpp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 X3DImporter_Node.hpp
  34. /// \brief Elements of scene graph.
  35. /// \date 2015-2016
  36. /// \author [email protected]
  37. #ifndef INCLUDED_AI_X3D_IMPORTER_NODE_H
  38. #define INCLUDED_AI_X3D_IMPORTER_NODE_H
  39. // Header files, Assimp.
  40. #include <assimp/types.h>
  41. #include <list>
  42. #include <vector>
  43. enum X3DElemType {
  44. ENET_Group, ///< Element has type "Group".
  45. ENET_MetaBoolean, ///< Element has type "Metadata boolean".
  46. ENET_MetaDouble, ///< Element has type "Metadata double".
  47. ENET_MetaFloat, ///< Element has type "Metadata float".
  48. ENET_MetaInteger, ///< Element has type "Metadata integer".
  49. ENET_MetaSet, ///< Element has type "Metadata set".
  50. ENET_MetaString, ///< Element has type "Metadata string".
  51. ENET_Arc2D, ///< Element has type "Arc2D".
  52. ENET_ArcClose2D, ///< Element has type "ArcClose2D".
  53. ENET_Circle2D, ///< Element has type "Circle2D".
  54. ENET_Disk2D, ///< Element has type "Disk2D".
  55. ENET_Polyline2D, ///< Element has type "Polyline2D".
  56. ENET_Polypoint2D, ///< Element has type "Polypoint2D".
  57. ENET_Rectangle2D, ///< Element has type "Rectangle2D".
  58. ENET_TriangleSet2D, ///< Element has type "TriangleSet2D".
  59. ENET_Box, ///< Element has type "Box".
  60. ENET_Cone, ///< Element has type "Cone".
  61. ENET_Cylinder, ///< Element has type "Cylinder".
  62. ENET_Sphere, ///< Element has type "Sphere".
  63. ENET_ElevationGrid, ///< Element has type "ElevationGrid".
  64. ENET_Extrusion, ///< Element has type "Extrusion".
  65. ENET_Coordinate, ///< Element has type "Coordinate".
  66. ENET_Normal, ///< Element has type "Normal".
  67. ENET_TextureCoordinate, ///< Element has type "TextureCoordinate".
  68. ENET_IndexedFaceSet, ///< Element has type "IndexedFaceSet".
  69. ENET_IndexedLineSet, ///< Element has type "IndexedLineSet".
  70. ENET_IndexedTriangleSet, ///< Element has type "IndexedTriangleSet".
  71. ENET_IndexedTriangleFanSet, ///< Element has type "IndexedTriangleFanSet".
  72. ENET_IndexedTriangleStripSet, ///< Element has type "IndexedTriangleStripSet".
  73. ENET_LineSet, ///< Element has type "LineSet".
  74. ENET_PointSet, ///< Element has type "PointSet".
  75. ENET_TriangleSet, ///< Element has type "TriangleSet".
  76. ENET_TriangleFanSet, ///< Element has type "TriangleFanSet".
  77. ENET_TriangleStripSet, ///< Element has type "TriangleStripSet".
  78. ENET_Color, ///< Element has type "Color".
  79. ENET_ColorRGBA, ///< Element has type "ColorRGBA".
  80. ENET_Shape, ///< Element has type "Shape".
  81. ENET_Appearance, ///< Element has type "Appearance".
  82. ENET_Material, ///< Element has type "Material".
  83. ENET_ImageTexture, ///< Element has type "ImageTexture".
  84. ENET_TextureTransform, ///< Element has type "TextureTransform".
  85. ENET_DirectionalLight, ///< Element has type "DirectionalLight".
  86. ENET_PointLight, ///< Element has type "PointLight".
  87. ENET_SpotLight, ///< Element has type "SpotLight".
  88. ENET_Invalid ///< Element has invalid type and possible contain invalid data.
  89. };
  90. struct X3DNodeElementBase {
  91. X3DNodeElementBase *Parent;
  92. std::string ID;
  93. std::list<X3DNodeElementBase *> Children;
  94. X3DElemType Type;
  95. virtual ~X3DNodeElementBase() = default;
  96. protected:
  97. X3DNodeElementBase(X3DElemType type, X3DNodeElementBase *pParent) :
  98. Parent(pParent), Type(type) {
  99. // empty
  100. }
  101. };
  102. /// This struct hold <Color> value.
  103. struct X3DNodeElementColor : X3DNodeElementBase {
  104. std::list<aiColor3D> Value; ///< Stored value.
  105. /// Constructor
  106. /// \param [in] pParent - pointer to parent node.
  107. X3DNodeElementColor(X3DNodeElementBase *pParent) :
  108. X3DNodeElementBase(X3DElemType::ENET_Color, pParent) {}
  109. }; // struct X3DNodeElementColor
  110. /// This struct hold <ColorRGBA> value.
  111. struct X3DNodeElementColorRGBA : X3DNodeElementBase {
  112. std::list<aiColor4D> Value; ///< Stored value.
  113. /// Constructor
  114. /// \param [in] pParent - pointer to parent node.
  115. X3DNodeElementColorRGBA(X3DNodeElementBase *pParent) :
  116. X3DNodeElementBase(X3DElemType::ENET_ColorRGBA, pParent) {}
  117. }; // struct X3DNodeElementColorRGBA
  118. /// This struct hold <Coordinate> value.
  119. struct X3DNodeElementCoordinate : public X3DNodeElementBase {
  120. std::list<aiVector3D> Value; ///< Stored value.
  121. /// Constructor
  122. /// \param [in] pParent - pointer to parent node.
  123. X3DNodeElementCoordinate(X3DNodeElementBase *pParent) :
  124. X3DNodeElementBase(X3DElemType::ENET_Coordinate, pParent) {}
  125. }; // struct X3DNodeElementCoordinate
  126. /// This struct hold <Normal> value.
  127. struct X3DNodeElementNormal : X3DNodeElementBase {
  128. std::list<aiVector3D> Value; ///< Stored value.
  129. /// Constructor
  130. /// \param [in] pParent - pointer to parent node.
  131. X3DNodeElementNormal(X3DNodeElementBase *pParent) :
  132. X3DNodeElementBase(X3DElemType::ENET_Normal, pParent) {}
  133. }; // struct X3DNodeElementNormal
  134. /// This struct hold <TextureCoordinate> value.
  135. struct X3DNodeElementTextureCoordinate : X3DNodeElementBase {
  136. std::list<aiVector2D> Value; ///< Stored value.
  137. /// Constructor
  138. /// \param [in] pParent - pointer to parent node.
  139. X3DNodeElementTextureCoordinate(X3DNodeElementBase *pParent) :
  140. X3DNodeElementBase(X3DElemType::ENET_TextureCoordinate, pParent) {}
  141. }; // struct X3DNodeElementTextureCoordinate
  142. /// Two-dimensional figure.
  143. struct X3DNodeElementGeometry2D : X3DNodeElementBase {
  144. std::list<aiVector3D> Vertices; ///< Vertices list.
  145. size_t NumIndices; ///< Number of indices in one face.
  146. bool Solid; ///< Flag: if true then render must use back-face culling, else render must draw both sides of object.
  147. /// Constructor.
  148. /// \param [in] pParent - pointer to parent node.
  149. /// \param [in] pType - type of geometry object.
  150. X3DNodeElementGeometry2D(X3DElemType pType, X3DNodeElementBase *pParent) :
  151. X3DNodeElementBase(pType, pParent), Solid(true) {}
  152. }; // class X3DNodeElementGeometry2D
  153. /// Three-dimensional body.
  154. struct X3DNodeElementGeometry3D : X3DNodeElementBase {
  155. std::list<aiVector3D> Vertices; ///< Vertices list.
  156. size_t NumIndices; ///< Number of indices in one face.
  157. bool Solid; ///< Flag: if true then render must use back-face culling, else render must draw both sides of object.
  158. /// Constructor.
  159. /// \param [in] pParent - pointer to parent node.
  160. /// \param [in] pType - type of geometry object.
  161. X3DNodeElementGeometry3D(X3DElemType pType, X3DNodeElementBase *pParent) :
  162. X3DNodeElementBase(pType, pParent), Vertices(), NumIndices(0), Solid(true) {
  163. // empty
  164. }
  165. }; // class X3DNodeElementGeometry3D
  166. /// Uniform rectangular grid of varying height.
  167. struct X3DNodeElementElevationGrid : X3DNodeElementGeometry3D {
  168. bool NormalPerVertex; ///< If true then normals are defined for every vertex, else for every face(line).
  169. bool ColorPerVertex; ///< If true then colors are defined for every vertex, else for every face(line).
  170. /// If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are
  171. /// shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.
  172. float CreaseAngle;
  173. std::vector<int32_t> CoordIdx; ///< Coordinates list by faces. In X3D format: "-1" - delimiter for faces.
  174. /// Constructor.
  175. /// \param [in] pParent - pointer to parent node.
  176. /// \param [in] pType - type of geometry object.
  177. X3DNodeElementElevationGrid(X3DElemType pType, X3DNodeElementBase *pParent) :
  178. X3DNodeElementGeometry3D(pType, pParent) {}
  179. }; // class X3DNodeElementIndexedSet
  180. /// Shape with indexed vertices.
  181. struct X3DNodeElementIndexedSet : public X3DNodeElementGeometry3D {
  182. /// The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors
  183. /// used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to
  184. /// the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the
  185. /// local coordinate system of the Shape) from the opposite direction as the normal. If ccw is FALSE, the normals shall be oriented in the opposite
  186. /// direction. If normals are not generated but are supplied using a Normal node, and the orientation of the normals does not match the setting of the
  187. /// ccw field, results are undefined.
  188. bool CCW;
  189. std::vector<int32_t> ColorIndex; ///< Field to specify the polygonal faces by indexing into the <Color> or <ColorRGBA>.
  190. bool ColorPerVertex; ///< If true then colors are defined for every vertex, else for every face(line).
  191. /// The convex field indicates whether all polygons in the shape are convex (TRUE). A polygon is convex if it is planar, does not intersect itself,
  192. /// and all of the interior angles at its vertices are less than 180 degrees. Non planar and self intersecting polygons may produce undefined results
  193. /// even if the convex field is FALSE.
  194. bool Convex;
  195. std::vector<int32_t> CoordIndex; ///< Field to specify the polygonal faces by indexing into the <Coordinate>.
  196. /// If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are
  197. /// shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.
  198. float CreaseAngle;
  199. std::vector<int32_t> NormalIndex; ///< Field to specify the polygonal faces by indexing into the <Normal>.
  200. bool NormalPerVertex; ///< If true then normals are defined for every vertex, else for every face(line).
  201. std::vector<int32_t> TexCoordIndex; ///< Field to specify the polygonal faces by indexing into the <TextureCoordinate>.
  202. /// Constructor.
  203. /// \param [in] pParent - pointer to parent node.
  204. /// \param [in] pType - type of geometry object.
  205. X3DNodeElementIndexedSet(X3DElemType pType, X3DNodeElementBase *pParent) :
  206. X3DNodeElementGeometry3D(pType, pParent) {}
  207. }; // class X3DNodeElementIndexedSet
  208. /// Shape with set of vertices.
  209. struct X3DNodeElementSet : X3DNodeElementGeometry3D {
  210. /// The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors
  211. /// used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to
  212. /// the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the
  213. /// local coordinate system of the Shape) from the opposite direction as the normal. If ccw is FALSE, the normals shall be oriented in the opposite
  214. /// direction. If normals are not generated but are supplied using a Normal node, and the orientation of the normals does not match the setting of the
  215. /// ccw field, results are undefined.
  216. bool CCW;
  217. bool ColorPerVertex; ///< If true then colors are defined for every vertex, else for every face(line).
  218. bool NormalPerVertex; ///< If true then normals are defined for every vertex, else for every face(line).
  219. std::vector<int32_t> CoordIndex; ///< Field to specify the polygonal faces by indexing into the <Coordinate>.
  220. std::vector<int32_t> NormalIndex; ///< Field to specify the polygonal faces by indexing into the <Normal>.
  221. std::vector<int32_t> TexCoordIndex; ///< Field to specify the polygonal faces by indexing into the <TextureCoordinate>.
  222. std::vector<int32_t> VertexCount; ///< Field describes how many vertices are to be used in each polyline(polygon) from the <Coordinate> field.
  223. /// Constructor.
  224. /// \param [in] pParent - pointer to parent node.
  225. /// \param [in] pType - type of geometry object.
  226. X3DNodeElementSet(X3DElemType type, X3DNodeElementBase *pParent) :
  227. X3DNodeElementGeometry3D(type, pParent) {}
  228. }; // class X3DNodeElementSet
  229. /// This struct hold <Shape> value.
  230. struct X3DNodeElementShape : X3DNodeElementBase {
  231. /// Constructor
  232. /// \param [in] pParent - pointer to parent node.
  233. X3DNodeElementShape(X3DNodeElementBase *pParent) :
  234. X3DNodeElementBase(X3DElemType::ENET_Shape, pParent) {}
  235. }; // struct X3DNodeElementShape
  236. /// This struct hold <Appearance> value.
  237. struct X3DNodeElementAppearance : public X3DNodeElementBase {
  238. /// Constructor
  239. /// \param [in] pParent - pointer to parent node.
  240. X3DNodeElementAppearance(X3DNodeElementBase *pParent) :
  241. X3DNodeElementBase(X3DElemType::ENET_Appearance, pParent) {}
  242. }; // struct X3DNodeElementAppearance
  243. struct X3DNodeElementMaterial : public X3DNodeElementBase {
  244. float AmbientIntensity; ///< Specifies how much ambient light from light sources this surface shall reflect.
  245. aiColor3D DiffuseColor; ///< Reflects all X3D light sources depending on the angle of the surface with respect to the light source.
  246. aiColor3D EmissiveColor; ///< Models "glowing" objects. This can be useful for displaying pre-lit models.
  247. float Shininess; ///< Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
  248. aiColor3D SpecularColor; ///< The specularColor and shininess fields determine the specular highlights.
  249. float Transparency; ///< Specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.
  250. /// Constructor.
  251. /// \param [in] pParent - pointer to parent node.
  252. /// \param [in] pType - type of geometry object.
  253. X3DNodeElementMaterial(X3DNodeElementBase *pParent) :
  254. X3DNodeElementBase(X3DElemType::ENET_Material, pParent),
  255. AmbientIntensity(0.0f),
  256. DiffuseColor(),
  257. EmissiveColor(),
  258. Shininess(0.0f),
  259. SpecularColor(),
  260. Transparency(1.0f) {
  261. // empty
  262. }
  263. }; // class X3DNodeElementMaterial
  264. /// This struct hold <ImageTexture> value.
  265. struct X3DNodeElementImageTexture : X3DNodeElementBase {
  266. /// RepeatS and RepeatT, that specify how the texture wraps in the S and T directions. If repeatS is TRUE (the default), the texture map is repeated
  267. /// outside the [0.0, 1.0] texture coordinate range in the S direction so that it fills the shape. If repeatS is FALSE, the texture coordinates are
  268. /// clamped in the S direction to lie within the [0.0, 1.0] range. The repeatT field is analogous to the repeatS field.
  269. bool RepeatS;
  270. bool RepeatT; ///< See \ref RepeatS.
  271. std::string URL; ///< URL of the texture.
  272. /// Constructor
  273. /// \param [in] pParent - pointer to parent node.
  274. X3DNodeElementImageTexture(X3DNodeElementBase *pParent) :
  275. X3DNodeElementBase(X3DElemType::ENET_ImageTexture, pParent) {}
  276. }; // struct X3DNodeElementImageTexture
  277. /// This struct hold <TextureTransform> value.
  278. struct X3DNodeElementTextureTransform : X3DNodeElementBase {
  279. aiVector2D Center; ///< Specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied.
  280. float Rotation; ///< Specifies a rotation in angle base units of the texture coordinates about the center point after the scale has been applied.
  281. aiVector2D Scale; ///< Specifies a scaling factor in S and T of the texture coordinates about the center point.
  282. aiVector2D Translation; ///< Specifies a translation of the texture coordinates.
  283. /// Constructor
  284. /// \param [in] pParent - pointer to parent node.
  285. X3DNodeElementTextureTransform(X3DNodeElementBase *pParent) :
  286. X3DNodeElementBase(X3DElemType::ENET_TextureTransform, pParent) {}
  287. }; // struct X3DNodeElementTextureTransform
  288. struct X3DNodeElementGroup : X3DNodeElementBase {
  289. aiMatrix4x4 Transformation; ///< Transformation matrix.
  290. /// As you know node elements can use already defined node elements when attribute "USE" is defined.
  291. /// Standard search when looking for an element in the whole scene graph, existing at this moment.
  292. /// If a node is marked as static, the children(or lower) can not search for elements in the nodes upper then static.
  293. bool Static;
  294. bool UseChoice; ///< Flag: if true then use number from \ref Choice to choose what the child will be kept.
  295. int32_t Choice; ///< Number of the child which will be kept.
  296. /// Constructor.
  297. /// \param [in] pParent - pointer to parent node.
  298. /// \param [in] pStatic - static node flag.
  299. X3DNodeElementGroup(X3DNodeElementBase *pParent, const bool pStatic = false) :
  300. X3DNodeElementBase(X3DElemType::ENET_Group, pParent), Static(pStatic), UseChoice(false) {}
  301. };
  302. struct X3DNodeElementMeta : X3DNodeElementBase {
  303. std::string Name; ///< Name of metadata object.
  304. std::string Reference;
  305. virtual ~X3DNodeElementMeta() = default;
  306. protected:
  307. X3DNodeElementMeta(X3DElemType type, X3DNodeElementBase *parent) :
  308. X3DNodeElementBase(type, parent) {
  309. // empty
  310. }
  311. };
  312. struct X3DNodeElementMetaBoolean : X3DNodeElementMeta {
  313. std::vector<bool> Value; ///< Stored value.
  314. explicit X3DNodeElementMetaBoolean(X3DNodeElementBase *pParent) :
  315. X3DNodeElementMeta(X3DElemType::ENET_MetaBoolean, pParent) {
  316. // empty
  317. }
  318. };
  319. struct X3DNodeElementMetaDouble : X3DNodeElementMeta {
  320. std::vector<double> Value; ///< Stored value.
  321. explicit X3DNodeElementMetaDouble(X3DNodeElementBase *pParent) :
  322. X3DNodeElementMeta(X3DElemType::ENET_MetaDouble, pParent) {
  323. // empty
  324. }
  325. };
  326. struct X3DNodeElementMetaFloat : public X3DNodeElementMeta {
  327. std::vector<float> Value; ///< Stored value.
  328. explicit X3DNodeElementMetaFloat(X3DNodeElementBase *pParent) :
  329. X3DNodeElementMeta(X3DElemType::ENET_MetaFloat, pParent) {
  330. // empty
  331. }
  332. };
  333. struct X3DNodeElementMetaInt : public X3DNodeElementMeta {
  334. std::vector<int32_t> Value; ///< Stored value.
  335. explicit X3DNodeElementMetaInt(X3DNodeElementBase *pParent) :
  336. X3DNodeElementMeta(X3DElemType::ENET_MetaInteger, pParent) {
  337. // empty
  338. }
  339. };
  340. struct X3DNodeElementMetaSet : public X3DNodeElementMeta {
  341. std::list<X3DNodeElementMeta> Value; ///< Stored value.
  342. explicit X3DNodeElementMetaSet(X3DNodeElementBase *pParent) :
  343. X3DNodeElementMeta(X3DElemType::ENET_MetaSet, pParent) {
  344. // empty
  345. }
  346. };
  347. struct X3DNodeElementMetaString : X3DNodeElementMeta {
  348. std::vector<std::string> Value; ///< Stored value.
  349. explicit X3DNodeElementMetaString(X3DNodeElementBase *pParent) :
  350. X3DNodeElementMeta(X3DElemType::ENET_MetaString, pParent) {
  351. // empty
  352. }
  353. };
  354. /// \struct X3DNodeElementLight
  355. /// This struct hold <TextureTransform> value.
  356. struct X3DNodeElementLight : X3DNodeElementBase {
  357. float AmbientIntensity; ///< Specifies the intensity of the ambient emission from the light.
  358. aiColor3D Color; ///< specifies the spectral colour properties of both the direct and ambient light emission as an RGB value.
  359. aiVector3D Direction; ///< Specifies the direction vector of the illumination emanating from the light source in the local coordinate system.
  360. /// \var Global
  361. /// Field that determines whether the light is global or scoped. Global lights illuminate all objects that fall within their volume of lighting influence.
  362. /// Scoped lights only illuminate objects that are in the same transformation hierarchy as the light.
  363. bool Global;
  364. float Intensity; ///< Specifies the brightness of the direct emission from the light.
  365. /// \var Attenuation
  366. /// PointLight node's illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor
  367. /// is: "1 / max(attenuation[0] + attenuation[1] * r + attenuation[2] * r2, 1)", where r is the distance from the light to the surface being illuminated.
  368. aiVector3D Attenuation;
  369. aiVector3D Location; ///< Specifies a translation offset of the centre point of the light source from the light's local coordinate system origin.
  370. float Radius; ///< Specifies the radial extent of the solid angle and the maximum distance from location that may be illuminated by the light source.
  371. float BeamWidth; ///< Specifies an inner solid angle in which the light source emits light at uniform full intensity.
  372. float CutOffAngle; ///< The light source's emission intensity drops off from the inner solid angle (beamWidth) to the outer solid angle (cutOffAngle).
  373. /// Constructor
  374. /// \param [in] pParent - pointer to parent node.
  375. /// \param [in] pLightType - type of the light source.
  376. X3DNodeElementLight(X3DElemType pLightType, X3DNodeElementBase *pParent) :
  377. X3DNodeElementBase(pLightType, pParent) {}
  378. }; // struct X3DNodeElementLight
  379. #endif // INCLUDED_AI_X3D_IMPORTER_NODE_H