Struct WheelHit
Contact information for a grounded wheel - updated every physics frame. Used for friction, suspension, surface detection, and effects. Only valid when WheelController.isGrounded is true. Vectors are world space unless noted as "local".
Namespace: NWH.WheelController3D
Assembly: NWH.WheelController.dll
Syntax
[Serializable]
public struct WheelHit
Fields
| Edit this page View Sourcecollider
Collider the wheel is touching. Null when airborne. Can be TerrainCollider, MeshCollider, etc. Used for surface type detection, terrain texture sampling, and triggering effects.
Declaration
[Tooltip("Ground collider the wheel is touching. Null when airborne.")]
[NonSerialized]
public Collider collider
Field Value
| Type | Description |
|---|---|
| Collider |
contactVelocity
Relative velocity between wheel and surface (m/s). Zero = perfect grip. Forward component = accel/brake slip, sideways = cornering slip. Adjusted for moving platforms automatically.
Declaration
[NonSerialized]
[Tooltip("Relative velocity between wheel and surface. Indicates slip.")]
public Vector3 contactVelocity
Field Value
| Type | Description |
|---|---|
| Vector3 |
hitRigidbody
Rigidbody of contacted object, or null for static geometry. Forces applied to it if otherBodyForceScale > 0. Enables moving platform support.
Declaration
[NonSerialized]
[Tooltip("Rigidbody of hit object. Null for static geometry.")]
public Rigidbody hitRigidbody
Field Value
| Type | Description |
|---|---|
| Rigidbody |
hitRigidbodyVelocity
Velocity of contacted Rigidbody at hit point (m/s). Zero for static objects. Used for moving platform support. Subtracted from wheel velocity for slip calculation.
Declaration
[NonSerialized]
[Tooltip("Velocity of hit object at contact point. Zero for static objects.")]
public Vector3 hitRigidbodyVelocity
Field Value
| Type | Description |
|---|---|
| Vector3 |
localNormal
Surface normal in wheel local space. (0,1,0) when upright on flat ground. Changes with steering and lean angle.
Declaration
[NonSerialized]
[Tooltip("Surface normal in wheel local space. Relative to wheel orientation.")]
public Vector3 localNormal
Field Value
| Type | Description |
|---|---|
| Vector3 |
localPoint
Contact point in wheel local space. Y = vertical position, Z = forward/backward on tire. Used internally for suspension compression calculations.
Declaration
[NonSerialized]
[Tooltip("Contact point in wheel local space. Used for suspension calculations.")]
public Vector3 localPoint
Field Value
| Type | Description |
|---|---|
| Vector3 |
normal
Surface normal in world space (normalized). Points away from ground - (0,1,0) on flat surfaces. Used for suspension force direction, slope detection, and friction calculations.
Declaration
[NonSerialized]
[Tooltip("Surface normal in world space. Points away from ground.")]
public Vector3 normal
Field Value
| Type | Description |
|---|---|
| Vector3 |
point
Contact point in world space. With 3D detection, this is the average across tire width. Used for force application, particle spawning, and sound positioning.
Declaration
[NonSerialized]
[Tooltip("Contact point in world space. Where wheel touches ground.")]
public Vector3 point
Field Value
| Type | Description |
|---|---|
| Vector3 |