Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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 12 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsBody.WindInput

Static Fields

Value

Description

MaxForceThe maximum magnitude allowed for each component of _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 _mask defaults to PhysicsMask.All so every attached shape contributes unless explicitly filtered out.

Properties

Property

Description

dragDrag coefficient. Scales the wind contribution in the relative-velocity term that drives the per-shape aerodynamic force.
forceThe wind velocity vector. Scaled by _drag when computing the per-shape aerodynamic relative velocity. Each component's magnitude is clamped to PhysicsBody.WindInput.MaxForce.
liftLift coefficient. Scales the perpendicular component of the per-edge aerodynamic force (capsules and polygons only; circles ignore lift).
maskCategory 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.
useTriggersWhen true, trigger shapes contribute to wind alongside solid shapes. When false, trigger shapes are skipped.