<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Spatial",
  "identifier" : "/documentation/Spatial/Ray3DFloat",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Spatial"
    ],
    "preciseIdentifier" : "c:@SA@SPRay3DFloat"
  },
  "title" : "Ray3DFloat"
}
-->

# Ray3DFloat

A single-precision structure that contains the origin and direction of a 3D ray.

```
struct Ray3DFloat
```

## Topics

### Operators

[`static func * (Pose3DFloat, Ray3DFloat) -> Ray3DFloat`](/documentation/Spatial/Ray3DFloat/*(_:_:))

Returns the point that results from applying the pose to the ray.

### Initializers

[`init()`](/documentation/Spatial/Ray3DFloat/init())

[`init(Ray3D)`](/documentation/Spatial/Ray3DFloat/init(_:))

Returns a single-precision ray from a double-precision ray.

[`init(origin: Point3DFloat, direction: Vector3DFloat)`](/documentation/Spatial/Ray3DFloat/init(origin:direction:)-2oe8j)

Creates a ray from Spatial primitives that describe the origin and direction.

[`init(origin: Point3DFloat, direction: Vector3DFloat)`](/documentation/Spatial/Ray3DFloat/init(origin:direction:)-32dzt)

Creates a ray from Spatial primitives that describe the origin and direction.

[`init(origin: simd_float3, direction: simd_float3)`](/documentation/Spatial/Ray3DFloat/init(origin:direction:)-6g59d)

Creates a ray from single-precision simd vectors that describe the origin and direction.

### Instance Properties

[`var direction: Vector3DFloat`](/documentation/Spatial/Ray3DFloat/direction)

The direction of the ray.

[`var origin: Point3DFloat`](/documentation/Spatial/Ray3DFloat/origin)

The origin of the ray.

### Instance Methods

[`func applying(ScaledPose3DFloat) -> Ray3DFloat`](/documentation/Spatial/Ray3DFloat/applying(_:)-9e23e)

Returns a ray that’s transformed by the specified scaled pose.

[`func intersects(Rect3DFloat) -> Bool`](/documentation/Spatial/Ray3DFloat/intersects(_:))

Returns `true` if the the ray intersects the specified rectangle.

[`func intersects(sphereOrigin: Point3DFloat, sphereRadius: Float) -> Bool`](/documentation/Spatial/Ray3DFloat/intersects(sphereOrigin:sphereRadius:))

[`func rotated(by: simd_quatf, around: Point3DFloat) -> Ray3DFloat`](/documentation/Spatial/Ray3DFloat/rotated(by:around:)-4etjl)

Returns a ray that’s rotated by the specified rotation around a specified pivot.

[`func rotated(by: Rotation3DFloat, around: Point3DFloat) -> Ray3DFloat`](/documentation/Spatial/Ray3DFloat/rotated(by:around:)-7tmtq)

Returns a ray that’s rotated by the specified rotation around a specified pivot.

[`func unapplying(ScaledPose3DFloat) -> Ray3DFloat`](/documentation/Spatial/Ray3DFloat/unapplying(_:)-3zk38)

Returns a ray that’s transformed by the inverse of the specified scaled pose.

### Default Implementations

[CustomReflectable Implementations](/documentation/Spatial/Ray3DFloat/CustomReflectable-Implementations)

[Decodable Implementations](/documentation/Spatial/Ray3DFloat/Decodable-Implementations)

[Encodable Implementations](/documentation/Spatial/Ray3DFloat/Encodable-Implementations)

[Equatable Implementations](/documentation/Spatial/Ray3DFloat/Equatable-Implementations)

[Hashable Implementations](/documentation/Spatial/Ray3DFloat/Hashable-Implementations)

[Primitive3DProtocol Implementations](/documentation/Spatial/Ray3DFloat/Primitive3DProtocol-Implementations)

[Rotatable3DProtocol Implementations](/documentation/Spatial/Ray3DFloat/Rotatable3DProtocol-Implementations)

## Relationships

### Conforms To

[`ProjectiveTransformable3D`](/documentation/Spatial/ProjectiveTransformable3D)

[`Escapable`](/documentation/Swift/Escapable)

[`Decodable`](/documentation/Swift/Decodable)

[`Translatable3DProtocol`](/documentation/Spatial/Translatable3DProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`ProjectiveTransformable3DFloat`](/documentation/Spatial/ProjectiveTransformable3DFloat)

[`Primitive3DProtocol`](/documentation/Spatial/Primitive3DProtocol)

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`Rotatable3DProtocol`](/documentation/Spatial/Rotatable3DProtocol)

[`SpatialTypeProtocol`](/documentation/Spatial/SpatialTypeProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomReflectable`](/documentation/Swift/CustomReflectable)

[`Encodable`](/documentation/Swift/Encodable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)