babylon.light.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. scene.lights.push(this);
  19. }
  20. Light.prototype.getShadowGenerator = function () {
  21. return this._shadowGenerator;
  22. };
  23. Light.prototype.transferToEffect = function (effect, uniformName0, uniformName1) {
  24. };
  25. Light.prototype._getWorldMatrix = function () {
  26. return BABYLON.Matrix.Identity();
  27. };
  28. Light.prototype.getWorldMatrix = function () {
  29. this._currentRenderId = this.getScene().getRenderId();
  30. var worldMatrix = this._getWorldMatrix();
  31. if (this.parent && this.parent.getWorldMatrix) {
  32. if (!this._parentedWorldMatrix) {
  33. this._parentedWorldMatrix = BABYLON.Matrix.Identity();
  34. }
  35. worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._parentedWorldMatrix);
  36. return this._parentedWorldMatrix;
  37. }
  38. return worldMatrix;
  39. };
  40. Light.prototype.dispose = function () {
  41. if (this._shadowGenerator) {
  42. this._shadowGenerator.dispose();
  43. this._shadowGenerator = null;
  44. }
  45. // Remove from scene
  46. var index = this.getScene().lights.indexOf(this);
  47. this.getScene().lights.splice(index, 1);
  48. };
  49. return Light;
  50. })(BABYLON.Node);
  51. BABYLON.Light = Light;
  52. })(BABYLON || (BABYLON = {}));
  53. //# sourceMappingURL=babylon.light.js.map