One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsDistanceJoint

struct · iOS 18.0+ · SDK 27.1

struct PhysicsDistanceJoint

A joint that maintains a minimum and maximum distance between two entity pins. A distance joint restricts the distance between ``pin0`` and ``pin1``. The joint determines this closed range according to ``distanceLimit``. This joint allows full rotational freedom between ``pin0`` and ``pin1``.

Members (12)

get · iOS 18.0+

distanceLimit

TypeScript
get distanceLimit(): SDKHandle
Swift declaration
var distanceLimit: ClosedRange<Float>

Specifies the minimum and maximum allowed distance between the pins.

set · iOS 18.0+

distanceLimit

TypeScript
set distanceLimit(value: SDKHandle)
Swift declaration
var distanceLimit: ClosedRange<Float>

Specifies the minimum and maximum allowed distance between the pins.

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, distanceLimit: SDKHandle, checksForInternalCollisions?: boolean): PhysicsDistanceJoint
Swift declaration
init(pin0: GeometricPin, pin1: GeometricPin, distanceLimit: ClosedRange<Float>, checksForInternalCollisions: Bool = false)

Creates a new distance joint. - Parameters: - pin0: The local position and orientation on the first entity. - pin1: The local position and orientation on the second entity. - distanceLimit: Specifies the minimum and maximum allowed distance between the two pins. - 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.

get · iOS 18.0+

tolerance

TypeScript
get tolerance(): number
Swift declaration
var tolerance: Float

An extension of the distance limit, as a percentage-based error tolerance. For example, a tolerance of `0.01` extends the distance limit by `1` percent. When the pins exceed this distance, the joint constrains the pins until they are within the distance limit. - Important: Use a non-negative value for the tolerance.

set · iOS 18.0+

tolerance

TypeScript
set tolerance(value: number)
Swift declaration
var tolerance: Float

An extension of the distance limit, as a percentage-based error tolerance. For example, a tolerance of `0.01` extends the distance limit by `1` percent. When the pins exceed this distance, the joint constrains the pins until they are within the distance limit. - Important: Use a non-negative value for the tolerance.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →