MLRSpotLight.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLRSPOTLIGHT_HPP
  6. #include "MLR.hpp"
  7. #include "MLRInfiniteLightWithFalloff.hpp"
  8. namespace MidLevelRenderer {
  9. //##########################################################################
  10. //######################## MLRSpotLight ##############################
  11. //##########################################################################
  12. class MLRSpotLight:
  13. public MLRInfiniteLightWithFalloff
  14. {
  15. public:
  16. static void
  17. InitializeClass();
  18. static void
  19. TerminateClass();
  20. MLRSpotLight();
  21. MLRSpotLight(
  22. Stuff::MemoryStream *stream,
  23. int version
  24. );
  25. MLRSpotLight(Stuff::Page *page);
  26. ~MLRSpotLight();
  27. void
  28. Save(Stuff::MemoryStream *stream);
  29. void
  30. Write(Stuff::Page *page);
  31. virtual LightType
  32. GetLightType()
  33. { Check_Object(this); return SpotLight; }
  34. //
  35. // spotlight spread. This value is only valid if the light had falloff
  36. //
  37. bool
  38. GetSpreadAngle(Stuff::Radian *angle);
  39. void
  40. SetSpreadAngle(const Stuff::Radian &radian);
  41. void
  42. SetSpreadAngle(const Stuff::Degree &degree);
  43. Stuff::Scalar
  44. GetTanSpreadAngle()
  45. { Check_Object(this); return tanSpreadAngle; }
  46. Stuff::Scalar
  47. GetCosSpreadAngle()
  48. { Check_Object(this); return cosSpreadAngle; }
  49. virtual void
  50. LightVertex(const MLRVertexData&);
  51. void
  52. SetLightMap(MLRLightMap *light_map);
  53. MLRLightMap *
  54. GetLightMap()
  55. {Check_Object(this); return lightMap; }
  56. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. // Class Data Support
  58. //
  59. public:
  60. static ClassData
  61. *DefaultData;
  62. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. // Testing
  64. //
  65. public:
  66. void
  67. TestInstance();
  68. protected:
  69. MLRLightMap *lightMap;
  70. Stuff::Radian
  71. spreadAngle;
  72. Stuff::Scalar
  73. tanSpreadAngle,
  74. cosSpreadAngle;
  75. };
  76. }