Class

SCNPhysicsSliderJoint

A physics behavior that connects two bodies and allows them to slide against each other and rotate around their connecting points.

Declaration

@interface SCNPhysicsSliderJoint : SCNPhysicsBehavior

Overview

A slider joint can have zero, one, or two degrees of freedom depending on whether you allow it to slide or rotate. You can also use a slider joint to pin a body so that it can move only by sliding a specific axis in the coordinate space of the node containing it. You can also use a slider joint as a motor, applying a force or torque to the bodies it connects.

Topics

Creating a Slider Joint

+ jointWithBodyA:axisA:anchorA:bodyB:axisB:anchorB:

Creates a slider joint connecting two physics bodies.

+ jointWithBody:axis:anchor:

Creates a slider joint that anchors a single physics body in space and allows it to slide along a specific axis.

Managing the Characteristics of a Slider Joint

bodyA

The first physics body connected by the joint.

axisA

The axis along which the first body can slide, relative to the node containing it.

anchorA

The point at which the joint connects, relative to the node containing the first body.

bodyB

The second physics body connected by the joint.

axisB

The axis along which the second body can slide, relative to the node containing it.

anchorB

The point at which the joint connects, relative to the node containing the second body.

Limiting the Motion of a Slider Joint

minimumLinearLimit

The minimum distance between the anchor points of the two bodies, relative to their initial positions.

maximumLinearLimit

The maximum distance between the anchor points of the two bodies, relative to their initial positions.

minimumAngularLimit

The minimum rotation angle between the two bodies, measured in radians relative to their initial orientations.

maximumAngularLimit

The maximum rotation angle between the two bodies, measured in radians relative to their initial orientations.

Applying Forces and Torques

motorTargetLinearVelocity

The velocity at which the joint’s connected bodies should slide.

motorMaximumForce

The maximum linear force that the joint can apply to its connected bodies, in newtons.

motorTargetAngularVelocity

The angular velocity at which the joint’s connected bodies should rotate around it.

motorMaximumTorque

The maximum torque that the joint can apply to its connected bodies, in newton-meters.

Relationships

Inherits From

See Also

Joints

SCNPhysicsHingeJoint

A physics behavior that connects two bodies and allows them to pivot around each other on a single axis.

SCNPhysicsBallSocketJoint

A physics behavior that connects two physics bodies and allows them to pivot around each other in any direction.