Physics · function
faceVertices
Fill out with the vertex indices of one face, wound counter-clockwise seen from outside.
Explained in Your first game, Rigid bodies.
function faceVertices(shape: ConvexShape, face: number, out: Uint16Array): numberimport { faceVertices } from '@driftengine/physics';Parameters
| Parameter | Type | Description |
|---|---|---|
shape | ConvexShape | |
face | number | |
out | Uint16Array |
In depth
Returns how many were written. out must hold at least that many; a face cannot have more
vertices than the shape has, so new Uint16Array(shape.vertices.length / 3) always suffices.