<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNPhysicsWorld",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsWorld"
  },
  "title" : "SCNPhysicsWorld"
}
-->

# SCNPhysicsWorld

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

```
class SCNPhysicsWorld
```

## Overview

You do not create [`SCNPhysicsWorld`](/documentation/SceneKit/SCNPhysicsWorld) objects directly; instead, read the [`physicsWorld`](/documentation/SceneKit/SCNScene/physicsWorld) property of an [`SCNScene`](/documentation/SceneKit/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`](/documentation/SceneKit/SCNPhysicsField) class.)
- Register behaviors that modify interactions between the scene’s physics bodies, such as joints and vehicles. For more details, see [`SCNPhysicsBehavior`](/documentation/SceneKit/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`](/documentation/SceneKit/SCNPhysicsWorld/gravity)

A vector that specifies the gravitational acceleration applied to physics bodies in the physics world.

[`speed`](/documentation/SceneKit/SCNPhysicsWorld/speed)

The rate at which the simulation executes.

[`timeStep`](/documentation/SceneKit/SCNPhysicsWorld/timeStep)

The time interval between updates to the physics simulation.

[`-  updateCollisionPairs`](/documentation/SceneKit/SCNPhysicsWorld/updateCollisionPairs())

Forces the physics engine to reevaluate possible collisions between physics bodies.

### Registering Physics Behaviors

[`-  addBehavior:`](/documentation/SceneKit/SCNPhysicsWorld/addBehavior(_:))

Adds a behavior to the physics world.

[`-  removeBehavior:`](/documentation/SceneKit/SCNPhysicsWorld/removeBehavior(_:))

Removes a behavior from the physics world.

[`allBehaviors`](/documentation/SceneKit/SCNPhysicsWorld/allBehaviors)

The list of behaviors affecting bodies in the physics world.

[`-  removeAllBehaviors`](/documentation/SceneKit/SCNPhysicsWorld/removeAllBehaviors())

Removes all behaviors affecting bodies in the physics world.

### Detecting Contacts Between Physics Bodies

[`contactDelegate`](/documentation/SceneKit/SCNPhysicsWorld/contactDelegate)

A delegate that is called when two physics bodies come in contact with each other.

[`-  contactTestBetweenBody:andBody:options:`](/documentation/SceneKit/SCNPhysicsWorld/contactTestBetween(_:_:options:))

Checks for contacts between two physics bodies.

[`-  contactTestWithBody:options:`](/documentation/SceneKit/SCNPhysicsWorld/contactTest(with:options:))

Checks for contacts between one physics body and any other bodies in the physics world.

### Searching for Physics Bodies

[`-  rayTestWithSegmentFromPoint:toPoint:options:`](/documentation/SceneKit/SCNPhysicsWorld/rayTestWithSegment(from:to:options:))

Searches for physics bodies along a line segment between two points in the physics world.

[`-  convexSweepTestWithShape:fromTransform:toTransform:options:`](/documentation/SceneKit/SCNPhysicsWorld/convexSweepTest(with:from:to:options:))

Searches for physics bodies in the space formed by moving a convex shape through the physics world.

### Search Options

[`TestOption`](/documentation/SceneKit/SCNPhysicsWorld/TestOption)

Keys in options dictionaries that affect how SceneKit searches for bodies in a collision, ray, or sweep test.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)