BsReflectionProbeRTTI.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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(mScale, 2)
  20. BS_RTTI_MEMBER_PLAIN(mType, 3)
  21. BS_RTTI_MEMBER_PLAIN(mRadius, 4)
  22. BS_RTTI_MEMBER_PLAIN(mExtents, 5)
  23. BS_RTTI_MEMBER_PLAIN(mTransitionDistance, 6)
  24. BS_RTTI_MEMBER_REFL(mCustomTexture, 7)
  25. BS_RTTI_MEMBER_PLAIN(mUUID, 8)
  26. BS_END_RTTI_MEMBERS
  27. public:
  28. ReflectionProbeRTTI()
  29. :mInitMembers(this)
  30. { }
  31. void onDeserializationEnded(IReflectable* obj, const UnorderedMap<String, UINT64>& params) override
  32. {
  33. // Note: Since this is a CoreObject I should call initialize() right after deserialization,
  34. // but since this specific type is used in Components we delay initialization until Component
  35. // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
  36. // purposes (you'll need to call initialize manually).
  37. }
  38. const String& getRTTIName() override
  39. {
  40. static String name = "ReflectionProbe";
  41. return name;
  42. }
  43. UINT32 getRTTIId() override
  44. {
  45. return TID_ReflectionProbe;
  46. }
  47. SPtr<IReflectable> newRTTIObject() override
  48. {
  49. return ReflectionProbe::createEmpty();
  50. }
  51. };
  52. /** @} */
  53. /** @endcond */
  54. }