HandleDrawing.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using System.Runtime.CompilerServices;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. public sealed class HandleDrawing
  6. {
  7. public static void SetColor(Color color)
  8. {
  9. Internal_SetColor(color);
  10. }
  11. public static void SetTransform(Matrix4 transform)
  12. {
  13. Internal_SetTransform(transform);
  14. }
  15. public static void DrawCube(Vector3 position, Vector3 extents, float size = 1.0f)
  16. {
  17. Internal_DrawCube(position, extents, size);
  18. }
  19. public static void DrawSphere(Vector3 position, float radius, float size = 1.0f)
  20. {
  21. Internal_DrawSphere(position, radius, size);
  22. }
  23. public static void DrawWireCube(Vector3 position, Vector3 extents, float size = 1.0f)
  24. {
  25. Internal_DrawWireCube(position, extents, size);
  26. }
  27. public static void DrawWireSphere(Vector3 position, float radius, float size = 1.0f)
  28. {
  29. Internal_DrawWireSphere(position, radius, size);
  30. }
  31. public static void DrawCone(Vector3 coneBase, Vector3 normal, float height, float radius, float size = 1.0f)
  32. {
  33. Internal_DrawCone(coneBase, normal, height, radius, size);
  34. }
  35. public static void DrawLine(Vector3 start, Vector3 end, float size = 1.0f)
  36. {
  37. Internal_DrawLine(start, end, size);
  38. }
  39. public static void DrawDisc(Vector3 position, Vector3 normal, float radius, float size = 1.0f)
  40. {
  41. Internal_DrawDisc(position, normal, radius, size);
  42. }
  43. public static void DrawWireDisc(Vector3 position, Vector3 normal, float radius, float size = 1.0f)
  44. {
  45. Internal_DrawWireDisc(position, normal, radius, size);
  46. }
  47. public static void DrawArc(Vector3 position, Vector3 normal, float radius, Degree startAngle, Degree amountAngle, float size = 1.0f)
  48. {
  49. Internal_DrawArc(position, normal, radius, startAngle, amountAngle, size);
  50. }
  51. public static void DrawWireArc(Vector3 position, Vector3 normal, float radius, Degree startAngle, Degree amountAngle, float size = 1.0f)
  52. {
  53. Internal_DrawWireArc(position, normal, radius, startAngle, amountAngle, size);
  54. }
  55. public static void DrawRect(Rect3 area, float size = 1.0f)
  56. {
  57. Internal_DrawRect(area.center, area.axisHorz, area.axisVert, area.extentHorz, area.extentVert, size);
  58. }
  59. [MethodImpl(MethodImplOptions.InternalCall)]
  60. private static extern void Internal_SetColor(Color color);
  61. [MethodImpl(MethodImplOptions.InternalCall)]
  62. private static extern void Internal_SetTransform(Matrix4 transform);
  63. [MethodImpl(MethodImplOptions.InternalCall)]
  64. private static extern void Internal_DrawCube(Vector3 position, Vector3 extents, float size);
  65. [MethodImpl(MethodImplOptions.InternalCall)]
  66. private static extern void Internal_DrawSphere(Vector3 position, float radius, float size);
  67. [MethodImpl(MethodImplOptions.InternalCall)]
  68. private static extern void Internal_DrawWireCube(Vector3 position, Vector3 extents, float size);
  69. [MethodImpl(MethodImplOptions.InternalCall)]
  70. private static extern void Internal_DrawWireSphere(Vector3 position, float radius, float size);
  71. [MethodImpl(MethodImplOptions.InternalCall)]
  72. private static extern void Internal_DrawCone(Vector3 coneBase, Vector3 normal, float height, float radius, float size);
  73. [MethodImpl(MethodImplOptions.InternalCall)]
  74. private static extern void Internal_DrawLine(Vector3 start, Vector3 end, float size);
  75. [MethodImpl(MethodImplOptions.InternalCall)]
  76. private static extern void Internal_DrawDisc(Vector3 position, Vector3 normal, float radius, float size);
  77. [MethodImpl(MethodImplOptions.InternalCall)]
  78. private static extern void Internal_DrawWireDisc(Vector3 position, Vector3 normal, float radius, float size);
  79. [MethodImpl(MethodImplOptions.InternalCall)]
  80. private static extern void Internal_DrawArc(Vector3 position, Vector3 normal, float radius, Degree startAngle, Degree amountAngle, float size);
  81. [MethodImpl(MethodImplOptions.InternalCall)]
  82. private static extern void Internal_DrawWireArc(Vector3 position, Vector3 normal, float radius, Degree startAngle, Degree amountAngle, float size);
  83. [MethodImpl(MethodImplOptions.InternalCall)]
  84. private static extern void Internal_DrawRect(Vector3 center, Vector3 axisH, Vector3 axisV, float extentH, float extentV, float size);
  85. }
  86. }