Struct HitInfo
- Namespace
- Stride.BepuPhysics
- Assembly
- Stride.BepuPhysics.dll
Information returned by the different simulation test methods in BepuSimulation
public readonly record struct HitInfo : IComparable<HitInfo>, IEquatable<HitInfo>- Implements
- Inherited Members
Constructors
HitInfo(Vector3, Vector3, float, CollidableComponent, int)
Information returned by the different simulation test methods in BepuSimulation
public HitInfo(Vector3 Point, Vector3 Normal, float Distance, CollidableComponent Collidable, int ChildIndex)Parameters
- PointVector3
- NormalVector3
- Distancefloat
- CollidableCollidableComponent
- ChildIndexint
HitInfo(Vector3, Vector3, float, CollidableComponent, int)
public HitInfo(Vector3 point, Vector3 normal, float distance, CollidableComponent collidable, int childIndex)Parameters
- pointVector3
- normalVector3
- distancefloat
- collidableCollidableComponent
- childIndexint
Properties
ChildIndex
The specific child hit if the Collidable's Collider is a CompoundCollider
public int ChildIndex { get; init; }Property Value
Collidable
The collidable hit
public CollidableComponent Collidable { get; init; }Property Value
Distance
The distance along the ray where the hit occured
public float Distance { get; init; }Property Value
Normal
The direction of the surface hit
public Vector3 Normal { get; init; }Property Value
Point
The position where the intersection occured
public Vector3 Point { get; init; }Property Value
Methods
CompareTo(HitInfo)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(HitInfo other)Parameters
- otherHitInfo
- An object to compare with this instance. 
Returns
- int
- A value that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance precedes - otherin the sort order.- Zero - This instance occurs in the same position in the sort order as - other.- Greater than zero - This instance follows - otherin the sort order.