Structure

CollisionGroup

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

Declaration

struct CollisionGroup

Topics

Standard Collision Groups

static let `default`: CollisionGroup

The default collision group for objects.

static let all: CollisionGroup

The collision group that represents all groups.

Creating a Collision Group

init()

Creates an empty option set.

init<S>(S)

Creates a new set from a finite sequence of items.

init(arrayLiteral: CollisionGroup...)

Creates a set containing the elements of the given array literal.

init(rawValue: UInt32)

Creates a collision group from a raw value.

Option Set

var isEmpty: Bool

A Boolean value that indicates whether the set has no elements.

func contains(CollisionGroup) -> Bool

Returns a Boolean value that indicates whether a given element is a member of the option set.

func formIntersection(CollisionGroup)

Removes all elements of this option set that are not also present in the given set.

func formSymmetricDifference(CollisionGroup)

Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.

func formUnion(CollisionGroup)

Inserts the elements of another set into this option set.

func insert(CollisionGroup) -> (inserted: Bool, memberAfterInsert: CollisionGroup)

Adds the given element to the option set if it is not already a member.

func intersection(CollisionGroup) -> CollisionGroup

Returns a new option set with only the elements contained in both this set and the given set.

func isDisjoint(with: CollisionGroup) -> Bool

Returns a Boolean value that indicates whether the set has no members in common with the given set.

func isStrictSubset(of: CollisionGroup) -> Bool

Returns a Boolean value that indicates whether this set is a strict subset of the given set.

func isStrictSuperset(of: CollisionGroup) -> Bool

Returns a Boolean value that indicates whether this set is a strict superset of the given set.

func isSubset(of: CollisionGroup) -> Bool

Returns a Boolean value that indicates whether the set is a subset of another set.

func isSuperset(of: CollisionGroup) -> Bool

Returns a Boolean value that indicates whether the set is a superset of the given set.

func remove(CollisionGroup) -> CollisionGroup?

Removes the given element and all elements subsumed by it.

func subtract(CollisionGroup)

Removes the elements of the given set from this set.

func subtracting(CollisionGroup) -> CollisionGroup

Returns a new set containing the elements of this set that do not occur in the given set.

func symmetricDifference(CollisionGroup) -> CollisionGroup

Returns a new option set with the elements contained in this set or in the given set, but not in both.

func union(CollisionGroup) -> CollisionGroup

Returns a new option set of the elements contained in this set, in the given set, or in both.

func update(with: CollisionGroup) -> CollisionGroup?

Inserts the given element into the set.

Relationships

Conforms To

See Also