ドキュメント

Unity Engine

Unity Engine

ApplyBuoyancy(PhysicsAABB, BuoyancyInput, float)

Apply buoyancy, flow and damping forces to every dynamic body shape that overlaps aabb in this world. The same PhysicsBody.BuoyancyInput is applied to all overlapping shapes. Shapes whose body is not PhysicsBody.BodyType.Dynamic are silently skipped. Forces and torques are continuous (not impulses), so this is expected to be called every simulation step.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public void ApplyBuoyancy(PhysicsAABB aabb, PhysicsBody.BuoyancyInput input, float deltaTime)

Parameters

The world-space axis-aligned box describing the fluid volume. Only shapes whose broadphase AABB overlaps this box are processed.

The fluid and force configuration. See PhysicsBody.BuoyancyInput.

deltaTime

The simulation step duration in seconds. Used to clamp damping so it cannot overshoot in a single step.