Physics · interface
Decomposition
Explained in Your first game, Rigid bodies.
interface Decompositionimport type { Decomposition } from '@driftengine/physics';Properties
| Name | Type | Description |
|---|---|---|
partsreadonly | readonly ConvexPart[] | |
sourceVolumereadonly | number | The voxelised source's volume. What bloat is measured against. |
hullVolumereadonly | number | The parts' volumes summed, which double-counts wherever two hulls overlap. |
bloatreadonly | number | (hullVolume - sourceVolume) / sourceVolume: the empty space the decomposition added.MoreThe number that says whether the decomposition is worth having. A single hull of a bowl has
an enormous one; a decomposition that respects the cavity has a small one. It is not a bound on
error in either direction — a hull can only add space, never remove it — which is why
|
coveragereadonly | number | The fraction of solid cells whose centre lies inside the part they were grown into.MoreBelow one, and that is the support sampling of |
resolutionreadonly | number | The grid that was used, which a caller who passed no resolution wants to know. |
cellsreadonly | number | Cells in that grid, all three axes multiplied. |