One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsSphericalJoint

struct · iOS 18.0+ · SDK 27.1

struct PhysicsSphericalJoint

A spherical joint that allows free rotational movement between two entities' pins. This joint has three rotational degrees of freedom and removes all translational degrees of freedom by making the positions of ``pin0`` and ``pin1`` coincide. This is also called a "ball-socket joint". To add limits to the rotational freedom of ``pin1``, define a tuple value for ``angularLimitInYZ``. This tuple defines an elliptical cone shape around the x-axis of ``pin0``, which limits the rotational freedom of ``pin1``. The rotation around the x-axis is never limited with this joint. > Tip: Pass an orientation when creating the ``GeometricPin`` instances to change the axis of rotation.

Members (10)

get · iOS 18.0+

angularLimitInYZ

TypeScript
get angularLimitInYZ(): ([number, number]) | null
Swift declaration
var angularLimitInYZ: (Float, Float)?

A cone-shaped limit of rotational freedom. The maximum value of rotation in radians from the y and z axes, or `nil` for unlimited. This pair defines an elliptical cone limit around the x-axis of the pose on the first entity, ``pin0``. If defined, the x-axis of the pose on the second entity (``pin1``) is limited to stay within this cone.

set · iOS 18.0+

angularLimitInYZ

TypeScript
set angularLimitInYZ(value: ([number, number]) | null)
Swift declaration
var angularLimitInYZ: (Float, Float)?

A cone-shaped limit of rotational freedom. The maximum value of rotation in radians from the y and z axes, or `nil` for unlimited. This pair defines an elliptical cone limit around the x-axis of the pose on the first entity, ``pin0``. If defined, the x-axis of the pose on the second entity (``pin1``) is limited to stay within this cone.

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, angularLimitInYZ?: ([number, number]) | null, checksForInternalCollisions?: boolean): PhysicsSphericalJoint
Swift declaration
init(pin0: GeometricPin, pin1: GeometricPin, angularLimitInYZ: (Float, Float)? = nil, checksForInternalCollisions: Bool = false)

Creates a new spherical joint. An elliptical cone is formed around the x-axis to limit the motion of `pin1` if `angularLimitInYZ` is defined. If `angularLimitInYZ` is undefined, `pin1` has full 360º rotational freedom in all axes. - Parameters: - pin0: The local position and orientation on the first entity. - pin1: The local position and orientation on the second entity. - angularLimitInYZ: A maximum value of rotation in radians from the y and z axes if defined. - 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 →