# IPhysicsBody interface

> One body in an IPhysicsWorld, as Add returns it. Every vector is a MapVector in meters on Godot's axes, read from the world as it stands after the last step. Setting a number or vector, or pushing with one, that isn't finite or is past a float's range throws ArgumentOutOfRangeException, so Jolt never takes one, and so does an orientation of all zeros.

Namespace `EvilEngine.Api.Physics`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public interface IPhysicsBody
```

One body in an [IPhysicsWorld](/docs/api/iphysicsworld), as [Add](/docs/api/iphysicsworld#add) returns it. Every vector is a [MapVector](/docs/api/mapvector) in meters on Godot's axes, read from the world as it stands after the last step. Setting a number or vector, or pushing with one, that isn't finite or is past a float's range throws `ArgumentOutOfRangeException`, so Jolt never takes one, and so does an orientation of all zeros.

## Members

### Motion (property)

```csharp
BodyMotion Motion { get; }
```

Whether it's [static, kinematic or dynamic](/docs/api/bodymotion), fixed when it was added.

### Mass (property)

```csharp
double Mass { get; }
```

Its mass in kilograms, worked out once when it was added, as [BodySpec.Mass](/docs/api/bodyspec#mass) says. Only a dynamic body uses it.

### Volume (property)

```csharp
double Volume { get; }
```

The volume of its collision in m³: each hull by its faces, each primitive by its formula. A triangle mesh has none, so a body made only of one is 0.

### Position (property)

```csharp
MapVector Position { get; set; }
```

Where the body's origin is, the origin its collision was made around, not its centre of mass. Setting it moves the body there at once, with no sweep in between.

### Orientation (property)

```csharp
Orientation Orientation { get; set; }
```

Its rotation as an [Orientation](/docs/api/orientation). Setting it turns the body at once. It's normalised on the way in.

### Velocity (property)

```csharp
MapVector Velocity { get; set; }
```

Its linear velocity in m/s. Setting it replaces the velocity outright.

### Spin (property)

```csharp
MapVector Spin { get; set; }
```

Its angular velocity in radians a second about each axis.

### Centre (property)

```csharp
MapVector Centre { get; }
```

Where its centre of mass is in the world, which moves with the body. The physics gun steers a held prop by it.

### Frozen (property)

```csharp
bool Frozen { get; set; }
```

Whether the body is held where it is, still and untouched by gravity or pushes until it's thawed. Setting it on a dynamic body stops it dead and freezes it, and clearing it wakes it again; a static or kinematic body, or one that's removed, ignores it and reads `false`.

### Asleep (property)

```csharp
bool Asleep { get; }
```

Whether the world has put it to sleep. A dynamic body that's come to rest sleeps until something touches it or you change it.

### GravityScale (property)

```csharp
double GravityScale { get; set; }
```

How much of the world's gravity pulls it, 1 by default. The physics gun holds a prop at 0 and puts it back to 1 when it lets go.

### Removed (property)

```csharp
bool Removed { get; }
```

Whether the body has left its world. A weapon that keeps a body between ticks checks it before touching the body again.

### Bounds (property)

```csharp
(MapVector, MapVector) Bounds { get; }
```

The box its collision covers in the world at its current position and orientation, as its lowest and highest corners.

### Wake (method)

```csharp
void Wake()
```

Wakes a sleeping body so the next step moves it. Setting its velocity alone may not.

### Push (method)

```csharp
void Push(MapVector impulse, MapVector at)
```

Applies an impulse in N·s at a point in the world, `at`, all at once. Pushing at the body's [Centre](#centre) of mass moves it without turning it, and anywhere else, its [Position](#position) included when the two differ, turns it as well.

### Force (method)

```csharp
void Force(MapVector force, MapVector at)
```

Applies a force in newtons at a point in the world for the next step only. Call it every tick for a force that lasts. Floating uses it for buoyancy.
