# Sandbox.SceneTrace.Sweep

## Overload 1

```csharp
SceneTrace 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

`SceneTrace`

## Overload 2

```csharp
SceneTrace Sweep(in Rigidbody 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` (`Rigidbody`)
- `in from` (`Transform`)
- `in to` (`Transform`)

### Returns

`SceneTrace`

## Overload 3

```csharp
SceneTrace 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

`SceneTrace`

Declared in [Sandbox.SceneTrace](/api/Sandbox.SceneTrace).
Assembly: `Sandbox.Engine`.
