# 2D physics functions and components

```tsx
import {
  Capsule2D,
  Chain2D,
  PhysicsDebug2D,
  PhysicsShape2D,
  PhysicsWorld2D,
  Segment2D,
  circleShape2D,
  collider2D,
  pibblPhysicsBody2D,
  pibblPhysicsWorld2D,
  dynamicBody2D,
} from "@pibbl/core/physics/2d";
```

`@pibbl/core/physics/2d` is a component-scoped, Pibbl-scheduled Rapier 2D world. It
does not start a second animation loop. For recipes and interaction examples,
read the [2D physics guide](/guides/physics-2d/). Pure construction and
geometry operations are also exported by `@pibbl/core/physics/2d/geometry`.
The central contracts are
[`PibblPhysicsWorld2DProps`](/reference/types/physics-2d/#pibblphysicsworld2dprops),
[`PibblPhysicsBodyHandle2D`](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), and
[`PibblPhysicsShape2D`](/reference/types/physics-2d/#pibblphysicsshape2d).

## World and Canvas primitives

### `PhysicsWorld2D`

```tsx
const world = (
  <PhysicsWorld2D gravity={[0, 600]} fixedStepMilliseconds={1000 / 60} />
);
```

Creates one world for descendants. It owns fixed-step simulation, collision
delivery, presentation interpolation, and teardown. Default `space="root"`
uses root-logical coordinates; creation-only `space="local"` follows the
world's viewport transform. See
[`PibblPhysicsWorld2DProps`](/reference/types/physics-2d/#pibblphysicsworld2dprops).

### `pibblPhysicsWorld2D`

```text
function pibblPhysicsWorld2D(): PibblPhysicsWorldHandle2D;
```

Returns the nearest world while a descendant evaluates. Use it for world
queries, coordinate conversion, and inspection.

### `PhysicsShape2D`, `Capsule2D`, `Segment2D`, and `Chain2D`

Canvas primitives that paint exact supported shapes and accept `physics`:

```tsx
const primitiveShapes = (
  <>
    <PhysicsShape2D style={{ shape: circleShape2D({ radius: 8 }) }} />
    <Capsule2D style={{ start: [0, 0], end: [36, 0], radius: 5 }} />
    <Segment2D style={{ start: [0, 0], end: [60, 0] }} />
    <Chain2D
      style={{
        points: [
          [0, 0],
          [40, 0],
          [40, 24],
        ],
        radius: 2,
      }}
    />
  </>
);
```

Their props and styles are covered by the
[2D physics types](/reference/types/physics-2d/#physicsshape2dprops).

### `PhysicsDebug2D`

```tsx
const debug = (
  <PhysicsDebug2D world={pibblPhysicsWorld2D()} color="rgba(0, 160, 255, .8)" />
);
```

Renders a read-only diagnostic overlay of committed collider bounds, centers
of mass, contact points, and contact normals. It creates no pointer targets,
does not advance the world, and is appropriate for tests and development-only
scenes.

### `withPhysicsShape2D`

```text
function withPhysicsShape2D<P, I, ResolvedStyle>(
  component: PibblPrimitiveComponent<P, I>,
  options: { resolveShape(style: Readonly<ResolvedStyle>): PibblPhysicsShape2D },
): PibblPrimitiveComponent<
  P & PibblPhysicsPrimitiveProps2D,
  I & { physics?: PibblPhysicsAttachment2D }
>;
```

Derives a primitive that resolves an immutable shape synchronously from its
resolved style. This is the custom-primitive extension point; it does not mount
a world or alter paint order.

## Descriptor and handle factories

```text
function dynamicBody2D(
  options?: PibblPhysicsDynamicBody2DOptions,
): PibblPhysicsBodyAttachment2D;
function staticBody2D(
  options?: PibblPhysicsStaticBody2DOptions,
): PibblPhysicsBodyAttachment2D;
function kinematicBody2D(
  options?: PibblPhysicsKinematicBody2DOptions,
): PibblPhysicsBodyAttachment2D;
function collider2D(
  options?: PibblPhysicsColliderConfiguration2D,
): PibblPhysicsColliderAttachment2D;
function pibblPhysicsBody2D(): PibblPhysicsBodyHandle2D;
```

Attach a body descriptor to a primitive and child `collider2D()` descriptors to
its geometry. Dynamic bodies receive forces and contacts; static bodies remain
fixed; kinematic bodies follow declared signals and affect other bodies. The
body primitive's authored transform supplies its initial pose. `pibblPhysicsBody2D`
is a stable hook handle that can bind to one live body at a time.

## Commands

Commands enter Pibbl's Begin phase and take effect on the next admitted physics
frame; none mutate a world during render.

```text
function applyForce2D(
  body: PibblPhysicsBodyHandle2D,
  force: PibblPhysicsVector2,
  options?: { at?: PibblPhysicsVector2; wake?: boolean },
): void;
function applyImpulse2D(
  body: PibblPhysicsBodyHandle2D,
  impulse: PibblPhysicsVector2,
  options?: { at?: PibblPhysicsVector2; wake?: boolean },
): void;
function applyTorque2D(body: PibblPhysicsBodyHandle2D, torque: number): void;
function setLinearVelocity2D(
  body: PibblPhysicsBodyHandle2D,
  velocity: PibblPhysicsVector2,
): void;
function setAngularVelocity2D(
  body: PibblPhysicsBodyHandle2D,
  degreesPerSecond: number,
): void;
function teleportBody2D(
  body: PibblPhysicsBodyHandle2D,
  pose: PibblPhysicsPose2D,
): void;
function wakeBody2D(body: PibblPhysicsBodyHandle2D): void;
function sleepBody2D(body: PibblPhysicsBodyHandle2D): void;
function disableBody2D(body: PibblPhysicsBodyHandle2D): void;
function enableBody2D(
  body: PibblPhysicsBodyHandle2D,
  options?: { velocity?: "zero" | "preserve" },
): void;
```

`at` is a world-space application point. Teleportation sets a pose without a
sweep. Re-enabling uses zero velocity unless `preserve` is selected.

## Mounted-world queries and observation

```text
function raycastAny2D(
  world: PibblPhysicsWorldHandle2D,
  ray: PibblPhysicsRay2D,
  options?: PibblPhysicsQueryOptions2D,
): boolean;
function raycastClosest2D(
  world: PibblPhysicsWorldHandle2D,
  ray: PibblPhysicsRay2D,
  options?: PibblPhysicsQueryOptions2D,
): PibblPhysicsQueryHit2D | null;
function raycastAll2D(
  world: PibblPhysicsWorldHandle2D,
  ray: PibblPhysicsRay2D,
  options?: PibblPhysicsQueryOptions2D,
): readonly PibblPhysicsQueryHit2D[];
function shapeCastAny2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  from: PibblPhysicsPose2D,
  translation: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): boolean;
function shapeCastClosest2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  from: PibblPhysicsPose2D,
  translation: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): PibblPhysicsQueryHit2D | null;
function shapeCastAll2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  from: PibblPhysicsPose2D,
  translation: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): readonly PibblPhysicsQueryHit2D[];
function hasShapeOverlap2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  pose: PibblPhysicsPose2D,
  options?: PibblPhysicsQueryOptions2D,
): boolean;
function findShapeOverlap2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  pose: PibblPhysicsPose2D,
  options?: PibblPhysicsQueryOptions2D,
): PibblPhysicsQueryMatch2D | null;
function findAllShapeOverlaps2D(
  world: PibblPhysicsWorldHandle2D,
  shape: PibblPhysicsShape2D,
  pose: PibblPhysicsPose2D,
  options?: PibblPhysicsQueryOptions2D,
): readonly PibblPhysicsQueryMatch2D[];
function hasAabbMatch2D(
  world: PibblPhysicsWorldHandle2D,
  bounds: PibblPhysicsAabb2D,
  options?: PibblPhysicsQueryOptions2D,
): boolean;
function findAabbMatch2D(
  world: PibblPhysicsWorldHandle2D,
  bounds: PibblPhysicsAabb2D,
  options?: PibblPhysicsQueryOptions2D,
): PibblPhysicsQueryMatch2D | null;
function findAllAabbMatches2D(
  world: PibblPhysicsWorldHandle2D,
  bounds: PibblPhysicsAabb2D,
  options?: PibblPhysicsQueryOptions2D,
): readonly PibblPhysicsQueryMatch2D[];
function hasPointMatch2D(
  world: PibblPhysicsWorldHandle2D,
  point: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): boolean;
function findPointMatch2D(
  world: PibblPhysicsWorldHandle2D,
  point: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): PibblPhysicsQueryMatch2D | null;
function findAllPointMatches2D(
  world: PibblPhysicsWorldHandle2D,
  point: PibblPhysicsVector2,
  options?: PibblPhysicsQueryOptions2D,
): readonly PibblPhysicsQueryMatch2D[];
function toPhysicsPoint2D(
  world: PibblPhysicsWorldHandle2D,
  point: PibblPhysicsVector2,
): PibblPhysicsVector2;
function fromPhysicsPoint2D(
  world: PibblPhysicsWorldHandle2D,
  point: PibblPhysicsVector2,
): PibblPhysicsVector2;
function inspectPhysics2D(
  world: PibblPhysicsWorldHandle2D,
): PibblPhysicsInspection2D;
function inspectPhysics2D(
  body: PibblPhysicsBodyHandle2D,
): PibblPhysicsBodyInspection2D | undefined;
```

Queries read the committed world and accept filtering options. Each named operation returns a
fixed boolean, nullable record, or readonly array contract. The point helpers cross
between root-logical and simulation coordinates. `inspectPhysics2D(world)`
returns an immutable JSON-safe world observation without advancing, restoring,
or scheduling. `inspectPhysics2D(body)` returns only that body's observation;
an unbound or stale handle returns `undefined`.

## Pure shapes and geometry

`circleShape2D`, `ellipseShape2D`, `boxShape2D`, `roundedBoxShape2D`,
`capsuleShape2D`, `arcShape2D`, `wedgeShape2D`, `segmentShape2D`,
`chainShape2D`, and `polygonShape2D` each create an immutable
[`PibblPhysicsShape2D`](/reference/types/physics-2d/#pibblphysicsshape2d) from their
corresponding option object.

```text
function boundsOfShape2D(shape: PibblPhysicsShape2D): PibblPhysicsAabb2D;
function massProperties2D(
  shape: PibblPhysicsShape2D,
  density?: number,
): PibblPhysicsMassProperties2D;
function transformShape2D(
  shape: PibblPhysicsShape2D,
  transform: PibblPhysicsTransform2D,
): PibblPhysicsShape2D;
function containsPoint2D(
  shape: PibblPhysicsShape2D,
  pose: PibblPhysicsPose2D,
  point: PibblPhysicsVector2,
): boolean;
function distanceBetweenShapes2D(
  first: PibblPhysicsShape2D,
  firstPose: PibblPhysicsPose2D,
  second: PibblPhysicsShape2D,
  secondPose: PibblPhysicsPose2D,
): PibblPhysicsDistance2D;
function overlapShapes2D(
  first: PibblPhysicsShape2D,
  firstPose: PibblPhysicsPose2D,
  second: PibblPhysicsShape2D,
  secondPose: PibblPhysicsPose2D,
): boolean;
function contactBetweenShapes2D(
  first: PibblPhysicsShape2D,
  firstPose: PibblPhysicsPose2D,
  second: PibblPhysicsShape2D,
  secondPose: PibblPhysicsPose2D,
): PibblPhysicsShapeContact2D | null;
function raycastShape2D(
  shape: PibblPhysicsShape2D,
  pose: PibblPhysicsPose2D,
  ray: PibblPhysicsRay2D,
  options?: { includeInitialOverlap?: boolean },
): PibblPhysicsShapeHit2D | null;
function shapeCastAgainstShape2D(
  moving: PibblPhysicsShape2D,
  from: PibblPhysicsPose2D,
  translation: PibblPhysicsVector2,
  target: PibblPhysicsShape2D,
  targetPose: PibblPhysicsPose2D,
  options?: { includeInitialOverlap?: boolean },
): PibblPhysicsShapeHit2D | null;
```

These deterministic functions need neither a mounted world nor Pibbl core.
`transformShape2D` returns a new descriptor. Contact normals point from the
second shape toward the first.

## Fixed query return contracts

| Query        | Boolean             | One result or `null` | Readonly result array    |
| ------------ | ------------------- | -------------------- | ------------------------ |
| raycast      | `raycastAny2D`      | `raycastClosest2D`   | `raycastAll2D`           |
| shapeCast    | `shapeCastAny2D`    | `shapeCastClosest2D` | `shapeCastAll2D`         |
| overlapShape | `hasShapeOverlap2D` | `findShapeOverlap2D` | `findAllShapeOverlaps2D` |
| queryAabb    | `hasAabbMatch2D`    | `findAabbMatch2D`    | `findAllAabbMatches2D`   |
| queryPoint   | `hasPointMatch2D`   | `findPointMatch2D`   | `findAllPointMatches2D`  |

All functions accept `PibblPhysicsQueryOptions2D` for sensor policy, collision
filtering, and exclusions. There is no `mode` option. Boolean queries stop at
the first match. Cast results sort by time of impact, distance, then collider
index and generation. Overlap, bounds, and point results sort by collider index
and generation; `find…` returns the first in that order, not a nearest match.
Returned result arrays are frozen; no matches produce `false`, `null`, or an
empty array according to the named operation.

## API details from source

<span id="api-arcShape2D"></span>

### arcShape2D

Creates an immutable arc collision shape without initializing a physics world.

```ts
arcShape2D: (input: Readonly<{ center?: PibblPhysicsVector2; radius: number; startAngleRadians: number; endAngleRadians: number; counterclockwise?: boolean; thickness: number; }>) => PibblPhysicsShape2D
```

Related API: [arcShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Arc center, radius, angular endpoints in radians, sweep direction, and thickness.
See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

An immutable thick-arc collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:232](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L232)

<span id="api-boundsOfShape2D"></span>

### boundsOfShape2D

Computes axis-aligned bounds for an immutable shape at an optional pose.

```ts
boundsOfShape2D: (shape: PibblPhysicsShape2D, pose?: PibblPhysicsPose2D) => PibblPhysicsAabb2D
```

Related API: [boundsOfShape2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d).

#### Parameters

- **`shape`** — Shape whose bounds are needed. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`pose`** — Optional pose at which to evaluate the shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Returns

Axis-aligned bounds of the posed shape. See [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d).

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:391](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L391)

<span id="api-boxShape2D"></span>

### boxShape2D

Creates an immutable box collision shape without initializing a physics world.

```ts
boxShape2D: (input: Readonly<{ width: number; height: number; center?: PibblPhysicsVector2; }>) => PibblPhysicsShape2D
```

Related API: [boxShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Box width, height, and optional center. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

An immutable box collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:107](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L107)

<span id="api-capsuleShape2D"></span>

### capsuleShape2D

Creates an immutable capsule collision shape without initializing a physics world.

```ts
capsuleShape2D: (input: Readonly<{ start: PibblPhysicsVector2; end: PibblPhysicsVector2; radius: number; }>) => PibblPhysicsShape2D
```

Related API: [capsuleShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Capsule centerline endpoints and radius. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

An immutable capsule collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:199](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L199)

<span id="api-chainShape2D"></span>

### chainShape2D

Creates an immutable chain collision shape without initializing a physics world.

```ts
chainShape2D: (input: Readonly<{ points: readonly PibblPhysicsVector2[]; closed?: boolean; radius?: number; }>) => PibblPhysicsShape2D
```

Related API: [chainShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Ordered chain points, closure policy, and optional radius. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

An immutable chain collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:337](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L337)

<span id="api-circleShape2D"></span>

### circleShape2D

Creates an immutable circle collision shape without initializing a physics world.

```ts
circleShape2D: (input: Readonly<{ radius: number; center?: PibblPhysicsVector2; }>) => PibblPhysicsShape2D
```

Related API: [circleShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Circle radius and optional center. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

An immutable circle collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:49](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L49)

<span id="api-ellipseShape2D"></span>

### ellipseShape2D

Creates an immutable ellipse collision shape without initializing a physics world.

```ts
ellipseShape2D: (input: Readonly<{ radiusX: number; radiusY: number; center?: PibblPhysicsVector2; rotationDegrees?: number; }>) => PibblPhysicsShape2D
```

Related API: [ellipseShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Ellipse radii, optional center, and rotation in degrees. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

An immutable ellipse collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:74](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L74)

<span id="api-massProperties2D"></span>

### massProperties2D

Computes shape area, centroid, mass, and rotational inertia at the requested density.

```ts
massProperties2D: (shape: PibblPhysicsShape2D, options?: Readonly<{ density?: number; }>) => PibblPhysicsMassProperties2D
```

Related API: [massProperties2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsMassProperties2D](/reference/types/physics-2d/#pibblphysicsmassproperties2d).

#### Parameters

- **`shape`** — Shape whose mass properties are needed. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`options`** — Optional material density.

#### Returns

Mass, center of mass, and inertia for the shape. See [PibblPhysicsMassProperties2D](/reference/types/physics-2d/#pibblphysicsmassproperties2d).

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsMassProperties2D](/reference/types/physics-2d/#pibblphysicsmassproperties2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:411](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L411)

<span id="api-polygonShape2D"></span>

### polygonShape2D

Creates an immutable polygon collision shape without initializing a physics world.

```ts
polygonShape2D: (input: Readonly<{ points: readonly PibblPhysicsVector2[]; }>) => PibblPhysicsShape2D
```

Related API: [polygonShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Ordered polygon vertices. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

An immutable polygon collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:363](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L363)

<span id="api-roundedBoxShape2D"></span>

### roundedBoxShape2D

Creates an immutable rounded box collision shape without initializing a physics world.

```ts
roundedBoxShape2D: (input: Readonly<{ width: number; height: number; radius: number | readonly [topLeft: number, topRight: number, bottomRight: number, bottomLeft: number]; center?: PibblPhysicsVector2; }>) => PibblPhysicsShape2D
```

Related API: [roundedBoxShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Box dimensions, center, and uniform or per-corner radii. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

An immutable rounded-box collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:137](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L137)

<span id="api-segmentShape2D"></span>

### segmentShape2D

Creates an immutable segment collision shape without initializing a physics world.

```ts
segmentShape2D: (input: Readonly<{ start: PibblPhysicsVector2; end: PibblPhysicsVector2; }>) => PibblPhysicsShape2D
```

Related API: [segmentShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Segment endpoints. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

An immutable line-segment collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:313](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L313)

<span id="api-transformShape2D"></span>

### transformShape2D

Returns independent shape geometry transformed by a rigid 2D pose.

```ts
transformShape2D: (shape: PibblPhysicsShape2D, transform: PibblPhysicsTransform2D) => PibblPhysicsShape2D
```

Related API: [transformShape2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsTransform2D](/reference/types/physics-2d/#pibblphysicstransform2d).

#### Parameters

- **`shape`** — Source shape; it is not modified. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`transform`** — Transform to apply to the shape. See [PibblPhysicsTransform2D](/reference/types/physics-2d/#pibblphysicstransform2d).

#### Returns

A shape containing the transformed geometry. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsTransform2D](/reference/types/physics-2d/#pibblphysicstransform2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:446](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L446)

<span id="api-wedgeShape2D"></span>

### wedgeShape2D

Creates an immutable wedge collision shape without initializing a physics world.

```ts
wedgeShape2D: (input: Readonly<{ center?: PibblPhysicsVector2; radius: number; startAngleRadians: number; endAngleRadians: number; counterclockwise?: boolean; }>) => PibblPhysicsShape2D
```

Related API: [wedgeShape2D](/reference/functions/physics-2d/), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### Parameters

- **`input`** — Wedge center, radius, angular endpoints in radians, and sweep direction. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

An immutable wedge collision shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

#### See also

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[View source — packages/core/src/features/physics/lib/2d/shapes.ts:263](/source/packages/core/src/features/physics/lib/2d/shapes-ts/#L263)

<span id="api-containsPoint2D"></span>

### containsPoint2D

Tests whether a point lies within a posed shape without creating a physics world.

```ts
containsPoint2D: (shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, point: PibblPhysicsVector2) => boolean
```

Related API: [containsPoint2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`shape`** — Shape to test. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`pose`** — Shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`point`** — Point in the same coordinate space as the posed shape. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### Returns

Whether the posed shape contains the point.

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/2d-geometry.ts:209](/source/packages/core/src/features/physics/2d-geometry-ts/#L209)

<span id="api-distanceBetweenShapes2D"></span>

### distanceBetweenShapes2D

Computes signed separation and witness geometry between two posed shapes.

```ts
distanceBetweenShapes2D: (first: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, second: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D) => PibblPhysicsDistance2D
```

Related API: [distanceBetweenShapes2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsDistance2D](/reference/types/physics-2d/#pibblphysicsdistance2d).

#### Parameters

- **`first`** — First shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`firstPose`** — Pose of the first shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`second`** — Second shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`secondPose`** — Pose of the second shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Returns

Distance and closest-point information for the two posed shapes. See
[PibblPhysicsDistance2D](/reference/types/physics-2d/#pibblphysicsdistance2d) .

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsDistance2D](/reference/types/physics-2d/#pibblphysicsdistance2d)

[View source — packages/core/src/features/physics/2d-geometry.ts:231](/source/packages/core/src/features/physics/2d-geometry-ts/#L231)

<span id="api-overlapShapes2D"></span>

### overlapShapes2D

Tests whether two posed shapes overlap without creating a physics world.

```ts
overlapShapes2D: (first: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, second: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D) => boolean
```

Related API: [overlapShapes2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Parameters

- **`first`** — First shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`firstPose`** — Pose of the first shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`second`** — Second shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`secondPose`** — Pose of the second shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Returns

Whether the two posed shapes overlap.

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[View source — packages/core/src/features/physics/2d-geometry.ts:252](/source/packages/core/src/features/physics/2d-geometry-ts/#L252)

<span id="api-contactBetweenShapes2D"></span>

### contactBetweenShapes2D

Computes contact geometry for two posed shapes, or null when they do not contact.

```ts
contactBetweenShapes2D: (first: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, second: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D) => PibblPhysicsShapeContact2D | null
```

Related API: [contactBetweenShapes2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsShapeContact2D](/reference/types/physics-2d/#pibblphysicsshapecontact2d).

#### Parameters

- **`first`** — First shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`firstPose`** — Pose of the first shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`second`** — Second shape. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`secondPose`** — Pose of the second shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Returns

Contact information, or null when the shapes do not contact. See
[PibblPhysicsShapeContact2D](/reference/types/physics-2d/#pibblphysicsshapecontact2d) .

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsShapeContact2D](/reference/types/physics-2d/#pibblphysicsshapecontact2d)

[View source — packages/core/src/features/physics/2d-geometry.ts:275](/source/packages/core/src/features/physics/2d-geometry-ts/#L275)

<span id="api-raycastShape2D"></span>

### raycastShape2D

Casts a ray against one posed shape and returns its first hit or null.

```ts
raycastShape2D: (shape: PibblPhysicsShape2D, publicPose: PibblPhysicsPose2D, ray: PibblPhysicsRay2D, options?: Readonly<{ includeInitialOverlap?: boolean; }>) => PibblPhysicsShapeHit2D | null
```

Related API: [raycastShape2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d), [PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d).

#### Parameters

- **`shape`** — Shape to intersect. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`publicPose`** — Target shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`ray`** — Ray origin, direction, and travel limit. See [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d).

- **`options`** — Whether initial overlap counts as a hit.

#### Returns

The first shape hit, or null when there is no hit. See [PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d).

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d)

[PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d)

[View source — packages/core/src/features/physics/lib/2d/collision/casts.ts:68](/source/packages/core/src/features/physics/lib/2d/collision/casts-ts/#L68)

<span id="api-shapeCastAgainstShape2D"></span>

### shapeCastAgainstShape2D

Sweeps a posed shape along a translation against another posed shape and returns a hit or null.

```ts
shapeCastAgainstShape2D: (moving: PibblPhysicsShape2D, publicFrom: PibblPhysicsPose2D, publicTranslation: PibblPhysicsVector2, target: PibblPhysicsShape2D, publicTargetPose: PibblPhysicsPose2D, options?: Readonly<{ includeInitialOverlap?: boolean; }>) => PibblPhysicsShapeHit2D | null
```

Related API: [shapeCastAgainstShape2D](/reference/functions/physics-2d/), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d).

#### Parameters

- **`moving`** — Shape to sweep. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`publicFrom`** — Initial pose of the moving shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`publicTranslation`** — Translation vector for the sweep. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`target`** — Stationary shape to test against. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`publicTargetPose`** — Pose of the stationary shape. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`options`** — Whether initial overlap counts as a hit.

#### Returns

The first sweep hit, or null when there is no hit. See [PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d).

#### See also

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[PibblPhysicsShapeHit2D](/reference/types/physics-2d/#pibblphysicsshapehit2d)

[View source — packages/core/src/features/physics/lib/2d/collision/casts.ts:150](/source/packages/core/src/features/physics/lib/2d/collision/casts-ts/#L150)

<span id="api-PhysicsWorld2D"></span>

### PhysicsWorld2D

Owns one transparent, component-scoped 2D physics world.

```ts
PhysicsWorld2D: PibblComponent<PibblPhysicsWorld2DProps>
```

Related API: [PhysicsWorld2D](/reference/functions/physics-2d/), [PibblComponent](/reference/types/elements-components/#pibblcomponent), [PibblPhysicsWorld2DProps](/reference/types/physics-2d/#pibblphysicsworld2dprops).

#### See also

[PibblComponent](/reference/types/elements-components/#pibblcomponent)

[PibblPhysicsWorld2DProps](/reference/types/physics-2d/#pibblphysicsworld2dprops)

[View source — packages/core/src/features/physics/lib/2d/runtime/world-component.ts:48](/source/packages/core/src/features/physics/lib/2d/runtime/world-component-ts/#L48)

<span id="api-PhysicsShape2D"></span>

### PhysicsShape2D

Draws an immutable physics shape as a Canvas primitive with optional body or collider
attachment.

```ts
PhysicsShape2D: PibblPrimitiveComponent<PhysicsShape2DProps, PrimitiveInput<PhysicsShape2DProps, PhysicsShape2DStyle>>
```

Related API: [PhysicsShape2D](/reference/functions/physics-2d/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [PhysicsShape2DProps](/reference/types/physics-2d/#physicsshape2dprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [PhysicsShape2DStyle](/reference/types/physics-2d/#physicsshape2dstyle).

#### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

#### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

#### See also

[PhysicsShape2DProps](/reference/types/physics-2d/#physicsshape2dprops)

[PhysicsShape2DStyle](/reference/types/physics-2d/#physicsshape2dstyle)

[View source — packages/core/src/features/physics/lib/2d/canvas/components.ts:79](/source/packages/core/src/features/physics/lib/2d/canvas/components-ts/#L79)

<span id="api-Capsule2D"></span>

### Capsule2D

Draws a capsule between two endpoints with optional physics attachment.

```ts
Capsule2D: PibblPrimitiveComponent<Capsule2DProps, PrimitiveInput<Capsule2DProps, Capsule2DStyle>>
```

Related API: [Capsule2D](/reference/functions/physics-2d/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [Capsule2DProps](/reference/types/physics-2d/#capsule2dprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [Capsule2DStyle](/reference/types/physics-2d/#capsule2dstyle).

#### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

#### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

#### See also

[Capsule2DProps](/reference/types/physics-2d/#capsule2dprops)

[Capsule2DStyle](/reference/types/physics-2d/#capsule2dstyle)

[View source — packages/core/src/features/physics/lib/2d/canvas/components.ts:96](/source/packages/core/src/features/physics/lib/2d/canvas/components-ts/#L96)

<span id="api-Segment2D"></span>

### Segment2D

Draws a line segment with optional physics attachment.

```ts
Segment2D: PibblPrimitiveComponent<Segment2DProps, PrimitiveInput<Segment2DProps, Segment2DStyle>>
```

Related API: [Segment2D](/reference/functions/physics-2d/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [Segment2DProps](/reference/types/physics-2d/#segment2dprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [Segment2DStyle](/reference/types/physics-2d/#segment2dstyle).

#### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

#### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

#### See also

[Segment2DProps](/reference/types/physics-2d/#segment2dprops)

[Segment2DStyle](/reference/types/physics-2d/#segment2dstyle)

[View source — packages/core/src/features/physics/lib/2d/canvas/components.ts:118](/source/packages/core/src/features/physics/lib/2d/canvas/components-ts/#L118)

<span id="api-Chain2D"></span>

### Chain2D

Draws an open or closed point chain with optional physics attachment.

```ts
Chain2D: PibblPrimitiveComponent<Chain2DProps, PrimitiveInput<Chain2DProps, Chain2DStyle>>
```

Related API: [Chain2D](/reference/functions/physics-2d/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [Chain2DProps](/reference/types/physics-2d/#chain2dprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [Chain2DStyle](/reference/types/physics-2d/#chain2dstyle).

#### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

#### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

#### See also

[Chain2DProps](/reference/types/physics-2d/#chain2dprops)

[Chain2DStyle](/reference/types/physics-2d/#chain2dstyle)

[View source — packages/core/src/features/physics/lib/2d/canvas/components.ts:139](/source/packages/core/src/features/physics/lib/2d/canvas/components-ts/#L139)

<span id="api-collider2D"></span>

### collider2D

Creates a declarative collider attachment for a primitive within a physics body.

```ts
collider2D: (options?: PibblPhysicsColliderConfiguration2D) => PibblPhysicsColliderAttachment2D
```

Related API: [collider2D](/reference/functions/physics-2d/), [PibblPhysicsColliderConfiguration2D](/reference/types/physics-2d/#pibblphysicscolliderconfiguration2d), [PibblPhysicsColliderAttachment2D](/reference/types/physics-2d/#pibblphysicscolliderattachment2d).

#### Parameters

- **`options`** — Collider shape, material, filtering, and sensor configuration. See
[PibblPhysicsColliderConfiguration2D](/reference/types/physics-2d/#pibblphysicscolliderconfiguration2d) .

#### Returns

A collider attachment for a supported primitive's physics prop. See
[PibblPhysicsColliderAttachment2D](/reference/types/physics-2d/#pibblphysicscolliderattachment2d) .

#### See also

[PibblPhysicsColliderConfiguration2D](/reference/types/physics-2d/#pibblphysicscolliderconfiguration2d)

[PibblPhysicsColliderAttachment2D](/reference/types/physics-2d/#pibblphysicscolliderattachment2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/descriptors.ts:285](/source/packages/core/src/features/physics/lib/2d/runtime/descriptors-ts/#L285)

<span id="api-dynamicBody2D"></span>

### dynamicBody2D

Creates a declarative body attachment whose motion is advanced by the physics solver.

```ts
dynamicBody2D: (options?: PibblPhysicsDynamicBody2DOptions) => PibblPhysicsBodyAttachment2D
```

Related API: [dynamicBody2D](/reference/functions/physics-2d/), [PibblPhysicsDynamicBody2DOptions](/reference/types/physics-2d/#pibblphysicsdynamicbody2doptions), [PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d).

#### Parameters

- **`options`** — Dynamic body, collider, and initial motion configuration. See
[PibblPhysicsDynamicBody2DOptions](/reference/types/physics-2d/#pibblphysicsdynamicbody2doptions) .

#### Returns

A dynamic-body attachment for a supported primitive's physics prop. See
[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d) .

#### See also

[PibblPhysicsDynamicBody2DOptions](/reference/types/physics-2d/#pibblphysicsdynamicbody2doptions)

[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/descriptors.ts:162](/source/packages/core/src/features/physics/lib/2d/runtime/descriptors-ts/#L162)

<span id="api-kinematicBody2D"></span>

### kinematicBody2D

Creates a declarative body attachment driven by application-supplied target signals.

```ts
kinematicBody2D: (options?: PibblPhysicsKinematicBody2DOptions) => PibblPhysicsBodyAttachment2D
```

Related API: [kinematicBody2D](/reference/functions/physics-2d/), [PibblPhysicsKinematicBody2DOptions](/reference/types/physics-2d/#pibblphysicskinematicbody2doptions), [PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d).

#### Parameters

- **`options`** — Kinematic body, collider, and motion configuration. See
[PibblPhysicsKinematicBody2DOptions](/reference/types/physics-2d/#pibblphysicskinematicbody2doptions) .

#### Returns

A kinematic-body attachment for a supported primitive's physics prop. See
[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d) .

#### See also

[PibblPhysicsKinematicBody2DOptions](/reference/types/physics-2d/#pibblphysicskinematicbody2doptions)

[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/descriptors.ts:245](/source/packages/core/src/features/physics/lib/2d/runtime/descriptors-ts/#L245)

<span id="api-staticBody2D"></span>

### staticBody2D

Creates a declarative body attachment that remains fixed in the simulation.

```ts
staticBody2D: (options?: PibblPhysicsStaticBody2DOptions) => PibblPhysicsBodyAttachment2D
```

Related API: [staticBody2D](/reference/functions/physics-2d/), [PibblPhysicsStaticBody2DOptions](/reference/types/physics-2d/#pibblphysicsstaticbody2doptions), [PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d).

#### Parameters

- **`options`** — Static body and collider configuration. See
[PibblPhysicsStaticBody2DOptions](/reference/types/physics-2d/#pibblphysicsstaticbody2doptions) .

#### Returns

A static-body attachment for a supported primitive's physics prop. See
[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d) .

#### See also

[PibblPhysicsStaticBody2DOptions](/reference/types/physics-2d/#pibblphysicsstaticbody2doptions)

[PibblPhysicsBodyAttachment2D](/reference/types/physics-2d/#pibblphysicsbodyattachment2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/descriptors.ts:220](/source/packages/core/src/features/physics/lib/2d/runtime/descriptors-ts/#L220)

<span id="api-withPhysicsShape2D"></span>

### withPhysicsShape2D

Adds physics-attachment support to a custom primitive using its resolved-style shape callback.

```ts
withPhysicsShape2D: <P, I, ResolvedStyle>(component: PibblPrimitiveComponent<P, I>, options: Readonly<{ resolveShape(style: Readonly<ResolvedStyle>): PibblPhysicsShape2D; }>) => PibblPrimitiveComponent<P & PibblPhysicsPrimitiveProps2D, I & { readonly physics?: PibblPhysicsAttachment2D; }>
```

Related API: [withPhysicsShape2D](/reference/functions/physics-2d/), [ResolvedStyle](/reference/types/styles/#resolvedstyle), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPrimitiveProps2D](/reference/types/physics-2d/#pibblphysicsprimitiveprops2d), [PibblPhysicsAttachment2D](/reference/types/physics-2d/#pibblphysicsattachment2d).

#### Parameters

- **`component`** — Primitive whose rendered style determines its collision shape. See
[PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent) .

- **`options`** — Pure resolver deriving collision geometry from resolved style. See
[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d) .

#### Returns

A derived primitive accepting the public physics attachment prop. See
[PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent) , [PibblPhysicsPrimitiveProps2D](/reference/types/physics-2d/#pibblphysicsprimitiveprops2d) ,
[PibblPhysicsAttachment2D](/reference/types/physics-2d/#pibblphysicsattachment2d) .

#### See also

[PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent)

[PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d)

[PibblPhysicsPrimitiveProps2D](/reference/types/physics-2d/#pibblphysicsprimitiveprops2d)

[PibblPhysicsAttachment2D](/reference/types/physics-2d/#pibblphysicsattachment2d)

[View source — packages/core/src/features/physics/lib/2d/canvas/custom.ts:30](/source/packages/core/src/features/physics/lib/2d/canvas/custom-ts/#L30)

<span id="api-pibblPhysicsBody2D"></span>

### pibblPhysicsBody2D

Returns one stable, component-owned 2D body endpoint for this hook slot.

```ts
pibblPhysicsBody2D: () => PibblPhysicsBodyHandle2D
```

Related API: [pibblPhysicsBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Returns

A stable body handle that can be attached to a physics body. See
[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d) .

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:77](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L77)

<span id="api-pibblPhysicsWorld2D"></span>

### pibblPhysicsWorld2D

Returns the nearest 2D physics world while a descendant is evaluating.

```ts
pibblPhysicsWorld2D: () => PibblPhysicsWorldHandle2D
```

Related API: [pibblPhysicsWorld2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

#### Returns

A stable world handle that can be attached to a physics world. See
[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d) .

#### See also

[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/world-component.ts:58](/source/packages/core/src/features/physics/lib/2d/runtime/world-component-ts/#L58)

<span id="api-applyForce2D"></span>

### applyForce2D

Queues a force on a body, optionally at a world point and with wake-up control.

```ts
applyForce2D: (body: PibblPhysicsBodyHandle2D, force: PibblPhysicsVector2, options?: Readonly<{ at?: PibblPhysicsVector2; wake?: boolean; }>) => void
```

Related API: [applyForce2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`body`** — Body receiving the force. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`force`** — Force vector in the world's public coordinate system. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

- **`options`** — Optional application point and wake policy. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:98](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L98)

<span id="api-applyImpulse2D"></span>

### applyImpulse2D

Queues an instantaneous momentum change, optionally at a world point and with wake-up control.

```ts
applyImpulse2D: (body: PibblPhysicsBodyHandle2D, impulse: PibblPhysicsVector2, options?: Readonly<{ at?: PibblPhysicsVector2; wake?: boolean; }>) => void
```

Related API: [applyImpulse2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`body`** — Body receiving the impulse. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`impulse`** — Impulse vector in the world's public coordinate system. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

- **`options`** — Optional application point and wake policy. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:130](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L130)

<span id="api-applyTorque2D"></span>

### applyTorque2D

Queues torque on a dynamic body through the shared scheduler.

```ts
applyTorque2D: (body: PibblPhysicsBodyHandle2D, torque: number) => void
```

Related API: [applyTorque2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body receiving the torque. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`torque`** — Torque to apply in the world's public units.

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:159](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L159)

<span id="api-disableBody2D"></span>

### disableBody2D

Queues removal of a body's active participation in the simulation.

```ts
disableBody2D: (body: PibblPhysicsBodyHandle2D) => void
```

Related API: [disableBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body to disable. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:290](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L290)

<span id="api-enableBody2D"></span>

### enableBody2D

Queues re-enabling a body with the requested velocity-preservation policy.

```ts
enableBody2D: (body: PibblPhysicsBodyHandle2D, options?: Readonly<{ velocity?: "zero" | "preserve"; }>) => void
```

Related API: [enableBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body to re-enable. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`options`** — Whether to zero or preserve velocity when enabling.

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:272](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L272)

<span id="api-setAngularVelocity2D"></span>

### setAngularVelocity2D

Queues a body's angular velocity in degrees per second.

```ts
setAngularVelocity2D: (body: PibblPhysicsBodyHandle2D, degreesPerSecond: number) => void
```

Related API: [setAngularVelocity2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body whose angular velocity changes. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`degreesPerSecond`** — Angular speed in degrees per second.

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:201](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L201)

<span id="api-setLinearVelocity2D"></span>

### setLinearVelocity2D

Queues a body's linear velocity in physics units per second.

```ts
setLinearVelocity2D: (body: PibblPhysicsBodyHandle2D, velocity: PibblPhysicsVector2) => void
```

Related API: [setLinearVelocity2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`body`** — Body whose linear velocity changes. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`velocity`** — Velocity vector in public distance units per second. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:180](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L180)

<span id="api-sleepBody2D"></span>

### sleepBody2D

Queues a request to put a body to sleep.

```ts
sleepBody2D: (body: PibblPhysicsBodyHandle2D) => void
```

Related API: [sleepBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body to put to sleep. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:260](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L260)

<span id="api-teleportBody2D"></span>

### teleportBody2D

Queues an immediate pose change for a body at the next admitted simulation command phase.

```ts
teleportBody2D: (body: PibblPhysicsBodyHandle2D, pose: PibblPhysicsPose2D) => void
```

Related API: [teleportBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

#### Parameters

- **`body`** — Body to reposition. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`pose`** — Destination position and rotation in public coordinates. See
[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d) .

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:225](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L225)

<span id="api-wakeBody2D"></span>

### wakeBody2D

Queues a request to wake a sleeping body.

```ts
wakeBody2D: (body: PibblPhysicsBodyHandle2D) => void
```

Related API: [wakeBody2D](/reference/functions/physics-2d/), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### Parameters

- **`body`** — Body to wake. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

#### See also

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[View source — packages/core/src/features/physics/lib/2d/runtime/body-handle.ts:249](/source/packages/core/src/features/physics/lib/2d/runtime/body-handle-ts/#L249)

<span id="api-raycastAny2D"></span>

### raycastAny2D

Tests whether the committed world has any ray match, stopping at the first match.

```ts
raycastAny2D: (world: PibblPhysicsWorldHandle2D, ray: PibblPhysicsRay2D, options?: PibblPhysicsQueryOptions2D) => boolean
```

Related API: [raycastAny2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`ray`** — Ray origin, direction, and travel limit. See [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Whether a matching collider exists.

[View source — packages/core/src/features/physics/2d.ts:88](/source/packages/core/src/features/physics/2d-ts/#L88)

<span id="api-raycastClosest2D"></span>

### raycastClosest2D

Returns the first ray result ordered by time of impact, distance, then collider identity, or null.

```ts
raycastClosest2D: (world: PibblPhysicsWorldHandle2D, ray: PibblPhysicsRay2D, options?: PibblPhysicsQueryOptions2D) => PibblPhysicsQueryHit2D | null
```

Related API: [raycastClosest2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`ray`** — Ray origin, direction, and travel limit. See [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

One result or null. See [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

[View source — packages/core/src/features/physics/2d.ts:104](/source/packages/core/src/features/physics/2d-ts/#L104)

<span id="api-raycastAll2D"></span>

### raycastAll2D

Returns all ray results ordered by time of impact, distance, then collider identity as a frozen array.

```ts
raycastAll2D: (world: PibblPhysicsWorldHandle2D, ray: PibblPhysicsRay2D, options?: PibblPhysicsQueryOptions2D) => readonly PibblPhysicsQueryHit2D[]
```

Related API: [raycastAll2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`ray`** — Ray origin, direction, and travel limit. See [PibblPhysicsRay2D](/reference/types/physics-2d/#pibblphysicsray2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Frozen results, empty when no collider matches. See [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

[View source — packages/core/src/features/physics/2d.ts:120](/source/packages/core/src/features/physics/2d-ts/#L120)

<span id="api-shapeCastAny2D"></span>

### shapeCastAny2D

Tests whether the committed world has any shape sweep match, stopping at the first match.

```ts
shapeCastAny2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, from: PibblPhysicsPose2D, translation: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => boolean
```

Related API: [shapeCastAny2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to sweep. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`from`** — Initial shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`translation`** — Translation vector for the sweep. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Whether a matching collider exists.

[View source — packages/core/src/features/physics/2d.ts:138](/source/packages/core/src/features/physics/2d-ts/#L138)

<span id="api-shapeCastClosest2D"></span>

### shapeCastClosest2D

Returns the first shape sweep result ordered by time of impact, distance, then collider identity, or null.

```ts
shapeCastClosest2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, from: PibblPhysicsPose2D, translation: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => PibblPhysicsQueryHit2D | null
```

Related API: [shapeCastClosest2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to sweep. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`from`** — Initial shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`translation`** — Translation vector for the sweep. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

One result or null. See [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

[View source — packages/core/src/features/physics/2d.ts:158](/source/packages/core/src/features/physics/2d-ts/#L158)

<span id="api-shapeCastAll2D"></span>

### shapeCastAll2D

Returns all shape sweep results ordered by time of impact, distance, then collider identity as a frozen array.

```ts
shapeCastAll2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, from: PibblPhysicsPose2D, translation: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => readonly PibblPhysicsQueryHit2D[]
```

Related API: [shapeCastAll2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to sweep. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`from`** — Initial shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`translation`** — Translation vector for the sweep. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Frozen results, empty when no collider matches. See [PibblPhysicsQueryHit2D](/reference/types/physics-2d/#pibblphysicsqueryhit2d).

[View source — packages/core/src/features/physics/2d.ts:178](/source/packages/core/src/features/physics/2d-ts/#L178)

<span id="api-hasShapeOverlap2D"></span>

### hasShapeOverlap2D

Tests whether the committed world has any shape overlap match, stopping at the first match.

```ts
hasShapeOverlap2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, options?: PibblPhysicsQueryOptions2D) => boolean
```

Related API: [hasShapeOverlap2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to test. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`pose`** — Shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Whether a matching collider exists.

[View source — packages/core/src/features/physics/2d.ts:197](/source/packages/core/src/features/physics/2d-ts/#L197)

<span id="api-findShapeOverlap2D"></span>

### findShapeOverlap2D

Returns the first shape overlap result ordered by collider index, then generation, or null.

```ts
findShapeOverlap2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, options?: PibblPhysicsQueryOptions2D) => PibblPhysicsQueryMatch2D | null
```

Related API: [findShapeOverlap2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to test. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`pose`** — Shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

One result or null. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:215](/source/packages/core/src/features/physics/2d-ts/#L215)

<span id="api-findAllShapeOverlaps2D"></span>

### findAllShapeOverlaps2D

Returns all shape overlap results ordered by collider index, then generation as a frozen array.

```ts
findAllShapeOverlaps2D: (world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, options?: PibblPhysicsQueryOptions2D) => readonly PibblPhysicsQueryMatch2D[]
```

Related API: [findAllShapeOverlaps2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d), [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`shape`** — Shape to test. See [PibblPhysicsShape2D](/reference/types/physics-2d/#pibblphysicsshape2d).

- **`pose`** — Shape pose. See [PibblPhysicsPose2D](/reference/types/physics-2d/#pibblphysicspose2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Frozen results, empty when no collider matches. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:233](/source/packages/core/src/features/physics/2d-ts/#L233)

<span id="api-hasAabbMatch2D"></span>

### hasAabbMatch2D

Tests whether the committed world has any bounds intersection match, stopping at the first match.

```ts
hasAabbMatch2D: (world: PibblPhysicsWorldHandle2D, bounds: PibblPhysicsAabb2D, options?: PibblPhysicsQueryOptions2D) => boolean
```

Related API: [hasAabbMatch2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`bounds`** — Axis-aligned query bounds. See [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Whether a matching collider exists.

[View source — packages/core/src/features/physics/2d.ts:250](/source/packages/core/src/features/physics/2d-ts/#L250)

<span id="api-findAabbMatch2D"></span>

### findAabbMatch2D

Returns the first bounds intersection result ordered by collider index, then generation, or null.

```ts
findAabbMatch2D: (world: PibblPhysicsWorldHandle2D, bounds: PibblPhysicsAabb2D, options?: PibblPhysicsQueryOptions2D) => PibblPhysicsQueryMatch2D | null
```

Related API: [findAabbMatch2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`bounds`** — Axis-aligned query bounds. See [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

One result or null. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:266](/source/packages/core/src/features/physics/2d-ts/#L266)

<span id="api-findAllAabbMatches2D"></span>

### findAllAabbMatches2D

Returns all bounds intersection results ordered by collider index, then generation as a frozen array.

```ts
findAllAabbMatches2D: (world: PibblPhysicsWorldHandle2D, bounds: PibblPhysicsAabb2D, options?: PibblPhysicsQueryOptions2D) => readonly PibblPhysicsQueryMatch2D[]
```

Related API: [findAllAabbMatches2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`bounds`** — Axis-aligned query bounds. See [PibblPhysicsAabb2D](/reference/types/physics-2d/#pibblphysicsaabb2d).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Frozen results, empty when no collider matches. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:282](/source/packages/core/src/features/physics/2d-ts/#L282)

<span id="api-hasPointMatch2D"></span>

### hasPointMatch2D

Tests whether the committed world has any point containment match, stopping at the first match.

```ts
hasPointMatch2D: (world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => boolean
```

Related API: [hasPointMatch2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`point`** — Point in simulation coordinates. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Whether a matching collider exists.

[View source — packages/core/src/features/physics/2d.ts:298](/source/packages/core/src/features/physics/2d-ts/#L298)

<span id="api-findPointMatch2D"></span>

### findPointMatch2D

Returns the first point containment result ordered by collider index, then generation, or null.

```ts
findPointMatch2D: (world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => PibblPhysicsQueryMatch2D | null
```

Related API: [findPointMatch2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`point`** — Point in simulation coordinates. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

One result or null. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:314](/source/packages/core/src/features/physics/2d-ts/#L314)

<span id="api-findAllPointMatches2D"></span>

### findAllPointMatches2D

Returns all point containment results ordered by collider index, then generation as a frozen array.

```ts
findAllPointMatches2D: (world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D) => readonly PibblPhysicsQueryMatch2D[]
```

Related API: [findAllPointMatches2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2), [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d), [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

#### Parameters

- **`world`** — World to query. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`point`** — Point in simulation coordinates. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

- **`options`** — Sensor policy and collider filtering. See [PibblPhysicsQueryOptions2D](/reference/types/physics-2d/#pibblphysicsqueryoptions2d).

#### Returns

Frozen results, empty when no collider matches. See [PibblPhysicsQueryMatch2D](/reference/types/physics-2d/#pibblphysicsquerymatch2d).

[View source — packages/core/src/features/physics/2d.ts:330](/source/packages/core/src/features/physics/2d-ts/#L330)

<span id="api-toPhysicsPoint2D"></span>

### toPhysicsPoint2D

Converts root-logical pointer coordinates to this world's simulation space.

```ts
toPhysicsPoint2D: (world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2) => PibblPhysicsVector2
```

Related API: [toPhysicsPoint2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`world`** — World providing unit and coordinate conversion. See
[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d) .

- **`point`** — Point in public Canvas coordinates. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

The equivalent point in this world's local simulation space. See
[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2) .

#### See also

[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/2d.ts:350](/source/packages/core/src/features/physics/2d-ts/#L350)

<span id="api-fromPhysicsPoint2D"></span>

### fromPhysicsPoint2D

Converts a simulation-space point to root-logical Canvas coordinates.

```ts
fromPhysicsPoint2D: (world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2) => PibblPhysicsVector2
```

Related API: [fromPhysicsPoint2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Parameters

- **`world`** — World providing unit and coordinate conversion. See
[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d) .

- **`point`** — Point in this world's local simulation space. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### Returns

The equivalent point in public Canvas coordinates. See [PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2).

#### See also

[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d)

[PibblPhysicsVector2](/reference/types/physics-2d/#pibblphysicsvector2)

[View source — packages/core/src/features/physics/2d.ts:368](/source/packages/core/src/features/physics/2d-ts/#L368)

<span id="api-inspectPhysics2D"></span>

### inspectPhysics2D

Returns immutable JSON-safe observations without advancing the simulation. See
PibblPhysicsWorldHandle2D.
Returns the immutable observation for this currently bound body, if any. See
PibblPhysicsBodyHandle2D.
Returns a diagnostic snapshot of a live world or body, or undefined when unavailable.

```ts
inspectPhysics2D: { (world: PibblPhysicsWorldHandle2D): PibblPhysicsInspection2D; (body: PibblPhysicsBodyHandle2D): PibblPhysicsBodyInspection2D | undefined; }
```

Related API: [inspectPhysics2D](/reference/functions/physics-2d/), [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d), [PibblPhysicsInspection2D](/reference/types/physics-2d/#pibblphysicsinspection2d), [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d), [PibblPhysicsBodyInspection2D](/reference/types/physics-2d/#pibblphysicsbodyinspection2d).

#### Parameters

- **`world`** — World to inspect. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d).

- **`body`** — Body to inspect. See [PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d).

- **`target`** — World or body handle to inspect. See [PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d) ,
[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d) .

#### Returns

Current world simulation and ownership diagnostics.

Current body diagnostics, or undefined when the handle has no live body.

The corresponding diagnostics, or undefined for an unmounted body.

#### See also

[PibblPhysicsWorldHandle2D](/reference/types/physics-2d/#pibblphysicsworldhandle2d)

[PibblPhysicsBodyHandle2D](/reference/types/physics-2d/#pibblphysicsbodyhandle2d)

[PibblPhysicsInspection2D](/reference/types/physics-2d/#pibblphysicsinspection2d)

[PibblPhysicsBodyInspection2D](/reference/types/physics-2d/#pibblphysicsbodyinspection2d)

[View source — packages/core/src/features/physics/2d.ts:388](/source/packages/core/src/features/physics/2d-ts/#L388)

<span id="api-PhysicsDebug2D"></span>

### PhysicsDebug2D

Read-only authoritative bounds, mass centers and contact normals; no hit targets.

```ts
PhysicsDebug2D: PibblPrimitiveComponent<PibblPhysicsDebug2DProps, PrimitiveInput<PibblPhysicsDebug2DProps, SystemStyle>>
```

Related API: [PhysicsDebug2D](/reference/functions/physics-2d/), [PibblPrimitiveComponent](/reference/types/elements-components/#pibblprimitivecomponent), [PibblPhysicsDebug2DProps](/reference/types/physics-2d/#pibblphysicsdebug2dprops), [PrimitiveInput](/reference/types/styles/#primitiveinput), [SystemStyle](/reference/types/styles/#systemstyle).

#### Parameters

- **`props`** — Authored component inputs, supplied through JSX or createElement. See the linked
props and style types.

#### Throws

When called directly; Pibbl mounts this component through JSX or createElement.

#### See also

[PibblPhysicsDebug2DProps](/reference/types/physics-2d/#pibblphysicsdebug2dprops)

[View source — packages/core/src/features/physics/lib/2d/canvas/debug.ts:28](/source/packages/core/src/features/physics/lib/2d/canvas/debug-ts/#L28)

## Implementation guidance for agents

Read the [Physics and geometry companion](/agents/topics/physics/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Physics drawing components](/minimal-examples/physics/runtime-components/): Draw four physics shapes and move a custom kinematic collider. [Plain source](/minimal/physics/runtime-components.tsx)
- [Live physics world](/minimal-examples/physics/runtime-world/): Mount a falling ball, inspect it, and control its body with buttons. [Plain source](/minimal/physics/runtime-world.tsx)
- [Path-like shapes](/minimal-examples/physics/geometry-paths/): Create curved, stroked, and polygonal shapes and transform them. [Plain source](/minimal/physics/geometry-paths.ts)
- [Shape measurements](/minimal-examples/physics/geometry-shapes/): Compare bounds, area, and mass for four common 2D shapes. [Plain source](/minimal/physics/geometry-shapes.ts)
- [Geometry queries](/minimal-examples/physics/geometry-queries/): Check point containment, separation, overlap, contact, and casts. [Plain source](/minimal/physics/geometry-queries.ts)
- [World queries](/minimal-examples/physics/runtime-queries/): Query a static collider by ray, moving shape, overlap, point, and bounds. [Plain source](/minimal/physics/runtime-queries.tsx)
## Interactive examples

- [Reusable physics panels](/examples/physics-panels/) · [Full page](/experience/physics-panels/)
- [Stirred Ink](/examples/stirred-ink/) · [Full page](/experience/stirred-ink/)
- [Embers Physics](/examples/embers-physics/) · [Full page](/experience/embers-physics/)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
