| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsCorePrerequisites.h" |
| 6 | #include "Reflection/BsRTTIType.h" |
| 7 | #include "Renderer/BsCamera.h" |
| 8 | |
| 9 | namespace bs |
| 10 | { |
| 11 | /** @cond RTTI */ |
| 12 | /** @addtogroup RTTI-Impl-Engine |
| 13 | * @{ |
| 14 | */ |
| 15 | |
| 16 | class BS_CORE_EXPORT CameraRTTI : public RTTIType <Camera, IReflectable, CameraRTTI> |
| 17 | { |
| 18 | private: |
| 19 | BS_BEGIN_RTTI_MEMBERS |
| 20 | BS_RTTI_MEMBER_REFLPTR(mViewport, 0) |
| 21 | BS_RTTI_MEMBER_PLAIN(mLayers, 1) |
| 22 | BS_RTTI_MEMBER_REFL(mTransform, 2) |
| 23 | BS_RTTI_MEMBER_PLAIN(mActive, 3) |
| 24 | BS_RTTI_MEMBER_PLAIN(mMobility, 4) |
| 25 | BS_RTTI_MEMBER_PLAIN(mProjType, 5) |
| 26 | BS_RTTI_MEMBER_PLAIN(mHorzFOV, 6) |
| 27 | BS_RTTI_MEMBER_PLAIN(mFarDist, 7) |
| 28 | BS_RTTI_MEMBER_PLAIN(mNearDist, 8) |
| 29 | BS_RTTI_MEMBER_PLAIN(mAspect, 9) |
| 30 | BS_RTTI_MEMBER_PLAIN(mOrthoHeight, 10) |
| 31 | BS_RTTI_MEMBER_PLAIN(mPriority, 11) |
| 32 | BS_RTTI_MEMBER_PLAIN(mCustomViewMatrix, 12) |
| 33 | BS_RTTI_MEMBER_PLAIN(mCustomProjMatrix, 13) |
| 34 | BS_RTTI_MEMBER_PLAIN(mFrustumExtentsManuallySet, 14) |
| 35 | BS_RTTI_MEMBER_PLAIN(mProjMatrixRS, 15) |
| 36 | BS_RTTI_MEMBER_PLAIN(mProjMatrix, 16) |
| 37 | BS_RTTI_MEMBER_PLAIN(mViewMatrix, 17) |
| 38 | BS_RTTI_MEMBER_PLAIN(mLeft, 18) |
| 39 | BS_RTTI_MEMBER_PLAIN(mRight, 19) |
| 40 | BS_RTTI_MEMBER_PLAIN(mTop, 20) |
| 41 | BS_RTTI_MEMBER_PLAIN(mBottom, 21) |
| 42 | BS_RTTI_MEMBER_PLAIN(mMSAA, 22) |
| 43 | BS_RTTI_MEMBER_REFLPTR(mRenderSettings, 23) |
| 44 | BS_RTTI_MEMBER_PLAIN(mMain, 24) |
| 45 | BS_END_RTTI_MEMBERS |
| 46 | |
| 47 | public: |
| 48 | void onDeserializationEnded(IReflectable* obj, SerializationContext* context) override |
| 49 | { |
| 50 | // Note: Since this is a CoreObject I should call initialize() right after deserialization, |
| 51 | // but since this specific type is used in Components we delay initialization until Component |
| 52 | // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component |
| 53 | // purposes (you'll need to call initialize manually). |
| 54 | } |
| 55 | |
| 56 | const String& getRTTIName() override |
| 57 | { |
| 58 | static String name = "Camera" ; |
| 59 | return name; |
| 60 | } |
| 61 | |
| 62 | UINT32 getRTTIId() override |
| 63 | { |
| 64 | return TID_Camera; |
| 65 | } |
| 66 | |
| 67 | SPtr<IReflectable> newRTTIObject() override |
| 68 | { |
| 69 | return Camera::createEmpty(); |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | /** @} */ |
| 74 | /** @endcond */ |
| 75 | } |
| 76 | |