You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

81 lines
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. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <cstring>
  14. #include <cstdlib>
  15. #include <lol/main.h>
  16. namespace lol
  17. {
  18. Light::Light()
  19. : m_color(1.f),
  20. m_type(LightType::Directional)
  21. {
  22. m_gamegroup = GAMEGROUP_BEFORE;
  23. m_drawgroup = DRAWGROUP_CAMERA;
  24. SetPosition(vec3::zero);
  25. }
  26. Light::~Light()
  27. {
  28. }
  29. void Light::SetType(LightType const &type)
  30. {
  31. m_type = type;
  32. }
  33. LightType Light::GetType()
  34. {
  35. return m_type;
  36. }
  37. void Light::SetPosition(vec3 const &pos)
  38. {
  39. m_position = pos;
  40. }
  41. vec3 Light::GetPosition()
  42. {
  43. return m_position;
  44. }
  45. void Light::SetColor(vec4 const &color)
  46. {
  47. m_color = color;
  48. }
  49. vec4 Light::GetColor()
  50. {
  51. return m_color;
  52. }
  53. void Light::TickGame(float seconds)
  54. {
  55. WorldEntity::TickGame(seconds);
  56. }
  57. void Light::TickDraw(float seconds, Scene &scene)
  58. {
  59. WorldEntity::TickDraw(seconds, scene);
  60. g_scene->AddLight(this);
  61. }
  62. } /* namespace lol */