PhysicsBody.WindInput
Input to PhysicsBody.ApplyWind describing the wind velocity, drag and lift coefficients and the shape filter used to compute aerodynamic forces per attached shape.
Read time 1 minuteLast updated 15 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsBody.WindInput
Static Fields
Value | Description |
|---|---|
| MaxForce | The maximum magnitude allowed for each component of PhysicsBody.WindInput.force. Larger magnitudes have no useful effect because body speeds are capped each simulation step, so values are clamped into this range. |
Constructors
Constructor | Description |
|---|---|
| WindInput() | Create a default PhysicsBody.WindInput. The PhysicsBody.WindInput.mask defaults to PhysicsMask.All so every attached shape contributes unless explicitly filtered out. |
Properties
Property | Description |
|---|---|
| drag | Drag coefficient. Scales the wind contribution in the relative-velocity term that drives the per-shape aerodynamic force. |
| force | The wind velocity vector. Scaled by PhysicsBody.WindInput.drag when computing the per-shape aerodynamic relative velocity. Each component's magnitude is clamped to PhysicsBody.WindInput.MaxForce. |
| lift | Lift coefficient. Scales the perpendicular component of the per-edge aerodynamic force (capsules and polygons only; circles ignore lift). |
| mask | Category mask used to filter which attached shapes contribute. A shape participates iff (shape.contactFilter.categories.bitMask & mask.bitMask) != 0. Defaults to PhysicsMask.All when the input is created via the parameterless constructor. |
| useTriggers | When true, trigger shapes contribute to wind alongside solid shapes. When false, trigger shapes are skipped. |