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/BsLight.h"
8
9namespace bs
10{
11 /** @cond RTTI */
12 /** @addtogroup RTTI-Impl-Engine
13 * @{
14 */
15
16 class BS_CORE_EXPORT LightRTTI : public RTTIType <Light, IReflectable, LightRTTI>
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_PLAIN(mType, 3)
24 BS_RTTI_MEMBER_PLAIN(mCastsShadows, 4)
25 BS_RTTI_MEMBER_PLAIN(mColor, 5)
26 BS_RTTI_MEMBER_PLAIN(mAttRadius, 6)
27 BS_RTTI_MEMBER_PLAIN(mIntensity, 7)
28 BS_RTTI_MEMBER_PLAIN(mSpotAngle, 8)
29 BS_RTTI_MEMBER_PLAIN(mSpotFalloffAngle, 9)
30 BS_RTTI_MEMBER_PLAIN(mAutoAttenuation, 10)
31 BS_RTTI_MEMBER_PLAIN(mSourceRadius, 11)
32 BS_RTTI_MEMBER_PLAIN(mShadowBias, 12)
33 BS_END_RTTI_MEMBERS
34 public:
35 void onDeserializationEnded(IReflectable* obj, SerializationContext* context) override
36 {
37 // Note: Since this is a CoreObject I should call initialize() right after deserialization,
38 // but since this specific type is used in Components we delay initialization until Component
39 // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component
40 // purposes (you'll need to call initialize manually).
41 }
42
43 const String& getRTTIName() override
44 {
45 static String name = "Light";
46 return name;
47 }
48
49 UINT32 getRTTIId() override
50 {
51 return TID_Light;
52 }
53
54 SPtr<IReflectable> newRTTIObject() override
55 {
56 return Light::createEmpty();
57 }
58 };
59
60 /** @} */
61 /** @endcond */
62}
63