<!--
{
  "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/PixelCastHit",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12PixelCastHitV"
  },
  "title" : "PixelCastHit"
}
-->

# PixelCastHit

```
struct PixelCastHit
```

## Topics

### Instance Properties

[`var barycentric: SIMD3<Float>?`](/documentation/RealityKit/PixelCastHit/barycentric)

The barycentric coordinate of the primitive.
See the discussion of [[barycentric_coord]] in Section “5.2.3.4 Fragment
Function Input Attributes” of Metal Shading Language Specification

[`var entity: Entity`](/documentation/RealityKit/PixelCastHit/entity)

The entity that was hit.

[`var instance: UInt32`](/documentation/RealityKit/PixelCastHit/instance)

The instance within the MeshResource of the intersection. This
can be used to index into MeshResource.contents.instances

[`var meshPart: UInt64`](/documentation/RealityKit/PixelCastHit/meshPart)

The mesh part id of the entity that was selected by the hit.

[`var normal: SIMD3<Float>`](/documentation/RealityKit/PixelCastHit/normal)

The surface normal at the point of intersection, in scene space.

[`var position: SIMD3<Float>`](/documentation/RealityKit/PixelCastHit/position)

The surface position at the point of intersection, in scene space.

[`var primitive: UInt32`](/documentation/RealityKit/PixelCastHit/primitive)

The per-primitive identifier used with barycentric coordinates.

## Relationships

### Conforms To

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

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

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

---

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)