PhysicsQueryHit.generated.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Physics
  7. * @{
  8. */
  9. /// <summary>Hit information from a physics query.</summary>
  10. [StructLayout(LayoutKind.Sequential), SerializeObject]
  11. public partial struct PhysicsQueryHit
  12. {
  13. /// <summary>Initializes the struct with default values.</summary>
  14. public static PhysicsQueryHit Default()
  15. {
  16. PhysicsQueryHit value = new PhysicsQueryHit();
  17. value.point = new Vector3();
  18. value.normal = new Vector3();
  19. value.uv = new Vector2();
  20. value.distance = 0f;
  21. value.triangleIdx = 0;
  22. value.collider = null;
  23. return value;
  24. }
  25. /// <summary>Position of the hit in world space.</summary>
  26. public Vector3 point;
  27. /// <summary>Normal to the surface that was hit.</summary>
  28. public Vector3 normal;
  29. /// <summary>
  30. /// Barycentric coordinates of the triangle that was hit (only applicable when triangle meshes are hit).
  31. /// </summary>
  32. public Vector2 uv;
  33. /// <summary>Distance from the query origin to the hit position.</summary>
  34. public float distance;
  35. /// <summary>Index of the triangle that was hit (only applicable when triangle meshes are hit).</summary>
  36. public uint triangleIdx;
  37. /// <summary>
  38. /// Component of the collider that was hit. This may be null if the hit collider has no owner component, in which case
  39. /// refer to #colliderRaw.
  40. /// </summary>
  41. public Collider collider;
  42. }
  43. /** @} */
  44. }