---
title: SCNPhysicsWorld
framework: scenekit
role: symbol
role_heading: Class
path: scenekit/scnphysicsworld
---

# SCNPhysicsWorld

The global simulation of collisions, gravity, joints, and other physics effects in a scene.

## Declaration

```swift
class SCNPhysicsWorld
```

## Overview

Overview You do not create SCNPhysicsWorld objects directly; instead, read the physicsWorld property of an SCNScene object. Use physics world object to perform the following tasks: Manage global properties of the simulation, such as its speed and constant gravity. (For more precise control of gravity and similar effects, see the SCNPhysicsField class.) Register behaviors that modify interactions between the scene’s physics bodies, such as joints and vehicles. For more details, see SCNPhysicsBehavior. Specify a delegate object to receive messages when two physics bodies contact each other Perform specific contact tests, and search for physics bodies in the scene using ray and sweep tests.

## Topics

### Managing the Physics Simulation

- [gravity](scenekit/scnphysicsworld/gravity.md)
- [speed](scenekit/scnphysicsworld/speed.md)
- [timeStep](scenekit/scnphysicsworld/timestep.md)
- [updateCollisionPairs()](scenekit/scnphysicsworld/updatecollisionpairs().md)

### Registering Physics Behaviors

- [addBehavior(_:)](scenekit/scnphysicsworld/addbehavior(_:).md)
- [removeBehavior(_:)](scenekit/scnphysicsworld/removebehavior(_:).md)
- [allBehaviors](scenekit/scnphysicsworld/allbehaviors.md)
- [removeAllBehaviors()](scenekit/scnphysicsworld/removeallbehaviors().md)

### Detecting Contacts Between Physics Bodies

- [contactDelegate](scenekit/scnphysicsworld/contactdelegate.md)
- [contactTestBetween(_:_:options:)](scenekit/scnphysicsworld/contacttestbetween(_:_:options:).md)
- [contactTest(with:options:)](scenekit/scnphysicsworld/contacttest(with:options:).md)

### Searching for Physics Bodies

- [rayTestWithSegment(from:to:options:)](scenekit/scnphysicsworld/raytestwithsegment(from:to:options:).md)
- [convexSweepTest(with:from:to:options:)](scenekit/scnphysicsworld/convexsweeptest(with:from:to:options:).md)

### Search Options

- [SCNPhysicsWorld.TestOption](scenekit/scnphysicsworld/testoption.md)

### Initializers

- [init(coder:)](scenekit/scnphysicsworld/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 in a Scene

- [SCNPhysicsField](scenekit/scnphysicsfield.md)
- [SCNPhysicsBehavior](scenekit/scnphysicsbehavior.md)
