HandleSliderPlane.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. public class HandleSliderPlane : HandleSlider
  7. {
  8. public HandleSliderPlane(Vector3 dir1, Vector3 dir2, float length, bool fixedScale = true, float snapValue = 0.0f)
  9. {
  10. Internal_CreateInstance(this, dir1, dir2, length, 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 Vector3 NewPosition
  31. {
  32. get
  33. {
  34. Vector3 value;
  35. Internal_GetNewPosition(mCachedPtr, out value);
  36. return value;
  37. }
  38. }
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern void Internal_CreateInstance(HandleSliderPlane instance, Vector3 dir1, Vector3 dir2, float length, 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_GetNewPosition(IntPtr nativeInstance, out Vector3 value);
  47. }
  48. }