Spatial provides 3D math primitives for spatial computing across iOS, macOS, tvOS, watchOS, and visionOS. Use value types such as Point3D, Vector3D, Size3D, and Rect3D to describe positions and extents, Rotation3D, EulerAngles, RotationAxis3D, and Angle2D to express orientation, and Ray3D, Pose3D, and ScaledPose3D to model directed geometry and placement. For transforming geometry between coordinate spaces, apply AffineTransform3D and ProjectiveTransform3D, and convert between Cartesian and SphericalCoordinates3D representations. Most types are available in both double-precision and single-precision Float variants.
Points and Vectors 4
Value types that describe positions and directions in a 3D coordinate space.
- StPoint3DiOS 16.0+A structure that contains a point in a three-dimensional coordinate system.
- StPoint3DFloatiOS 26.0+A single-precision structure that contains a point in a three-dimensional coordinate system.
- StVector3DiOS 16.0+A structure that defines a three-element vector
- StVector3DFloatiOS 26.0+A single-precision structure that defines a three-element vector
Sizes and Rectangles 5
Value types that describe extents and axis-aligned regions in three dimensions.
- StSize3DiOS 16.0+A structure that contains width, height, and depth values.
- StSize3DFloatiOS 26.0+A single-precision structure that contains width, height, and depth values.
- StRect3DiOS 16.0+A structure that contains the location and dimensions of a 3D rectangle.
- StRect3DFloatiOS 26.0+A single-precision structure that contains the location and dimensions of a 3D rectangle.
- StDimension3DSetiOS 16.0+A structure that groups the dimensions of a spatial value along the three coordinate axes.
Rotations and Orientation 9
Types that express orientation using angles, axes, and rotation representations.
- StRotation3DiOS 16.0+A structure that represents a rotation in three dimensions.
- StRotation3DFloatiOS 26.0+A single-precision structure that represents a rotation in three dimensions.
- StEulerAnglesiOS 16.0+@abstract A structure that represents Euler angles, in radians, and ordering.
- StEulerAnglesFloatiOS 26.0+@abstract A structure that represents Euler angles, in radians, and ordering.
- StRotationAxis3DiOS 16.0+A 3D axis.
- StRotationAxis3DFloatiOS 26.0+A 3D axis.
- StAngle2DiOS 16.0+A geometric angle whose value you access in either radians or degrees.
- StAngle2DFloatiOS 26.0+A single-precision geometric angle whose value you access in either radians or degrees.
- St__SPEulerAngleOrderiOS 16.0+@abstract Constants that specify the Euler angle order.
Rays, Poses, and Placement 6
Types that model directed geometry and the position, orientation, and scale of placed content.
- StRay3DiOS 16.0+A structure that contains the origin and direction of a 3D ray.
- StRay3DFloatiOS 26.0+A single-precision structure that contains the origin and direction of a 3D ray.
- StPose3DiOS 16.0+A structure that contains a position and rotation.
- StPose3DFloatiOS 26.0+A single-precision structure that contains a position and rotation.
- StScaledPose3DA structure that contains a position, rotation, and scale.
- StScaledPose3DFloatA structure that contains a position, rotation, and scale.
Transforms 4
Affine and projective transforms for converting geometry between coordinate spaces.
- StAffineTransform3DiOS 16.0+@abstract A 3D affine transformation matrix.
- StAffineTransform3DFloatiOS 26.0+@abstract A single-precision 3D affine transformation matrix.
- StProjectiveTransform3DiOS 16.0+A 3D projective transformation matrix.
- StProjectiveTransform3DFloatiOS 26.0+A single-precision 3D projective transformation matrix.
Coordinate Representations 6
Types and axis descriptors for converting between and reasoning about coordinate systems.
- StSphericalCoordinates3DiOS 18.0+A structure that defines spherical coordinates in radial, inclination, azimuthal order.
- StSphericalCoordinates3DFloatiOS 26.0+A single-precision structure that defines spherical coordinates in radial, inclination, azimuthal order.
- StAxis3DEnumerations that describe an axis.
- EnAxisWithFactorsiOS 16.0+The axis of a shear transform.
- EnAxisWithFactorsFloatiOS 26.0+The axis of a shear transform.
- StWorldReferenceCoordinateSpaceiOS 26.0+A coordinate space that represents a world reference point.
Coordinate Space Protocols 4
Protocols that describe coordinate spaces and the values defined within them.
- PrCoordinateSpace3DiOS 26.0+A type that represents a coordinate space which you can use to convert
- PrCoordinateSpace3DFloatiOS 26.0+A protocol that describes a single-precision 3D coordinate space.
- PrCoordinateSpaceValue3DiOS 26.0+An opaque value which can be resolved to a concrete value
- PrSpatialTypeProtocoliOS 26.0+A protocol that defines the common behavior of Spatial's value types.
Geometric Primitive Protocols 5
Protocols that unify the framework's geometric primitive and volumetric value types.
- PrPrimitive3DiOS 16.0+A set of methods common to Spatial primitives.
- PrPrimitive3DProtocoliOS 26.0+A set of methods common to Spatial primitives.
- PrVolumetriciOS 16.0+A set of methods for working with Spatial primitives with volume.
- PrVolumetricProtocoliOS 26.0+A set of methods for working with Spatial primitives with volume.
- PrClampableWithinRectProtocoliOS 26.0+A set of methods that defines the interface for Spatial entities that can be clamped to a volume.
Transformation Protocols 11
Protocols that define the operations a type supports for transforming spatial geometry.
- PrTransform3DProtocoliOS 26.0+A set of methods that are common to transforms.
- PrProjectiveTransformable3DiOS 26.0+A protocol for double-precision types that can be transformed by a projective transform.
- PrProjectiveTransformable3DFloatiOS 26.0+A protocol for single-precision types that can be transformed by a projective transform.
- PrRotatable3DiOS 16.0+A set of methods that defines the interface for Spatial entities that can rotate.
- PrRotatable3DProtocoliOS 26.0+A set of methods that defines the interface for Spatial entities that can rotate.
- PrScalable3DiOS 16.0+A set of methods that defines the interface for Spatial entities that can scale.
- PrScalable3DProtocoliOS 26.0+A set of methods that defines the interface for Spatial entities that can scale.
- PrShearable3DiOS 16.0+A set of methods that defines the interface for Spatial entities that can shear.
- PrShearable3DProtocoliOS 26.0+A set of methods that defines the interface for Spatial entities that can shear.
- PrTranslatable3DiOS 16.0+A set of methods that defines the interface for Spatial entities that can translate.
- PrTranslatable3DProtocoliOS 26.0+A set of methods that defines the interface for Spatial entities that can translate.