Physics · interface
BodyDesc
Explained in Your first game, Rigid bodies.
interface BodyDescimport type { BodyDesc } from '@driftengine/physics';Properties
| Name | Type | Description |
|---|---|---|
typereadonly | BodyType | |
shapereadonlyoptional | ConvexShape | The body's shape, or absent where it is made of several. Exactly one of these two.MoreA body carrying both is refused at |
shapesreadonlyoptional | readonly ConvexShape[] | Several shapes, as one rigid body. What decomposeConvex produces, and where it goes.MoreNo offset and no rotation per part, because a Mass is Refused above |
densityreadonlyoptional | number | |
xreadonlyoptional | number | |
yreadonlyoptional | number | |
zreadonlyoptional | number | |
qxreadonlyoptional | number | Unit quaternion. Defaults to identity. |
qyreadonlyoptional | number | |
qzreadonlyoptional | number | |
qwreadonlyoptional | number | |
frictionreadonlyoptional | number | |
restitutionreadonlyoptional | number | |
layerreadonlyoptional | number | Which layers this body is on, and which it layersInteract with. 32 bits each. |
maskreadonlyoptional | number | |
sensorreadonlyoptional | boolean | A sensor reports overlap and is never pushed out of it. |