One Logo Pool Ball
SpriteKit · IOS API REFERENCE

SKPhysicsWorld

class · SDK 27.1

class SKPhysicsWorld

Members (14)

method

add

TypeScript
add(joint: SKPhysicsJoint): void
Swift declaration
func add(_ joint: SKPhysicsJoint)
method

body

TypeScript
bodyAlongRayStartEnd(start: { x: number; y: number }, end: { x: number; y: number }): (SKPhysicsBody) | null
Swift declaration
func body(alongRayStart start: CGPoint, end: CGPoint) -> SKPhysicsBody?
method

body

TypeScript
bodyAt(point: { x: number; y: number }): (SKPhysicsBody) | null
Swift declaration
func body(at point: CGPoint) -> SKPhysicsBody?
method

body

TypeScript
bodyIn(rect: { x: number; y: number; width: number; height: number }): (SKPhysicsBody) | null
Swift declaration
func body(in rect: CGRect) -> SKPhysicsBody?
init

init

TypeScript
static init(): SKPhysicsWorld
Swift declaration
init()
method

removeAllJoints

TypeScript
removeAllJoints(): void
Swift declaration
func removeAllJoints()
method

remove

TypeScript
remove(joint: SKPhysicsJoint): void
Swift declaration
func remove(_ joint: SKPhysicsJoint)
method · iOS 8.0+

sampleFields

TypeScript
sampleFields(position: SDKHandle): SDKHandle
Swift declaration
func sampleFields(at position: vector_float3) -> vector_float3
get

contactDelegate

TypeScript
get contactDelegate(): (SDKHandle) | null
Swift declaration
unowned(unsafe) var contactDelegate: (any SKPhysicsContactDelegate)? { get set }
set

contactDelegate

TypeScript
set contactDelegate(value: (Implements<SKPhysicsContactDelegate> | SDKHandle) | null)
Swift declaration
unowned(unsafe) var contactDelegate: (any SKPhysicsContactDelegate)? { get set }
get

gravity

TypeScript
get gravity(): { dx: number; dy: number }
Swift declaration
var gravity: CGVector { get set }
set

gravity

TypeScript
set gravity(value: { dx: number; dy: number })
Swift declaration
var gravity: CGVector { get set }
get

speed

TypeScript
get speed(): number
Swift declaration
var speed: CGFloat { get set }
set

speed

TypeScript
set speed(value: number)
Swift declaration
var speed: CGFloat { get set }

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

SKPhysicsWorld.enumerateBodies(at:using:)

synchronous callback requires a nonescaping JS-thread call

SKPhysicsWorld.enumerateBodies(in:using:)

synchronous callback requires a nonescaping JS-thread call

SKPhysicsWorld.enumerateBodies(alongRayStart:end:using:)

synchronous callback requires a nonescaping JS-thread call

All SpriteKit types →