BsReflectionProbeRTTI.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "BsRTTIType.h"
  6. #include "BsReflectionProbe.h"
  7. namespace bs
  8. {
  9. /** @cond RTTI */
  10. /** @addtogroup RTTI-Impl-Engine
  11. * @{
  12. */
  13. class BS_CORE_EXPORT ReflectionProbeRTTI : public RTTIType <ReflectionProbe, IReflectable, ReflectionProbeRTTI>
  14. {
  15. private:
  16. BS_BEGIN_RTTI_MEMBERS
  17. BS_RTTI_MEMBER_PLAIN(mPosition, 0)
  18. BS_RTTI_MEMBER_PLAIN(mRotation, 1)
  19. BS_RTTI_MEMBER_PLAIN(mType, 2)
  20. BS_RTTI_MEMBER_PLAIN(mRadius, 3)
  21. BS_RTTI_MEMBER_PLAIN(mExtents, 4)
  22. BS_RTTI_MEMBER_REFL(mCustomTexture, 5)
  23. BS_RTTI_MEMBER_PLAIN(mUUID, 6)
  24. BS_END_RTTI_MEMBERS
  25. public:
  26. ReflectionProbeRTTI()
  27. :mInitMembers(this)
  28. { }
  29. void onDeserializationEnded(IReflectable* obj, const UnorderedMap<String, UINT64>& params) override
  30. {
  31. // Note: Since this is a CoreObject I should call initialize() right after deserialization,
  32. // but since this specific type is used in Components we delay initialization until Component
  33. // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
  34. // purposes (you'll need to call initialize manually).
  35. }
  36. const String& getRTTIName() override
  37. {
  38. static String name = "ReflectionProbe";
  39. return name;
  40. }
  41. UINT32 getRTTIId() override
  42. {
  43. return TID_ReflectionProbe;
  44. }
  45. SPtr<IReflectable> newRTTIObject() override
  46. {
  47. return ReflectionProbe::createEmpty();
  48. }
  49. };
  50. /** @} */
  51. /** @endcond */
  52. }