BsCameraRTTI.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "BsCamera.h"
  7. namespace BansheeEngine
  8. {
  9. /** @cond RTTI */
  10. /** @addtogroup RTTI-Impl-Engine
  11. * @{
  12. */
  13. class BS_CORE_EXPORT CameraRTTI : public RTTIType <Camera, IReflectable, CameraRTTI>
  14. {
  15. private:
  16. BS_BEGIN_RTTI_MEMBERS
  17. BS_RTTI_MEMBER_REFLPTR(mViewport, 0)
  18. BS_RTTI_MEMBER_PLAIN(mLayers, 1)
  19. BS_RTTI_MEMBER_PLAIN(mPosition, 2)
  20. BS_RTTI_MEMBER_PLAIN(mRotation, 3)
  21. BS_RTTI_MEMBER_PLAIN(mProjType, 4)
  22. BS_RTTI_MEMBER_PLAIN(mHorzFOV, 5)
  23. BS_RTTI_MEMBER_PLAIN(mFarDist, 6)
  24. BS_RTTI_MEMBER_PLAIN(mNearDist, 7)
  25. BS_RTTI_MEMBER_PLAIN(mAspect, 8)
  26. BS_RTTI_MEMBER_PLAIN(mOrthoHeight, 9)
  27. BS_RTTI_MEMBER_PLAIN(mPriority, 10)
  28. BS_RTTI_MEMBER_PLAIN(mCustomViewMatrix, 11)
  29. BS_RTTI_MEMBER_PLAIN(mCustomProjMatrix, 12)
  30. BS_RTTI_MEMBER_PLAIN(mFrustumExtentsManuallySet, 13)
  31. BS_RTTI_MEMBER_PLAIN(mProjMatrixRS, 15)
  32. BS_RTTI_MEMBER_PLAIN(mProjMatrix, 16)
  33. BS_RTTI_MEMBER_PLAIN(mViewMatrix, 17)
  34. BS_RTTI_MEMBER_PLAIN(mLeft, 18)
  35. BS_RTTI_MEMBER_PLAIN(mRight, 19)
  36. BS_RTTI_MEMBER_PLAIN(mTop, 20)
  37. BS_RTTI_MEMBER_PLAIN(mBottom, 21)
  38. BS_RTTI_MEMBER_PLAIN(mCameraFlags, 22)
  39. BS_RTTI_MEMBER_PLAIN(mMSAA, 23)
  40. /** BS_RTTI_MEMBER_PLAIN(mPPSettings, 24) */
  41. BS_RTTI_MEMBER_REFLPTR(mPPSettings, 25)
  42. BS_END_RTTI_MEMBERS
  43. public:
  44. CameraRTTI()
  45. :mInitMembers(this)
  46. { }
  47. void onDeserializationEnded(IReflectable* obj, const UnorderedMap<String, UINT64>& params) override
  48. {
  49. // Note: Since this is a CoreObject I should call initialize() right after deserialization,
  50. // but since this specific type is used in Components we delay initialization until Component
  51. // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
  52. // purposes (you'll need to call initialize manually).
  53. }
  54. const String& getRTTIName() override
  55. {
  56. static String name = "Camera";
  57. return name;
  58. }
  59. UINT32 getRTTIId() override
  60. {
  61. return TID_Camera;
  62. }
  63. SPtr<IReflectable> newRTTIObject() override
  64. {
  65. return Camera::createEmpty();
  66. }
  67. };
  68. BS_ALLOW_MEMCPY_SERIALIZATION(CameraFlags);
  69. /** @} */
  70. /** @endcond */
  71. }