Class

SKPhysicsJointSpring

A joint that simulates a spring connecting two physics bodies.

Declaration

@interface SKPhysicsJointSpring : SKPhysicsJoint

Overview

An SKPhysicsJointSpring object simulates connecting two physics bodies together with a spring. The farther the two objects move from each other, the more force is applied to bring the two bodies back together.

Topics

First Steps

Getting Started with Spring Joints

Connect two physics bodies with a spring joint.

Creating a Spring Joint

+ jointWithBodyA:bodyB:anchorA:anchorB:

Creates a new spring joint.

Configuring a Spring Joint

damping

Defines how the spring’s motion should be damped due to the forces of friction.

frequency

Defines the frequency or stiffness characteristics of the spring.

Relationships

Inherits From

See Also

Physics Joints

Working with Inverse Kinematics

Gain fine-tuned control of objects that are connected by joints.

SKPhysicsJoint

The abstract superclass for objects that connect physics bodies.

SKPhysicsJointFixed

A joint that fuses two physics bodies together at a reference point.

SKPhysicsJointLimit

A joint that imposes a maximum distance between two physics bodies, as if they were connected by a rope.

SKPhysicsJointPin

A joint that pins together two physics bodies, allowing independent rotation.

SKPhysicsJointSliding

A joint that allows two physics bodies to slide along an axis.