babylon.light.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var __extends = this.__extends || function (d, b) {
  2. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3. function __() { this.constructor = d; }
  4. __.prototype = b.prototype;
  5. d.prototype = new __();
  6. };
  7. var BABYLON;
  8. (function (BABYLON) {
  9. var Light = (function (_super) {
  10. __extends(Light, _super);
  11. function Light(name, scene) {
  12. _super.call(this, name, scene);
  13. this.diffuse = new BABYLON.Color3(1.0, 1.0, 1.0);
  14. this.specular = new BABYLON.Color3(1.0, 1.0, 1.0);
  15. this.intensity = 1.0;
  16. this.range = Number.MAX_VALUE;
  17. this.excludedMeshes = new Array();
  18. this._excludedMeshesIds = new Array();
  19. scene.lights.push(this);
  20. }
  21. Light.prototype.getShadowGenerator = function () {
  22. return this._shadowGenerator;
  23. };
  24. Light.prototype.transferToEffect = function (effect, uniformName0, uniformName1) {
  25. };
  26. Light.prototype._getWorldMatrix = function () {
  27. return BABYLON.Matrix.Identity();
  28. };
  29. Light.prototype.getWorldMatrix = function () {
  30. this._currentRenderId = this.getScene().getRenderId();
  31. var worldMatrix = this._getWorldMatrix();
  32. if (this.parent && this.parent.getWorldMatrix) {
  33. if (!this._parentedWorldMatrix) {
  34. this._parentedWorldMatrix = BABYLON.Matrix.Identity();
  35. }
  36. worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._parentedWorldMatrix);
  37. return this._parentedWorldMatrix;
  38. }
  39. return worldMatrix;
  40. };
  41. Light.prototype.dispose = function () {
  42. if (this._shadowGenerator) {
  43. this._shadowGenerator.dispose();
  44. this._shadowGenerator = null;
  45. }
  46. // Remove from scene
  47. var index = this.getScene().lights.indexOf(this);
  48. this.getScene().lights.splice(index, 1);
  49. };
  50. return Light;
  51. })(BABYLON.Node);
  52. BABYLON.Light = Light;
  53. })(BABYLON || (BABYLON = {}));
  54. //# sourceMappingURL=babylon.light.js.map