babylon.light.js 933 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. var BABYLON = BABYLON || {};
  2. (function () {
  3. BABYLON.Light = function (name, scene) {
  4. this.name = name;
  5. this.id = name;
  6. this._scene = scene;
  7. scene.lights.push(this);
  8. };
  9. // Members
  10. BABYLON.Light.prototype.intensity = 1.0;
  11. BABYLON.Light.prototype.isEnabled = true;
  12. // Properties
  13. BABYLON.Light.prototype.getScene = function () {
  14. return this._scene;
  15. };
  16. BABYLON.Light.prototype.getShadowGenerator = function() {
  17. return this._shadowGenerator;
  18. };
  19. // Methods
  20. BABYLON.Light.prototype.dispose = function () {
  21. if (this._shadowGenerator) {
  22. this._shadowGenerator.dispose();
  23. this._shadowGenerator = null;
  24. }
  25. // Remove from scene
  26. var index = this._scene.lights.indexOf(this);
  27. this._scene.lights.splice(index, 1);
  28. };
  29. })();