Table of Contents

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

Point Vector3
Normal Vector3
Distance float
Collidable CollidableComponent
ChildIndex int

HitInfo(Vector3, Vector3, float, CollidableComponent, int)

public HitInfo(Vector3 point, Vector3 normal, float distance, CollidableComponent collidable, int childIndex)

Parameters

point Vector3
normal Vector3
distance float
collidable CollidableComponent
childIndex int

Properties

ChildIndex

The specific child hit if the Collidable's Collider is a CompoundCollider

public int ChildIndex { get; init; }

Property Value

int

Collidable

The collidable hit

public CollidableComponent Collidable { get; init; }

Property Value

CollidableComponent

Distance

The distance along the ray where the hit occured

public float Distance { get; init; }

Property Value

float

Normal

The direction of the surface hit

public Vector3 Normal { get; init; }

Property Value

Vector3

Point

The position where the intersection occured

public Vector3 Point { get; init; }

Property Value

Vector3

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

other HitInfo

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 other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.