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

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

  1. /**
  2. A **ReflectionMap** specifies a cube texture reflection map.
  3.  
  4. ## Usage
  5.  
  6. ````javascript
  7.  
  8. new xeogl.ReflectionMap({
  9. src: [
  10. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PX.png",
  11. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NX.png",
  12. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PY.png",
  13. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NY.png",
  14. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PZ.png",
  15. "textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_NZ.png"
  16. ]
  17. });
  18. ````
  19. @class ReflectionMap
  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 ReflectionMap, 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 ReflectionMap.
  27. @param [cfg.src=null] {Array of String} Paths to six image files to load into this ReflectionMap.
  28. @param [cfg.flipY=false] {Boolean} Flips this ReflectionMap's source data along its vertical axis when true.
  29. @param [cfg.encoding="linear"] {String} Encoding format. See the {{#crossLink "ReflectionMap/encoding:property"}}{{/crossLink}} property for more info.
  30. @extends Component
  31. */
  32. import {CubeTexture} from './cubeTexture.js';
  33. import {componentClasses} from "./../componentClasses.js";
  34.  
  35. const type = "xeogl.ReflectionMap";
  36.  
  37. class ReflectionMap extends CubeTexture {
  38.  
  39. /**
  40. JavaScript class name for this Component.
  41.  
  42. For example: "xeogl.AmbientLight", "xeogl.MetallicMaterial" etc.
  43.  
  44. @property type
  45. @type String
  46. @final
  47. */
  48. get type() {
  49. return type;
  50. }
  51.  
  52. init(cfg) {
  53. super.init(cfg);
  54. this.scene._lightsState.addReflectionMap(this._state);
  55. this.scene._reflectionMapCreated(this);
  56. }
  57.  
  58. destroy() {
  59. super.destroy();
  60. this.scene._reflectionMapDestroyed(this);
  61. }
  62. }
  63.  
  64. componentClasses[type] = ReflectionMap;
  65.  
  66. export{ReflectionMap};
  67.