Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * -------------------------------------------
  3. * Magic AR Basketball
  4. * A demo game of the encantar.js WebAR engine
  5. * -------------------------------------------
  6. * @fileoverview The lights of the virtual scene
  7. * @author Alexandre Martins <alemartf(at)gmail.com> (https://github.com/alemart/encantar-js)
  8. */
  9. import { Entity } from './entity.js';
  10. /**
  11. * The lights of the virtual scene
  12. */
  13. export class Lights extends Entity
  14. {
  15. /**
  16. * Initialize the entity
  17. * @returns {void}
  18. */
  19. init()
  20. {
  21. const light = new BABYLON.HemisphericLight('light', BABYLON.Vector3.Up());
  22. const dlight = new BABYLON.DirectionalLight('dlight', BABYLON.Vector3.Down());
  23. light.intensity = 1.0;
  24. light.diffuse.set(1, 1, 1);
  25. light.groundColor.set(1, 1, 1);
  26. light.specular.set(0, 0, 0);
  27. dlight.intensity = 1.0;
  28. dlight.diffuse.set(1, 1, 1);
  29. dlight.specular.set(1, 1, 1);
  30. const ar = this.ar;
  31. dlight.parent = ar.root;
  32. }
  33. }