Gizmos.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System.Runtime.CompilerServices;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. public class Gizmos
  6. {
  7. public static Color color
  8. {
  9. get
  10. {
  11. Color value;
  12. Internal_GetColor(out value);
  13. return value;
  14. }
  15. set
  16. {
  17. Internal_SetColor(value);
  18. }
  19. }
  20. public static Matrix4 transform
  21. {
  22. get
  23. {
  24. Matrix4 value;
  25. Internal_GetTransform(out value);
  26. return value;
  27. }
  28. set
  29. {
  30. Internal_SetTransform(value);
  31. }
  32. }
  33. public static void DrawCube(Vector3 position, Vector3 extents)
  34. {
  35. Internal_DrawCube(position, extents);
  36. }
  37. public static void DrawSphere(Vector3 position, float radius)
  38. {
  39. Internal_DrawSphere(position, radius);
  40. }
  41. public static void DrawWireCube(Vector3 position, Vector3 extents)
  42. {
  43. Internal_DrawWireCube(position, extents);
  44. }
  45. public static void DrawWireSphere(Vector3 position, float radius)
  46. {
  47. Internal_DrawWireSphere(position, radius);
  48. }
  49. public static void DrawLine(Vector3 start, Vector3 end)
  50. {
  51. Internal_DrawLine(start, end);
  52. }
  53. public static void DrawFrustum(Vector3 position, float aspect, Degree FOV, float near, float far)
  54. {
  55. Internal_DrawFrustum(position, aspect, FOV, near, far);
  56. }
  57. public static void DrawIcon(Vector3 position, SpriteTexture image, bool fixedScale)
  58. {
  59. Internal_DrawIcon(position, image, fixedScale);
  60. }
  61. [MethodImpl(MethodImplOptions.InternalCall)]
  62. private static extern void Internal_SetColor(Color color);
  63. [MethodImpl(MethodImplOptions.InternalCall)]
  64. private static extern void Internal_GetColor(out Color color);
  65. [MethodImpl(MethodImplOptions.InternalCall)]
  66. private static extern void Internal_SetTransform(Matrix4 transform);
  67. [MethodImpl(MethodImplOptions.InternalCall)]
  68. private static extern void Internal_GetTransform(out Matrix4 transform);
  69. [MethodImpl(MethodImplOptions.InternalCall)]
  70. private static extern void Internal_DrawCube(Vector3 position, Vector3 extents);
  71. [MethodImpl(MethodImplOptions.InternalCall)]
  72. private static extern void Internal_DrawSphere(Vector3 position, float radius);
  73. [MethodImpl(MethodImplOptions.InternalCall)]
  74. private static extern void Internal_DrawWireCube(Vector3 position, Vector3 extents);
  75. [MethodImpl(MethodImplOptions.InternalCall)]
  76. private static extern void Internal_DrawWireSphere(Vector3 position, float radius);
  77. [MethodImpl(MethodImplOptions.InternalCall)]
  78. private static extern void Internal_DrawLine(Vector3 start, Vector3 end);
  79. [MethodImpl(MethodImplOptions.InternalCall)]
  80. private static extern void Internal_DrawFrustum(Vector3 position, float aspect, Degree FOV, float near, float far);
  81. [MethodImpl(MethodImplOptions.InternalCall)]
  82. private static extern void Internal_DrawIcon(Vector3 position, SpriteTexture image, bool fixedScale);
  83. }
  84. }