Physics · interface

BuoyancyOptions

What water does to a body that falls in.

Explained in Your first game, Rigid bodies.

interface BuoyancyOptions
import type { BuoyancyOptions } from '@driftengine/physics';

In depth

Two things, and both are about momentum rather than about floating. A kinematic body has no mass to displace, so there is no buoyant force to compute — what a consumer actually wants is that falling in costs something, and that the drop settles instead of accelerating into the seabed.

Drag on every axis, not only the vertical one. Killing horizontal momentum is the whole reason falling in is a setback rather than a shortcut: a body that kept its speed underwater would be taking a faster line.

Zero game nouns, which is why it is here. What stays with a consumer is where the water is.

Properties

NameTypeDescription
leveloptionalnumberThe surface height. Default −Infinity, which is a world with no water in it.
More

A consumer that has not asked reaches none of this and pays for none of it.

dragoptionalnumberHow much of a body's speed a second of water takes, as a fraction.
sinkSpeedoptionalnumberThe fastest a submerged body sinks, metres a second. Negative is downward.