Struct CollisionHit
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
The collider snapshot remains valid after scene changes. Fractions run from zero to one along the supplied displacement, including endpoint contact.
public readonly struct CollisionHit : IComparable<CollisionHit>
- Implements
- Inherited Members
- Extension Methods
Constructors
CollisionHit(Collider, int, double, FastVec3d, bool)
public CollisionHit(Collider collider, int collisionBoxIndex, double fraction, FastVec3d normal, bool startedOverlapping)
Parameters
Properties
Collider
public Collider Collider { get; }
Property Value
ColliderId
public long ColliderId { get; }
Property Value
CollisionBoxIndex
public int CollisionBoxIndex { get; }
Property Value
Fraction
public double Fraction { get; }
Property Value
Normal
The world-space unit normal pointing from the collider toward the query box.
public FastVec3d Normal { get; }
Property Value
StartedOverlapping
public bool StartedOverlapping { get; }
Property Value
Methods
CompareTo(CollisionHit)
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(CollisionHit other)
Parameters
otherCollisionHitAn 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.