Light.cpp 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /***************************************************************************
  2. Light.cpp - description
  3. -------------------
  4. begin : Sun Jan 30 2000
  5. copyright : (C) 2000 by
  6. email :
  7. ***************************************************************************/
  8. #include <cstdlib>
  9. #include "Private.h"
  10. #include "Light.h"
  11. Light::Light(float c, float l, float q, float r, float g, float b) {
  12. m_bOn = true;
  13. p_Parent = NULL;
  14. m_fConstant = EM_MAX(c, 0.0);
  15. m_fLinear = EM_MAX(l, 0.0);
  16. m_fQuadratic = EM_MAX(q, 0.0);
  17. m_fBounds = 1.0;
  18. m_iProperties = EM_USE_DIFFUSE + EM_USE_SPECULAR;
  19. m_fR = EM_MAX(EM_MIN(1.0, r), 0.0);
  20. m_fG = EM_MAX(EM_MIN(1.0, g), 0.0);
  21. m_fB = EM_MAX(EM_MIN(1.0, b), 0.0);
  22. m_vtxSrc.x = 0;
  23. m_vtxSrc.y = 0;
  24. m_vtxSrc.z = 0;
  25. }
  26. Light::~Light() {
  27. }
  28. void Light::setProperty(int p) {
  29. m_iProperties |= p;
  30. }
  31. void Light::unsetProperty(int p) {
  32. m_iProperties -= (m_iProperties & p);
  33. }