HandleSliderDisc.cs 1.7 KB

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