Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

77 righe
1.2 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #include <lol/engine-internal.h>
  11. #include <cstring>
  12. #include <cstdlib>
  13. namespace lol
  14. {
  15. Light::Light()
  16. : m_color(1.f),
  17. m_type(LightType::Directional)
  18. {
  19. m_gamegroup = GAMEGROUP_LIGHT;
  20. m_drawgroup = DRAWGROUP_LIGHT;
  21. SetPosition(vec3::zero);
  22. }
  23. Light::~Light()
  24. {
  25. }
  26. void Light::SetType(LightType const &type)
  27. {
  28. m_type = type;
  29. }
  30. LightType Light::GetType()
  31. {
  32. return m_type;
  33. }
  34. void Light::SetPosition(vec3 const &pos)
  35. {
  36. m_position = pos;
  37. }
  38. vec3 Light::GetPosition()
  39. {
  40. return m_position;
  41. }
  42. void Light::SetColor(vec4 const &color)
  43. {
  44. m_color = color;
  45. }
  46. vec4 Light::GetColor()
  47. {
  48. return m_color;
  49. }
  50. void Light::TickGame(float seconds)
  51. {
  52. WorldEntity::TickGame(seconds);
  53. }
  54. void Light::TickDraw(float seconds, Scene &scene)
  55. {
  56. WorldEntity::TickDraw(seconds, scene);
  57. scene.AddLight(this);
  58. }
  59. } /* namespace lol */