addBox method

int addBox(
  1. int body,
  2. Vec3 halfExtents, {
  3. Vec3 position = Vec3.zero,
  4. Quat rotation = Quat.identity,
})

Adds a box collider, by half its size on each axis, to body (or to the world, as a static collider, when body is 0), and returns its id.

Implementation

int addBox(int body, Vec3 halfExtents, {Vec3 position = Vec3.zero, Quat rotation = Quat.identity}) => _addCollider(
  body,
  FpShapeKind.FP_SHAPE_KIND_BOX,
  halfExtents.x,
  halfExtents.y,
  halfExtents.z,
  position,
  rotation,
);