A component that gives an entity the ability to collide with other entities that also have collision components.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- Xcode 11.0+
Framework
- Reality
Kit
Declaration
struct CollisionComponent
A component that gives an entity the ability to collide with other entities that also have collision components.
SDKs
Framework
struct CollisionComponent
init(shapes: [Shape Resource], mode: Collision Component .Mode, filter: Collision Filter)
Creates a collision component with the given collision shape, mode, and filter parameters.
var mode: Collision Component .Mode
The collision mode.
enum Collision Component .Mode
A mode that dictates how much collision data is collected for a given entity.
var filter: Collision Filter
The collision filter used to segregate entities into different collision groups.
struct Collision Filter
A set of masks that determine whether entities can collide during simulations.
var shapes: [Shape Resource]
A collection of shape resources that collectively represent the outer dimensions of an entity for the purposes of collision detection.
class Shape Resource
A representation of a shape.
static func register Component()
Registers a new component type.
static func == (Collision Component, Collision Component) -> Bool
Indicates whether two collision components are equal.
static func != (Collision Component, Collision Component) -> Bool
Indicates whether two collision components are not equal.
var collision: Collision Component?
The collision component for the model entity.
enum Collision Events
Events associated with collisions.
protocol Has Collision
An interface used for ray casting and collision detection.