---
title: SKPhysicsWorld
framework: spritekit
role: symbol
role_heading: Class
path: spritekit/skphysicsworld
---

# SKPhysicsWorld

The driver of the physics engine in a scene; it exposes the ability for you to configure and query the physics system.

## Declaration

```swift
class SKPhysicsWorld
```

## Mentioned in

Connecting Bodies with Joints Disconnecting Bodies from Joints Getting Started with Physics

## Overview

Overview SKPhysicsWorld runs the physics engine of a scene and is the place that contact detection occurs. Do not create a SKPhysicsWorld directly; the system creates a physics world and adds it to the scene’s physicsWorld property. The physics world allows you to: Set important properties like gravity Join two physics bodies using an SKPhysicsJoint Respond to collision between two physics bodies using contactDelegate Do custom collisions detection or hit testing

## Topics

### Configuring the Physics World

- [gravity](spritekit/skphysicsworld/gravity.md)
- [speed](spritekit/skphysicsworld/speed.md)

### Joining Physics Bodies with Joints

- [add(_:)](spritekit/skphysicsworld/add(_:).md)
- [removeAllJoints()](spritekit/skphysicsworld/removealljoints().md)
- [remove(_:)](spritekit/skphysicsworld/remove(_:).md)

### Detecting Collisions

- [contactDelegate](spritekit/skphysicsworld/contactdelegate.md)

### Searching the Scene for Physics Bodies

- [Searching the World for Physics Bodies](spritekit/searching-the-world-for-physics-bodies.md)
- [body(alongRayStart:end:)](spritekit/skphysicsworld/body(alongraystart:end:).md)
- [body(at:)](spritekit/skphysicsworld/body(at:).md)
- [body(in:)](spritekit/skphysicsworld/body(in:).md)
- [enumerateBodies(alongRayStart:end:using:)](spritekit/skphysicsworld/enumeratebodies(alongraystart:end:using:).md)
- [enumerateBodies(at:using:)](spritekit/skphysicsworld/enumeratebodies(at:using:).md)
- [enumerateBodies(in:using:)](spritekit/skphysicsworld/enumeratebodies(in:using:).md)

### Sampling Physics Fields

- [sampleFields(at:)](spritekit/skphysicsworld/samplefields(at:).md)

### Initializers

- [init(coder:)](spritekit/skphysicsworld/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Physics Simulation

- [Getting Started with Physics](spritekit/getting-started-with-physics.md)
- [SKPhysicsBody](spritekit/skphysicsbody.md)
- [SKPhysicsContact](spritekit/skphysicscontact.md)
- [SKPhysicsContactDelegate](spritekit/skphysicscontactdelegate.md)
- [SKFieldNode](spritekit/skfieldnode.md)
