One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsCustomJoint

struct · iOS 18.0+ · SDK 27.1

struct PhysicsCustomJoint

A joint with six degrees of freedom that can be individually specified. A custom joint allows you to choose the restraints of all 6 degrees of freedom. You can set a ``MotionLimit`` for each degrees' motion. - Note: By default all degrees of freedom are locked, similar to ``PhysicsFixedJoint``. For example, you can constrain the motion of ``pin1`` in the xy-plane of ``pin0``, set movement along the x-axis to ``MotionLimit/unlimited``, and leave all rotations as the default value of ``MotionLimit/fixed``. - Note: The xy-plane is a plane that aligns with the x and y axes. ```swift let joint = PhysicsCustomJoint( pin0: entity0pin, pin1: entity1pin, linearMotionAlongX: .unlimited, linearMotionAlongY: .range(-5...5) ) ``` If ``pin0`` is in a fixed location for the example above, this joint allows ``pin1`` to move anywhere along the x-axis of ``pin0``, and can move up to 5 local meters above or below the y-axis of ``pin0``.

Members (20)

get · iOS 18.0+

linearMotionAlongX

TypeScript
get linearMotionAlongX(): PhysicsCustomJoint_MotionLimit
Swift declaration
var linearMotionAlongX: PhysicsCustomJoint.MotionLimit

The linear motion limits along the x-axis. This property sets the limits of ``pin1`` along the x-axis of ``pin0``.

set · iOS 18.0+

linearMotionAlongX

TypeScript
set linearMotionAlongX(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var linearMotionAlongX: PhysicsCustomJoint.MotionLimit

The linear motion limits along the x-axis. This property sets the limits of ``pin1`` along the x-axis of ``pin0``.

get · iOS 18.0+

linearMotionAlongY

TypeScript
get linearMotionAlongY(): PhysicsCustomJoint_MotionLimit
Swift declaration
var linearMotionAlongY: PhysicsCustomJoint.MotionLimit

The linear motion limits along the y-axis. This property sets the limits of ``pin1`` along the y-axis of ``pin0``.

set · iOS 18.0+

linearMotionAlongY

TypeScript
set linearMotionAlongY(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var linearMotionAlongY: PhysicsCustomJoint.MotionLimit

The linear motion limits along the y-axis. This property sets the limits of ``pin1`` along the y-axis of ``pin0``.

get · iOS 18.0+

linearMotionAlongZ

TypeScript
get linearMotionAlongZ(): PhysicsCustomJoint_MotionLimit
Swift declaration
var linearMotionAlongZ: PhysicsCustomJoint.MotionLimit

The linear motion limits along the z-axis. This property sets the limits of ``pin1`` along the z-axis of ``pin0``.

set · iOS 18.0+

linearMotionAlongZ

TypeScript
set linearMotionAlongZ(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var linearMotionAlongZ: PhysicsCustomJoint.MotionLimit

The linear motion limits along the z-axis. This property sets the limits of ``pin1`` along the z-axis of ``pin0``.

get · iOS 18.0+

angularMotionAroundX

TypeScript
get angularMotionAroundX(): PhysicsCustomJoint_MotionLimit
Swift declaration
var angularMotionAroundX: PhysicsCustomJoint.MotionLimit

The angular motion limits around the x-axis. This property sets the limits of ``pin1`` around the x-axis of ``pin0``.

set · iOS 18.0+

angularMotionAroundX

TypeScript
set angularMotionAroundX(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var angularMotionAroundX: PhysicsCustomJoint.MotionLimit

The angular motion limits around the x-axis. This property sets the limits of ``pin1`` around the x-axis of ``pin0``.

get · iOS 18.0+

angularMotionAroundY

TypeScript
get angularMotionAroundY(): PhysicsCustomJoint_MotionLimit
Swift declaration
var angularMotionAroundY: PhysicsCustomJoint.MotionLimit

The angular motion limits around the y-axis. This property sets the limits of ``pin1`` around the y-axis of ``pin0``.

set · iOS 18.0+

angularMotionAroundY

TypeScript
set angularMotionAroundY(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var angularMotionAroundY: PhysicsCustomJoint.MotionLimit

The angular motion limits around the y-axis. This property sets the limits of ``pin1`` around the y-axis of ``pin0``.

get · iOS 18.0+

angularMotionAroundZ

TypeScript
get angularMotionAroundZ(): PhysicsCustomJoint_MotionLimit
Swift declaration
var angularMotionAroundZ: PhysicsCustomJoint.MotionLimit

The angular motion limits around the z-axis. This property sets the limits of ``pin1`` around the z-axis of ``pin0``.

set · iOS 18.0+

angularMotionAroundZ

TypeScript
set angularMotionAroundZ(value: PhysicsCustomJoint_MotionLimit)
Swift declaration
var angularMotionAroundZ: PhysicsCustomJoint.MotionLimit

The angular motion limits around the z-axis. This property sets the limits of ``pin1`` around the z-axis of ``pin0``.

get · iOS 18.0+

checksForInternalCollisions

TypeScript
get checksForInternalCollisions(): boolean
Swift declaration
var checksForInternalCollisions: Bool

A Boolean that indicates whether the joint checks and reports collisions between the two entity instances. - Note: This does not affect how collisions of the two entities referenced in ``pin0`` and ``pin1`` interact with other entities.

set · iOS 18.0+

checksForInternalCollisions

TypeScript
set checksForInternalCollisions(value: boolean)
Swift declaration
var checksForInternalCollisions: Bool

A Boolean that indicates whether the joint checks and reports collisions between the two entity instances. - Note: This does not affect how collisions of the two entities referenced in ``pin0`` and ``pin1`` interact with other entities.

init · iOS 18.0+

init

TypeScript
static init(pin0: GeometricPin, pin1: GeometricPin, linearMotionAlongX?: PhysicsCustomJoint_MotionLimit, linearMotionAlongY?: PhysicsCustomJoint_MotionLimit, linearMotionAlongZ?: PhysicsCustomJoint_MotionLimit, angularMotionAroundX?: PhysicsCustomJoint_MotionLimit, angularMotionAroundY?: PhysicsCustomJoint_MotionLimit, angularMotionAroundZ?: PhysicsCustomJoint_MotionLimit, checksForInternalCollisions?: boolean): PhysicsCustomJoint
Swift declaration
init(pin0: GeometricPin, pin1: GeometricPin, linearMotionAlongX: PhysicsCustomJoint.MotionLimit = .fixed, linearMotionAlongY: PhysicsCustomJoint.MotionLimit = .fixed, linearMotionAlongZ: PhysicsCustomJoint.MotionLimit = .fixed, angularMotionAroundX: PhysicsCustomJoint.MotionLimit = .fixed, angularMotionAroundY: PhysicsCustomJoint.MotionLimit = .fixed, angularMotionAroundZ: PhysicsCustomJoint.MotionLimit = .fixed, checksForInternalCollisions: Bool = false)

Creates a new custom joint. - Parameters: - pin0: The local position and orientation on the first entity. - pin1: The local position and orientation on the second entity. - linearMotionAlongX: The linear motion limits along the x-axis. - linearMotionAlongY: The linear motion limits along the y-axis. - linearMotionAlongZ: The linear motion limits along the z-axis. - angularMotionAroundX: The angular motion limits around the x-axis. - angularMotionAroundY: The angular motion limits around the y-axis. - angularMotionAroundZ: The angular motion limits around the z-axis. - checksForInternalCollisions: A Boolean that indicates whether the joint checks for collisions between the two ``Entity`` instances.

get · iOS 18.0+

pin0

TypeScript
get pin0(): GeometricPin
Swift declaration
var pin0: GeometricPin

The pin that defines a local position and orientation on the first entity.

set · iOS 18.0+

pin0

TypeScript
set pin0(value: GeometricPin)
Swift declaration
var pin0: GeometricPin

The pin that defines a local position and orientation on the first entity.

get · iOS 18.0+

pin1

TypeScript
get pin1(): GeometricPin
Swift declaration
var pin1: GeometricPin

The pin that defines a local position and orientation on the second entity.

set · iOS 18.0+

pin1

TypeScript
set pin1(value: GeometricPin)
Swift declaration
var pin1: GeometricPin

The pin that defines a local position and orientation on the second entity.

get · iOS 18.0+

isActive

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

A Boolean that indicates whether the joint is active. Inactive joints do not participate in the physics simulation. One example is a joint that does not reference any ``Entity`` with ``PhysicsBodyMode/dynamic``, or when one or both the referenced entities are not active.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →