<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/RealityCoordinateSpaceProjecting",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "RealityKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:19_RealityKit_SwiftUI0A25CoordinateSpaceProjectingP"
  },
  "title" : "RealityCoordinateSpaceProjecting"
}
-->

# RealityCoordinateSpaceProjecting

A protocol for coordinate spaces that can project 2D points to and from 3D.

```
protocol RealityCoordinateSpaceProjecting
```

## Topics

### Instance Methods

[`func entities(at: CGPoint, in: some CoordinateSpaceProtocol) -> [Entity]`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/entities(at:in:))

Finds all the hit entities when projecting a ray from a starting point.

[`func entity(at: CGPoint, in: some CoordinateSpaceProtocol) -> Entity?`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/entity(at:in:))

Finds the first entity hit when projecting a ray from a starting point.

[`func hitTest(point: CGPoint, in: some CoordinateSpaceProtocol, query: CollisionCastQueryType, mask: CollisionGroup) -> [CollisionCastHit]`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/hitTest(point:in:query:mask:))

Searches the scene for entities at the specified point in the view.

[`func project(point: SIMD3<Float>, to: some CoordinateSpaceProtocol) -> CGPoint?`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/project(point:to:))

Projects a point from the 3D world coordinate system of the scene to the
2D pixel coordinate system of the reality view.

[`func ray(through: CGPoint, in: some CoordinateSpaceProtocol, to: some RealityCoordinateSpace) -> (origin: SIMD3<Float>, direction: SIMD3<Float>)?`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/ray(through:in:to:))

Determines the position and direction of a ray through the given point
in the 2D space of the view.

[`func unproject(CGPoint, from: some CoordinateSpaceProtocol, to: some RealityCoordinateSpace, ontoPlane: float4x4) -> SIMD3<Float>?`](/documentation/RealityKit/RealityCoordinateSpaceProjecting/unproject(_:from:to:ontoPlane:))

Unprojects a point from the view onto a plane in 3D world coordinates.

## Relationships

### Conforming Types

[`RealityViewCameraContent`](/documentation/RealityKit/RealityViewCameraContent)

[`EntityTargetValue`](/documentation/RealityKit/EntityTargetValue)

---

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)