HandleSliderDisc.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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);
  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 Quaternion NewRotation
  23. {
  24. get
  25. {
  26. Quaternion value;
  27. Internal_GetNewRotation(mCachedPtr, out value);
  28. return value;
  29. }
  30. }
  31. public Vector3 DeltaDirection
  32. {
  33. get
  34. {
  35. Vector3 value;
  36. Internal_GetDeltaDirection(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);
  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. }