One Logo Pool Ball
SpriteKit · IOS API REFERENCE

SKPhysicsBody

class · SDK 27.1

class SKPhysicsBody

Members (60)

init

init

TypeScript
static initBodies(bodies: Array<SKPhysicsBody>): SKPhysicsBody
Swift declaration
init(bodies: [SKPhysicsBody])
init

init

TypeScript
static initCircleOfRadius(r: number): SKPhysicsBody
Swift declaration
init(circleOfRadius r: CGFloat)
init

init

TypeScript
static initCircleOfRadiusCenter(r: number, center: { x: number; y: number }): SKPhysicsBody
Swift declaration
init(circleOfRadius r: CGFloat, center: CGPoint)
init

init

TypeScript
static initEdgeChainFrom(path: _CoreGraphics_CGPath): SKPhysicsBody
Swift declaration
init(edgeChainFrom path: CGPath)
init

init

TypeScript
static initEdgeFromTo(p1: { x: number; y: number }, p2: { x: number; y: number }): SKPhysicsBody
Swift declaration
init(edgeFrom p1: CGPoint, to p2: CGPoint)
init

init

TypeScript
static initEdgeLoopFrom(path: _CoreGraphics_CGPath): SKPhysicsBody
Swift declaration
init(edgeLoopFrom path: CGPath)
init

init

TypeScript
static initEdgeLoopFrom15402(rect: { x: number; y: number; width: number; height: number }): SKPhysicsBody
Swift declaration
init(edgeLoopFrom rect: CGRect)
init

init

TypeScript
static initPolygonFrom(path: _CoreGraphics_CGPath): SKPhysicsBody
Swift declaration
init(polygonFrom path: CGPath)
init

init

TypeScript
static initRectangleOf(s: { width: number; height: number }): SKPhysicsBody
Swift declaration
init(rectangleOf s: CGSize)
init

init

TypeScript
static initRectangleOfCenter(s: { width: number; height: number }, center: { x: number; y: number }): SKPhysicsBody
Swift declaration
init(rectangleOf s: CGSize, center: CGPoint)
init · iOS 8.0+

init

TypeScript
static initTextureAlphaThresholdSize(texture: SKTexture, alphaThreshold: number, size: { width: number; height: number }): SKPhysicsBody
Swift declaration
init(texture: SKTexture, alphaThreshold: Float, size: CGSize)
init · iOS 8.0+

init

TypeScript
static initTextureSize(texture: SKTexture, size: { width: number; height: number }): SKPhysicsBody
Swift declaration
init(texture: SKTexture, size: CGSize)
method

allContactedBodies

TypeScript
allContactedBodies(): Array<SKPhysicsBody>
Swift declaration
func allContactedBodies() -> [SKPhysicsBody]
method

applyAngularImpulse

TypeScript
applyAngularImpulse(impulse: number): void
Swift declaration
func applyAngularImpulse(_ impulse: CGFloat)
method

applyForce

TypeScript
applyForce(force: { dx: number; dy: number }): void
Swift declaration
func applyForce(_ force: CGVector)
method

applyForce

TypeScript
applyForceAt(force: { dx: number; dy: number }, point: { x: number; y: number }): void
Swift declaration
func applyForce(_ force: CGVector, at point: CGPoint)
method

applyImpulse

TypeScript
applyImpulse(impulse: { dx: number; dy: number }): void
Swift declaration
func applyImpulse(_ impulse: CGVector)
method

applyImpulse

TypeScript
applyImpulseAt(impulse: { dx: number; dy: number }, point: { x: number; y: number }): void
Swift declaration
func applyImpulse(_ impulse: CGVector, at point: CGPoint)
method

applyTorque

TypeScript
applyTorque(torque: number): void
Swift declaration
func applyTorque(_ torque: CGFloat)
get

affectedByGravity

TypeScript
get affectedByGravity(): boolean
Swift declaration
var affectedByGravity: Bool { get set }
set

affectedByGravity

TypeScript
set affectedByGravity(value: boolean)
Swift declaration
var affectedByGravity: Bool { get set }
get

allowsRotation

TypeScript
get allowsRotation(): boolean
Swift declaration
var allowsRotation: Bool { get set }
set

allowsRotation

TypeScript
set allowsRotation(value: boolean)
Swift declaration
var allowsRotation: Bool { get set }
get

angularDamping

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

angularDamping

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

angularVelocity

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

angularVelocity

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

area

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

categoryBitMask

TypeScript
get categoryBitMask(): number
Swift declaration
var categoryBitMask: UInt32 { get set }
set

categoryBitMask

TypeScript
set categoryBitMask(value: number)
Swift declaration
var categoryBitMask: UInt32 { get set }
get · iOS 8.0+

charge

TypeScript
get charge(): number
Swift declaration
var charge: CGFloat { get set }
set · iOS 8.0+

charge

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

collisionBitMask

TypeScript
get collisionBitMask(): number
Swift declaration
var collisionBitMask: UInt32 { get set }
set

collisionBitMask

TypeScript
set collisionBitMask(value: number)
Swift declaration
var collisionBitMask: UInt32 { get set }
get

contactTestBitMask

TypeScript
get contactTestBitMask(): number
Swift declaration
var contactTestBitMask: UInt32 { get set }
set

contactTestBitMask

TypeScript
set contactTestBitMask(value: number)
Swift declaration
var contactTestBitMask: UInt32 { get set }
get

density

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

density

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

isDynamic

TypeScript
get isDynamic(): boolean
Swift declaration
var isDynamic: Bool { get set }
set

isDynamic

TypeScript
set isDynamic(value: boolean)
Swift declaration
var isDynamic: Bool { get set }
get · iOS 8.0+

fieldBitMask

TypeScript
get fieldBitMask(): number
Swift declaration
var fieldBitMask: UInt32 { get set }
set · iOS 8.0+

fieldBitMask

TypeScript
set fieldBitMask(value: number)
Swift declaration
var fieldBitMask: UInt32 { get set }
get

friction

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

friction

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

joints

TypeScript
get joints(): Array<SKPhysicsJoint>
Swift declaration
var joints: [SKPhysicsJoint] { get }
get

linearDamping

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

linearDamping

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

mass

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

mass

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

node

TypeScript
get node(): (SKNode) | null
Swift declaration
weak var node: SKNode? { get }
get · iOS 8.0+

pinned

TypeScript
get pinned(): boolean
Swift declaration
var pinned: Bool { get set }
set · iOS 8.0+

pinned

TypeScript
set pinned(value: boolean)
Swift declaration
var pinned: Bool { get set }
get

isResting

TypeScript
get isResting(): boolean
Swift declaration
var isResting: Bool { get set }
set

isResting

TypeScript
set isResting(value: boolean)
Swift declaration
var isResting: Bool { get set }
get

restitution

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

restitution

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

usesPreciseCollisionDetection

TypeScript
get usesPreciseCollisionDetection(): boolean
Swift declaration
var usesPreciseCollisionDetection: Bool { get set }
set

usesPreciseCollisionDetection

TypeScript
set usesPreciseCollisionDetection(value: boolean)
Swift declaration
var usesPreciseCollisionDetection: Bool { get set }
get

velocity

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

velocity

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

Skipped declarations

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

SKPhysicsBody.init()

inherited init: cannot prove legal (class declares 19 custom initializers)

All SpriteKit types →