babylon.lensFlare.js 916 B

123456789101112131415161718192021222324
  1. var BABYLON;
  2. (function (BABYLON) {
  3. var LensFlare = (function () {
  4. function LensFlare(size, position, color, imgUrl, system) {
  5. this.size = size;
  6. this.position = position;
  7. this.dispose = function () {
  8. if (this.texture) {
  9. this.texture.dispose();
  10. }
  11. // Remove from scene
  12. var index = this._system.lensFlares.indexOf(this);
  13. this._system.lensFlares.splice(index, 1);
  14. };
  15. this.color = color || new BABYLON.Color3(1, 1, 1);
  16. this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
  17. this._system = system;
  18. system.lensFlares.push(this);
  19. }
  20. return LensFlare;
  21. })();
  22. BABYLON.LensFlare = LensFlare;
  23. })(BABYLON || (BABYLON = {}));
  24. //# sourceMappingURL=babylon.lensFlare.js.map