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/BsRenderable.h"
8
9namespace bs
10{
11 /** @cond RTTI */
12 /** @addtogroup RTTI-Impl-Engine
13 * @{
14 */
15
16 class BS_CORE_EXPORT RenderableRTTI : public RTTIType<Renderable, IReflectable, RenderableRTTI>
17 {
18 private:
19 BS_BEGIN_RTTI_MEMBERS
20 BS_RTTI_MEMBER_REFL(mTransform, 0)
21 BS_RTTI_MEMBER_PLAIN(mActive, 1)
22 BS_RTTI_MEMBER_PLAIN(mMobility, 2)
23 BS_RTTI_MEMBER_REFL(mMesh, 3)
24 BS_RTTI_MEMBER_PLAIN(mLayer, 4)
25 BS_RTTI_MEMBER_REFL_ARRAY(mMaterials, 5)
26 BS_RTTI_MEMBER_PLAIN(mCullDistanceFactor, 6)
27 BS_END_RTTI_MEMBERS
28
29 public:
30 void onDeserializationEnded(IReflectable* obj, SerializationContext* context) override
31 {
32 // Note: Since this is a CoreObject I should call initialize() right after deserialization,
33 // but since this specific type is used in Components we delay initialization until Component
34 // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
35 // purposes (you'll need to call initialize manually).
36 }
37
38 const String& getRTTIName() override
39 {
40 static String name = "Renderable";
41 return name;
42 }
43
44 UINT32 getRTTIId() override
45 {
46 return TID_Renderable;
47 }
48
49 SPtr<IReflectable> newRTTIObject() override
50 {
51 return Renderable::createEmpty();
52 }
53 };
54
55 /** @} */
56 /** @endcond */
57}
58