/home/lindsay/xeolabs/xeogl-next/xeogl/src/lighting/lightMap.js
API Docs for:

File: /home/lindsay/xeolabs/xeogl-next/xeogl/src/lighting/lightMap.js

  1. /**
  2. A **LightMap** specifies a cube texture light map.
  3.  
  4. ## Usage
  5.  
  6. ````javascript
  7.  
  8. new xeogl.LightMap({
  9. src: [
  10. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PX.png",
  11. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NX.png",
  12. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PY.png",
  13. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NY.png",
  14. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_PZ.png",
  15. "textures/light/Uffizi_Gallery/Uffizi_Gallery_Irradiance_NZ.png"
  16. ]
  17. });
  18. ````
  19. @class LightMap
  20. @module xeogl
  21. @submodule lighting
  22. @constructor
  23. @param [owner] {Component} Owner component. When destroyed, the owner will destroy this component as well. Creates this component within the default {{#crossLink "Scene"}}{{/crossLink}} when omitted.
  24. @param [cfg] {*} Configs
  25. @param [cfg.id] {String} Optional ID for this LightMap, unique among all components in the parent scene, generated automatically when omitted.
  26. @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this LightMap.
  27. @param [cfg.src=null] {Array of String} Paths to six image files to load into this LightMap.
  28. @param [cfg.flipY=false] {Boolean} Flips this LightMap's source data along its vertical axis when true.
  29. @param [cfg.encoding="linear"] {String} Encoding format. See the {{#crossLink "LightMap/encoding:property"}}{{/crossLink}} property for more info.
  30. @extends Component
  31. */
  32.  
  33. import {core} from "./../core.js";
  34. import {CubeTexture} from './cubeTexture.js';
  35. import {componentClasses} from "./../componentClasses.js";
  36.  
  37. const type = "xeogl.LightMap";
  38.  
  39. class LightMap extends CubeTexture{
  40.  
  41. /**
  42. JavaScript class name for this Component.
  43.  
  44. For example: "xeogl.AmbientLight", "xeogl.MetallicMaterial" etc.
  45.  
  46. @property type
  47. @type String
  48. @final
  49. */
  50. get type() {
  51. return type;
  52. }
  53.  
  54. init(cfg) {
  55. super.init(cfg);
  56. this.scene._lightMapCreated(this);
  57. }
  58.  
  59. destroy() {
  60. super.destroy();
  61. this.scene._lightMapDestroyed(this);
  62. }
  63. }
  64.  
  65. componentClasses[type] = LightMap;
  66.  
  67. export{LightMap};
  68.