BsScriptLight.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "BsScriptObject.h"
  6. #include "Math/BsDegree.h"
  7. #include "Image/BsColor.h"
  8. #include "Renderer/BsLight.h"
  9. namespace bs
  10. {
  11. /** @addtogroup ScriptInteropEngine
  12. * @{
  13. */
  14. /** Interop class between C++ & CLR for Light. */
  15. class BS_SCR_BE_EXPORT ScriptLight : public ScriptObject <ScriptLight>
  16. {
  17. public:
  18. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "NativeLight")
  19. /** Gets the wrapped native LightInternal object. */
  20. SPtr<Light> getInternal() const { return mLight; }
  21. private:
  22. ScriptLight(MonoObject* managedInstance, const HSceneObject& parentSO);
  23. ~ScriptLight();
  24. /** Destroys the internal light handler object. */
  25. void destroy();
  26. /** @copydoc ScriptObject::_onManagedInstanceDeleted */
  27. void _onManagedInstanceDeleted() override;
  28. SPtr<Light> mLight;
  29. UINT32 mLastUpdateHash;
  30. /************************************************************************/
  31. /* CLR HOOKS */
  32. /************************************************************************/
  33. static void internal_create(MonoObject* managedInstance, ScriptSceneObject* parentSO);
  34. static LightType internal_getType(ScriptLight* thisPtr);
  35. static void internal_setType(ScriptLight* thisPtr, LightType type);
  36. static bool internal_getCastsShadow(ScriptLight* thisPtr);
  37. static void internal_setCastsShadow(ScriptLight* thisPtr, bool castsShadow);
  38. static bool internal_getUseAutoAttenuation(ScriptLight* thisPtr);
  39. static void internal_setUseAutoAttenuation(ScriptLight* thisPtr, bool value);
  40. static void internal_getColor(ScriptLight* thisPtr, Color* color);
  41. static void internal_setColor(ScriptLight* thisPtr, Color color);
  42. static float internal_getAttenuationRadius(ScriptLight* thisPtr);
  43. static void internal_setAttenuationRadius(ScriptLight* thisPtr, float radius);
  44. static float internal_getSourceRadius(ScriptLight* thisPtr);
  45. static void internal_setSourceRadius(ScriptLight* thisPtr, float radius);
  46. static float internal_getIntensity(ScriptLight* thisPtr);
  47. static void internal_setIntensity(ScriptLight* thisPtr, float intensity);
  48. static float internal_getSpotAngle(ScriptLight* thisPtr);
  49. static void internal_setSpotAngle(ScriptLight* thisPtr, float spotAngle);
  50. static float internal_getSpotFalloffAngle(ScriptLight* thisPtr);
  51. static void internal_setSpotFalloffAngle(ScriptLight* thisPtr, float spotFalloffAngle);
  52. static void internal_getBounds(ScriptLight* thisPtr, Sphere* bounds);
  53. static void internal_updateTransform(ScriptLight* thisPtr, ScriptSceneObject* parent);
  54. static void internal_onDestroy(ScriptLight* instance);
  55. };
  56. /** @} */
  57. }