Table of Contents

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

collider Collider
collisionBoxIndex int
fraction double
normal FastVec3d
startedOverlapping bool

Properties

Collider

public Collider Collider { get; }

Property Value

Collider

ColliderId

public long ColliderId { get; }

Property Value

long

CollisionBoxIndex

public int CollisionBoxIndex { get; }

Property Value

int

Fraction

public double Fraction { get; }

Property Value

double

Normal

The world-space unit normal pointing from the collider toward the query box.

public FastVec3d Normal { get; }

Property Value

FastVec3d

StartedOverlapping

public bool StartedOverlapping { get; }

Property Value

bool

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

other CollisionHit

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.