Enumeration

CollisionCastQueryType

The kinds of ray and convex shape cast queries that you can make.

Declaration

enum CollisionCastQueryType

Topics

Collision Cast Queries

case nearest

Report the closest hit.

case all

Report all hits sorted in ascending order by distance from the cast origin.

case any

Report one hit.

Comparing Collision Cast Queries

static func != (CollisionCastQueryType, CollisionCastQueryType) -> Bool

Indicates whether two cast queries are not equal.

func hash(into: inout Hasher)

Hashes the essential components of the cast query by feeding them into the given hash function.

var hashValue: Int

The hashed value of the cast query.

Relationships

Conforms To

See Also

Detecting Intersections

func raycast(origin: SIMD3<Float>, direction: SIMD3<Float>, length: Float, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit]

Performs a convex ray cast against all the geometry in the scene for a ray of a given origin, direction, and length.

func raycast(from: SIMD3<Float>, to: SIMD3<Float>, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit]

Performs a convex ray cast against all the geometry in the scene for a ray between two end points.

struct CollisionCastHit

A hit result of a collision cast.

struct CollisionGroup

A bitmask used to define the collision group to which an entity belongs, and with which it can collide.