babylon.hemisphericLight.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 HemisphericLight = (function (_super) {
  10. __extends(HemisphericLight, _super);
  11. function HemisphericLight(name, direction, scene) {
  12. _super.call(this, name, scene);
  13. this.direction = direction;
  14. this.groundColor = new BABYLON.Color3(0.0, 0.0, 0.0);
  15. }
  16. HemisphericLight.prototype.setDirectionToTarget = function (target) {
  17. this.direction = BABYLON.Vector3.Normalize(target.subtract(BABYLON.Vector3.Zero()));
  18. return this.direction;
  19. };
  20. HemisphericLight.prototype.getShadowGenerator = function () {
  21. return null;
  22. };
  23. HemisphericLight.prototype.transferToEffect = function (effect, directionUniformName, groundColorUniformName) {
  24. var normalizeDirection = BABYLON.Vector3.Normalize(this.direction);
  25. effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0);
  26. effect.setColor3(groundColorUniformName, this.groundColor.scale(this.intensity));
  27. };
  28. HemisphericLight.prototype._getWorldMatrix = function () {
  29. if (!this._worldMatrix) {
  30. this._worldMatrix = BABYLON.Matrix.Identity();
  31. }
  32. return this._worldMatrix;
  33. };
  34. return HemisphericLight;
  35. })(BABYLON.Light);
  36. BABYLON.HemisphericLight = HemisphericLight;
  37. })(BABYLON || (BABYLON = {}));
  38. //# sourceMappingURL=babylon.hemisphericLight.js.map