BsScriptRenderable.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. namespace BansheeEngine
  7. {
  8. class ScriptAnimation;
  9. /** @addtogroup ScriptInteropEngine
  10. * @{
  11. */
  12. /** Interop class between C++ & CLR for Renderable. */
  13. class BS_SCR_BE_EXPORT ScriptRenderable : public ScriptObject < ScriptRenderable >
  14. {
  15. public:
  16. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "NativeRenderable")
  17. /** Returns the native wrapped renderable. */
  18. SPtr<Renderable> getInternal() const { return mRenderable; }
  19. private:
  20. ScriptRenderable(MonoObject* managedInstance, const HSceneObject& parentSO);
  21. ~ScriptRenderable();
  22. /** Updates the internal transform of the renderable handled according to the scene object it is attached to. */
  23. void updateTransform(const HSceneObject& parent, bool force);
  24. /** Destroys the internal renderable object. */
  25. void destroy();
  26. /** @copydoc ScriptObject::_onManagedInstanceDeleted */
  27. void _onManagedInstanceDeleted() override;
  28. SPtr<Renderable> mRenderable;
  29. /************************************************************************/
  30. /* CLR HOOKS */
  31. /************************************************************************/
  32. static void internal_Create(MonoObject* instance, ScriptSceneObject* parentSO);
  33. static void internal_SetAnimation(ScriptRenderable* thisPtr, ScriptAnimation* animation);
  34. static void internal_UpdateTransform(ScriptRenderable* thisPtr, ScriptSceneObject* parentSO, bool force);
  35. static void internal_SetMesh(ScriptRenderable* thisPtr, ScriptMesh* mesh);
  36. static void internal_GetBounds(ScriptRenderable* thisPtr, ScriptSceneObject* parentSO, AABox* box, Sphere* sphere);
  37. static UINT64 internal_GetLayers(ScriptRenderable* thisPtr);
  38. static void internal_SetLayers(ScriptRenderable* thisPtr, UINT64 layers);
  39. static void internal_SetMaterial(ScriptRenderable* thisPtr, ScriptMaterial* material, int index);
  40. static void internal_SetMaterials(ScriptRenderable* thisPtr, MonoArray* materials);
  41. static void internal_OnDestroy(ScriptRenderable* thisPtr);
  42. };
  43. /** @} */
  44. }