HandleSliderDisc.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. public sealed class HandleSliderDisc : HandleSlider
  7. {
  8. public HandleSliderDisc(Handle parentHandle, Vector3 normal, float radius, bool fixedScale = true, float snapValue = 0.0f)
  9. :base(parentHandle)
  10. {
  11. Internal_CreateInstance(this, normal, radius, fixedScale, snapValue);
  12. }
  13. public float Delta
  14. {
  15. get
  16. {
  17. float value;
  18. Internal_GetDelta(mCachedPtr, out value);
  19. return value;
  20. }
  21. }
  22. public Vector3 DeltaDirection
  23. {
  24. get
  25. {
  26. Vector3 value;
  27. Internal_GetDeltaDirection(mCachedPtr, out value);
  28. return value;
  29. }
  30. }
  31. public Quaternion NewRotation
  32. {
  33. get
  34. {
  35. Quaternion value;
  36. Internal_GetNewRotation(mCachedPtr, out value);
  37. return value;
  38. }
  39. }
  40. [MethodImpl(MethodImplOptions.InternalCall)]
  41. private static extern void Internal_CreateInstance(HandleSliderDisc instance, Vector3 normal, float radius, bool fixedScale, float snapValue);
  42. [MethodImpl(MethodImplOptions.InternalCall)]
  43. private static extern void Internal_GetDelta(IntPtr nativeInstance, out float value);
  44. [MethodImpl(MethodImplOptions.InternalCall)]
  45. private static extern void Internal_GetDeltaDirection(IntPtr nativeInstance, out Vector3 value);
  46. [MethodImpl(MethodImplOptions.InternalCall)]
  47. private static extern void Internal_GetNewRotation(IntPtr nativeInstance, out Quaternion value);
  48. }
  49. }