NativeSphereCollider.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. namespace BansheeEngine
  6. {
  7. /** @cond INTEROP */
  8. /** @addtogroup Interop
  9. * @{
  10. */
  11. /// <summary>
  12. /// Wrapper around the native SphereCollider class.
  13. /// <see cref="SphereCollider"/>
  14. /// </summary>
  15. internal class NativeSphereCollider : NativeCollider
  16. {
  17. public NativeSphereCollider()
  18. {
  19. Internal_CreateInstance(this);
  20. }
  21. public float Radius
  22. {
  23. get { return Internal_GetRadius(mCachedPtr); }
  24. set { Internal_SetRadius(mCachedPtr, value); }
  25. }
  26. [MethodImpl(MethodImplOptions.InternalCall)]
  27. private static extern void Internal_CreateInstance(NativeSphereCollider instance);
  28. [MethodImpl(MethodImplOptions.InternalCall)]
  29. private static extern float Internal_GetRadius(IntPtr thisPtr);
  30. [MethodImpl(MethodImplOptions.InternalCall)]
  31. private static extern void Internal_SetRadius(IntPtr thisPtr, float radius);
  32. }
  33. /** @} */
  34. /** @endcond */
  35. }