BsLightRTTI.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "Reflection/BsRTTIType.h"
  6. #include "Renderer/BsLight.h"
  7. namespace bs
  8. {
  9. /** @cond RTTI */
  10. /** @addtogroup RTTI-Impl-Engine
  11. * @{
  12. */
  13. class BS_CORE_EXPORT LightRTTI : public RTTIType <Light, IReflectable, LightRTTI>
  14. {
  15. private:
  16. BS_BEGIN_RTTI_MEMBERS
  17. BS_RTTI_MEMBER_REFL(mTransform, 0)
  18. BS_RTTI_MEMBER_PLAIN(mActive, 1)
  19. BS_RTTI_MEMBER_PLAIN(mMobility, 2)
  20. BS_RTTI_MEMBER_PLAIN(mType, 3)
  21. BS_RTTI_MEMBER_PLAIN(mCastsShadows, 4)
  22. BS_RTTI_MEMBER_PLAIN(mColor, 5)
  23. BS_RTTI_MEMBER_PLAIN(mAttRadius, 6)
  24. BS_RTTI_MEMBER_PLAIN(mIntensity, 7)
  25. BS_RTTI_MEMBER_PLAIN(mSpotAngle, 8)
  26. BS_RTTI_MEMBER_PLAIN(mSpotFalloffAngle, 9)
  27. BS_RTTI_MEMBER_PLAIN(mAutoAttenuation, 10)
  28. BS_RTTI_MEMBER_PLAIN(mSourceRadius, 11)
  29. BS_RTTI_MEMBER_PLAIN(mShadowBias, 12)
  30. BS_END_RTTI_MEMBERS
  31. public:
  32. LightRTTI()
  33. :mInitMembers(this)
  34. { }
  35. void onDeserializationEnded(IReflectable* obj, const UnorderedMap<String, UINT64>& params) override
  36. {
  37. // Note: Since this is a CoreObject I should call initialize() right after deserialization,
  38. // but since this specific type is used in Components we delay initialization until Component
  39. // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
  40. // purposes (you'll need to call initialize manually).
  41. }
  42. const String& getRTTIName() override
  43. {
  44. static String name = "Light";
  45. return name;
  46. }
  47. UINT32 getRTTIId() override
  48. {
  49. return TID_Light;
  50. }
  51. SPtr<IReflectable> newRTTIObject() override
  52. {
  53. return Light::createEmpty();
  54. }
  55. };
  56. /** @} */
  57. /** @endcond */
  58. }