BsCameraRTTI.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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_RTTI_MEMBER_PLAIN(mMain, 24)
  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. /** @} */
  69. /** @endcond */
  70. }