BsCameraRTTI.h 2.3 KB

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