SKPhysicsWorld Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Manages the physics for a SKScene.
[Foundation.Register("SKPhysicsWorld", true)]
public class SKPhysicsWorld : Foundation.NSObject, Foundation.INSSecureCoding, IDisposable
[<Foundation.Register("SKPhysicsWorld", true)>]
type SKPhysicsWorld = class
inherit NSObject
interface INSCoding
interface INativeObject
interface IDisposable
interface INSSecureCoding
- Inheritance
- Attributes
- Implements
Remarks
Every SKScene has a PhysicsWorld property that holds a SKPhysicsWorld object that manages the physics for that scene.
The SKPhysicsWorld has several responsibilities:
- Providing global values such as Gravity.:
- Connecting SKPhysicsBodys with the AddJoint(SKPhysicsJoint) method.:
- Raising events when SKPhysicsBody begin or end contact with each other (see the ContactDelegate property and the DidBeginContact and DidEndContact methods).:
- Enumerating bodies that intersect geometry (EnumerateBodies(CGPoint, CGPoint, SKPhysicsWorldBodiesAlongRayStartEnumeratorHandler) and GetBody(CGPoint, CGPoint) methods).:
Constructors
| Name | Description |
|---|---|
| SKPhysicsWorld(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| SKPhysicsWorld(NSCoder) |
A constructor that initializes the object from the data stored in the unarchiver object. |
| SKPhysicsWorld(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| ContactDelegate |
A delegate object that can handle events relating to collisions between the physics bodies in the simulation. |
| DebugDescription | (Inherited from NSObject) |
| Description | (Inherited from NSObject) |
| ExposedBindings | (Inherited from NSObject) |
| Gravity | |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| IsDirectBinding | (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| Speed | |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| WeakContactDelegate | |
| Zone | (Inherited from NSObject) |
Methods
Events
| Name | Description |
|---|---|
| DidBeginContact |
Event raised by the object. |
| DidEndContact |
Event raised by the object. |