BsScriptLight.h 2.8 KB

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