Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

PhysicsBody.ApplyWind

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void ApplyWind(WindInput input);

Parameters

Parameter Description
input The wind configuration. See WindInput.

Description

Apply wind forces to this body's attached shapes. Forces are continuous (not impulses) and are computed per shape by Box2D using the drag/lift coefficients in ; this method is expected to be called every simulation step while the body is exposed to the wind. The body must be PhysicsBody.BodyType.Dynamic; otherwise a warning is logged and the call is a no-op. Sleeping bodies are woken automatically by Box2D when the per-shape force is non-trivial.


Declaration

public static void ApplyWind(WindInput input, ReadOnlySpan<PhysicsBody> bodies);

Parameters

Parameter Description
input The wind configuration. See WindInput.
bodies The bodies that wind should be applied to.

Description

Apply wind forces to every body in by iterating each body's attached shapes. The same WindInput is applied to all bodies. Each body must be PhysicsBody.BodyType.Dynamic; non-dynamic or invalid bodies log a warning and are skipped. Forces are continuous (not impulses), so this is expected to be called every simulation step.


Declaration

public static void ApplyWind(PhysicsWorld world, PhysicsAABB aabb, WindInput input);

Parameters

Parameter Description
world The world to query for overlapping shapes.
aabb The world-space axis-aligned box describing the wind volume. Only shapes whose broadphase AABB overlaps this box are processed.
input The wind configuration. See WindInput.

Description

Apply wind forces to every dynamic body shape that overlaps in . The same WindInput is applied to all overlapping shapes. Shapes whose body is not PhysicsBody.BodyType.Dynamic are silently skipped. Forces are continuous (not impulses), so this is expected to be called every simulation step.