eulerjs API / @eulerjs/marine / Buoyancy
Buoyancy
Defined in: packages/marine/src/Buoyancy.ts:64
Archimedes' principle per cell: each cell under the surface is pushed up by the weight of the water it displaces, at its own position, so a tilted hull is pushed back upright. One instance per body: it remembers each cell's depth between steps.
Implements
Constructors
Constructor
ts
new Buoyancy(options): Buoyancy;Defined in: packages/marine/src/Buoyancy.ts:88
Parameters
| Parameter | Type |
|---|---|
options | BuoyancyOptions |
Returns
Buoyancy
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
angularDrag | public | number | undefined | - | packages/marine/src/Buoyancy.ts:69 |
heaveDamping | public | number | undefined | - | packages/marine/src/Buoyancy.ts:66 |
lastForce | readonly | Vector3 | ... | Sum of the buoyant and damping forces applied on the last step, in world space. | packages/marine/src/Buoyancy.ts:76 |
linearDrag | public | number | undefined | - | packages/marine/src/Buoyancy.ts:68 |
minimumAngularDrag | public | number | undefined | - | packages/marine/src/Buoyancy.ts:71 |
minimumLinearDrag | public | number | undefined | - | packages/marine/src/Buoyancy.ts:70 |
ocean | readonly | Ocean<WaveSurface> | undefined | - | packages/marine/src/Buoyancy.ts:65 |
slamCoefficient | public | number | undefined | - | packages/marine/src/Buoyancy.ts:67 |
submergedFraction | public | number | 0 | Fraction of the hull's volume under water on the last step, from 0 to 1. | packages/marine/src/Buoyancy.ts:74 |
Accessors
voxels
Get Signature
ts
get voxels(): Voxels;Defined in: packages/marine/src/Buoyancy.ts:102
The cells the hull is sampled at, once the behaviour is attached to a body.
Returns
Methods
attach()
ts
attach(body): void;Defined in: packages/marine/src/Buoyancy.ts:107
Called by body.addBehavior(behavior).
Parameters
| Parameter | Type |
|---|---|
body | Body |
Returns
void
Implementation of
fixedUpdate()
ts
fixedUpdate(
body,
timestep,
world
): void;Defined in: packages/marine/src/Buoyancy.ts:121
Parameters
| Parameter | Type |
|---|---|
body | Body |
timestep | number |
world | World |
Returns
void
