# Sandbox.PhysicsTraceBuilder.Sweep

## Overload 1

```csharp
PhysicsTraceBuilder Sweep(in PhysicsBody body, in Transform from, in Transform to)
```

Sweeps each [PhysicsShape](/api/Sandbox.PhysicsShape) of given PhysicsBody and returns the closest collision. Does not support Mesh PhysicsShapes.
Basically 'hull traces' but with physics shapes.
Same as tracing a body but allows rotation to change during the sweep.

### Parameters

- `in body` (`PhysicsBody`)
- `in from` (`Transform`)
- `in to` (`Transform`)

### Returns

`PhysicsTraceBuilder`

## Overload 2

```csharp
PhysicsTraceBuilder Sweep(in PhysicsBody body, in Transform to)
```

Creates a Trace.Sweep using the [PhysicsBody](/api/Sandbox.PhysicsBody)'s position as the starting position.

### Parameters

- `in body` (`PhysicsBody`)
- `in to` (`Transform`)

### Returns

`PhysicsTraceBuilder`

Declared in [Sandbox.PhysicsTraceBuilder](/api/Sandbox.PhysicsTraceBuilder).
Assembly: `Sandbox.Engine`.
