using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace BansheeEngine { /** @addtogroup Physics * @{ */ /// Hit information from a physics query. [StructLayout(LayoutKind.Sequential), SerializeObject] public partial struct PhysicsQueryHit { /// Initializes the struct with default values. public static PhysicsQueryHit Default() { PhysicsQueryHit value = new PhysicsQueryHit(); value.point = new Vector3(); value.normal = new Vector3(); value.uv = new Vector2(); value.distance = 0f; value.triangleIdx = 0; value.collider = null; return value; } /// Position of the hit in world space. public Vector3 point; /// Normal to the surface that was hit. public Vector3 normal; /// /// Barycentric coordinates of the triangle that was hit (only applicable when triangle meshes are hit). /// public Vector2 uv; /// Distance from the query origin to the hit position. public float distance; /// Index of the triangle that was hit (only applicable when triangle meshes are hit). public uint triangleIdx; /// /// Component of the collider that was hit. This may be null if the hit collider has no owner component, in which case /// refer to #colliderRaw. /// public Collider collider; } /** @} */ }