Structure

CollisionComponent

A component that gives an entity the ability to collide with other entities that also have collision components.

Declaration

struct CollisionComponent

Topics

Creating the Collision Component

init(shapes: [ShapeResource], mode: CollisionComponent.Mode, filter: CollisionFilter)

Creates a collision component with the given collision shape, mode, and filter parameters.

Setting the Collision Mode

enum CollisionComponent.Mode

A mode that dictates how much collision data is collected for a given entity.

Filtering Collisions

var filter: CollisionFilter

The collision filter used to segregate entities into different collision groups.

struct CollisionFilter

A set of masks that determine whether entities can collide during simulations.

Setting Collision Shapes

var shapes: [ShapeResource]

A collection of shape resources that collectively represent the outer dimensions of an entity for the purposes of collision detection.

class ShapeResource

A representation of a shape.

Registering a Component Type

static func registerComponent()

Registers a new component type.

Comparing Collision Components

static func == (CollisionComponent, CollisionComponent) -> Bool

Indicates whether two collision components are equal.

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

Indicates whether two collision components are not equal.

Relationships

Conforms To

See Also

Detecting Collisions

var collision: CollisionComponent?

The collision component for the model entity.

enum CollisionEvents

Events associated with collisions.

protocol HasCollision

An interface used for ray casting and collision detection.