Struct WheelClosestHitCollector
Collector for the wheel casst hits. Stores the closest hit that is not a hit to a vehicle collider.
Implements
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
public struct WheelClosestHitCollector : ICollector<ColliderCastHit>
Constructors
WheelClosestHitCollector(Entity)
Constructor
Declaration
public WheelClosestHitCollector(Entity vehicleEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| Entity | vehicleEntity | The vehicle entity |
Properties
ClosestHit
Closest valid hit.
Declaration
public ColliderCastHit ClosestHit { get; }
Property Value
| Type | Description |
|---|---|
| ColliderCastHit |
EarlyOutOnFirstHit
Set to false as there might be invalid self hits.
Declaration
public bool EarlyOutOnFirstHit { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MaxFraction
Maximum fraction of cast distance within which the hits will register.
Declaration
public readonly float MaxFraction { get; }
Property Value
| Type | Description |
|---|---|
| float |
NumHits
Number of registered hits.
Declaration
public readonly int NumHits { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
AddHit(ColliderCastHit)
Callback on cast hit.
Declaration
public bool AddHit(ColliderCastHit hit)
Parameters
| Type | Name | Description |
|---|---|---|
| ColliderCastHit | hit | Hit info. |
Returns
| Type | Description |
|---|---|
| bool | True if the hit is valid. |