Table of Contents

Struct PhysicsLayerMask

Namespace
Gravitas.Support
Assembly
Gravitas.dll

Represents an include mask for physics layer queries and filters.

[MemoryPackable(GenerateType.Object)]
public struct PhysicsLayerMask : IEquatable<PhysicsLayerMask>, IMemoryPackable<PhysicsLayerMask>, IMemoryPackFormatterRegister
Implements
IMemoryPackable<PhysicsLayerMask>
IMemoryPackFormatterRegister
Inherited Members

Remarks

MemoryPack GenerateType: unmanaged

int _bits

Constructors

PhysicsLayerMask(int)

Creates an include mask from its raw bit field.

public PhysicsLayerMask(int bits)

Parameters

bits int

Properties

All

Gets a mask that includes every physics layer.

[JsonIgnore]
[MemoryPackIgnore]
public static PhysicsLayerMask All { get; }

Property Value

PhysicsLayerMask

Bits

Gets the raw include-mask bits.

[JsonIgnore]
[MemoryPackIgnore]
public readonly int Bits { get; }

Property Value

int

None

Gets a mask that includes no physics layers.

[JsonIgnore]
[MemoryPackIgnore]
public static PhysicsLayerMask None { get; }

Property Value

PhysicsLayerMask

Methods

Equals(PhysicsLayerMask)

public readonly bool Equals(PhysicsLayerMask other)

Parameters

other PhysicsLayerMask

Returns

bool

Equals(object?)

public override readonly bool Equals(object? obj)

Parameters

obj object

Returns

bool

Excluding(params PhysicsLayer[])

Creates an include mask containing every layer except those specified.

public static PhysicsLayerMask Excluding(params PhysicsLayer[] excludedLayers)

Parameters

excludedLayers PhysicsLayer[]

Returns

PhysicsLayerMask

FromLayer(PhysicsLayer)

Creates an include mask containing one layer.

public static PhysicsLayerMask FromLayer(PhysicsLayer layer)

Parameters

layer PhysicsLayer

Returns

PhysicsLayerMask

FromLayer(int)

Creates an include mask containing one layer index.

public static PhysicsLayerMask FromLayer(int layerIndex)

Parameters

layerIndex int

Returns

PhysicsLayerMask

FromLayers(params PhysicsLayer[])

Creates an include mask containing the specified layers.

public static PhysicsLayerMask FromLayers(params PhysicsLayer[] layers)

Parameters

layers PhysicsLayer[]

Returns

PhysicsLayerMask

GetHashCode()

public override readonly int GetHashCode()

Returns

int

Includes(PhysicsLayer)

Determines whether this mask includes the specified layer.

public readonly bool Includes(PhysicsLayer layer)

Parameters

layer PhysicsLayer

Returns

bool

Includes(int)

Determines whether this mask includes the specified layer index.

public readonly bool Includes(int layerIndex)

Parameters

layerIndex int

Returns

bool

ToString()

public override readonly string ToString()

Returns

string

Operators

operator ==(PhysicsLayerMask, PhysicsLayerMask)

Determines whether two layer masks contain the same bits.

public static bool operator ==(PhysicsLayerMask left, PhysicsLayerMask right)

Parameters

left PhysicsLayerMask
right PhysicsLayerMask

Returns

bool

operator !=(PhysicsLayerMask, PhysicsLayerMask)

Determines whether two layer masks contain different bits.

public static bool operator !=(PhysicsLayerMask left, PhysicsLayerMask right)

Parameters

left PhysicsLayerMask
right PhysicsLayerMask

Returns

bool