BsScriptLight.h 2.3 KB

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