Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.LayerMask Class Reference

Layer mask. More...

Inheritance diagram for Dragengine.Scenery.LayerMask:

Public Member Functions

Management
void clearMask ()
 Clear the mask.
void setBit (int bit)
 Set bit.
void clearBit (int bit)
 Clear bit.
bool isEmpty ()
 All bits are cleared.
bool isBitSet (int bit)
 Bit is set.
bool isBitCleared (int bit)
 Bit is cleared.
bool matches (LayerMask layerMask)
 Layer masks share at least one bit.
bool matchesNot (LayerMask layerMask)
 Layer masks share no bits.
String toBitString ()
 Bit string representation.
void setFromBitString (String string)
 Set bits from bit string.
String toHexString ()
 Hex string representation.
void setFromHexString (String string)
 Set bits from hex string.
String toString ()
 Convert to string representation.
bool equals (Object other)
 Collision filter is equal to another object.
int hashCode ()
 Hash code for use as dictionary keys.
Operators
LayerMask operator~ ()
 Inverse of layer mask with bits set where not set and vice versa.
LayerMask operator& (LayerMask layerMask)
 Layer mask with all bits shared by both layer masks.
LayerMask operator| (LayerMask layerMask)
 Layer mask with all bits set which are set in at least one layer mask.
LayerMask operator^ (LayerMask layerMask)
 Layer mask with all bits set which are not set or cleared at the same time in both layer masks.
LayerMask operator&= (LayerMask layerMask)
 Clear all bits which are not set in layerMask.
LayerMask operator|= (LayerMask layerMask)
 Set all bits which are set in layerMask.
LayerMask operator^= (LayerMask layerMask)
 Set all bits that are different in layerMask and clear all which are identical.

Constructors

LayerMask new ()
 Create layer mask.
LayerMask new (LayerMask copy)
 Create copy of layer mask.
static LayerMask newWith (int bit)
 Create layer mask with 1 bit set.
static LayerMask newWith (int bit1, int bit2)
 Create layer mask with 2 bits set.
static LayerMask newWith (int bit1, int bit2, int bit3)
 Create layer mask with 3 bits set.
static LayerMask newWith (int bit1, int bit2, int bit3, int bit4)
 Create layer mask with 4 bits set.
static LayerMask newAll ()
 Create layer mask with all bits set.

Detailed Description

Layer mask.

Bit mask holding up to 64 bits.

This is a native class.

Member Function Documentation

◆ clearBit()

void Dragengine.Scenery.LayerMask.clearBit ( int bit)

Clear bit.

Exceptions
EOutOfBoundarybit is less than 0 or larger than 63.

References clearMask().

Referenced by isBitSet().

◆ clearMask()

void Dragengine.Scenery.LayerMask.clearMask ( )

Clear the mask.

References newAll().

Referenced by clearBit().

◆ equals()

bool Dragengine.Scenery.LayerMask.equals ( Object other)

Collision filter is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type LayerMask and both have the same bits set in the filter and category.

References toBitString().

Referenced by operator^=().

◆ hashCode()

int Dragengine.Scenery.LayerMask.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References setFromBitString(), and toHexString().

Referenced by operator^=().

◆ isBitCleared()

bool Dragengine.Scenery.LayerMask.isBitCleared ( int bit)

Bit is cleared.

Exceptions
EOutOfBoundarybit is less than 0 or larger than 63.

References isEmpty().

Referenced by toHexString().

◆ isBitSet()

bool Dragengine.Scenery.LayerMask.isBitSet ( int bit)

Bit is set.

Exceptions
EOutOfBoundarybit is less than 0 or larger than 63.

References clearBit().

Referenced by matchesNot().

◆ isEmpty()

bool Dragengine.Scenery.LayerMask.isEmpty ( )

All bits are cleared.

References setBit().

Referenced by isBitCleared().

◆ matches()

bool Dragengine.Scenery.LayerMask.matches ( LayerMask layerMask)

Layer masks share at least one bit.

Referenced by setFromHexString().

◆ matchesNot()

bool Dragengine.Scenery.LayerMask.matchesNot ( LayerMask layerMask)

Layer masks share no bits.

References isBitSet().

Referenced by toString().

◆ new() [1/2]

LayerMask Dragengine.Scenery.LayerMask.new ( )

Create layer mask.

References new().

Referenced by new(), and new().

◆ new() [2/2]

LayerMask Dragengine.Scenery.LayerMask.new ( LayerMask copy)

Create copy of layer mask.

References new().

◆ newAll()

LayerMask Dragengine.Scenery.LayerMask.newAll ( )
static

Create layer mask with all bits set.

References newWith().

Referenced by clearMask().

◆ newWith() [1/4]

LayerMask Dragengine.Scenery.LayerMask.newWith ( int bit)
static

Create layer mask with 1 bit set.

References newWith().

Referenced by newAll(), newWith(), and newWith().

◆ newWith() [2/4]

LayerMask Dragengine.Scenery.LayerMask.newWith ( int bit1,
int bit2 )
static

Create layer mask with 2 bits set.

◆ newWith() [3/4]

LayerMask Dragengine.Scenery.LayerMask.newWith ( int bit1,
int bit2,
int bit3 )
static

Create layer mask with 3 bits set.

References newWith().

◆ newWith() [4/4]

LayerMask Dragengine.Scenery.LayerMask.newWith ( int bit1,
int bit2,
int bit3,
int bit4 )
static

Create layer mask with 4 bits set.

◆ operator&()

LayerMask Dragengine.Scenery.LayerMask.operator& ( LayerMask layerMask)

Layer mask with all bits shared by both layer masks.

References setFromHexString().

◆ operator&=()

LayerMask Dragengine.Scenery.LayerMask.operator&= ( LayerMask layerMask)

Clear all bits which are not set in layerMask.

◆ operator^()

LayerMask Dragengine.Scenery.LayerMask.operator^ ( LayerMask layerMask)

Layer mask with all bits set which are not set or cleared at the same time in both layer masks.

References toString().

◆ operator^=()

LayerMask Dragengine.Scenery.LayerMask.operator^= ( LayerMask layerMask)

Set all bits that are different in layerMask and clear all which are identical.

References equals(), and hashCode().

◆ operator|()

LayerMask Dragengine.Scenery.LayerMask.operator| ( LayerMask layerMask)

Layer mask with all bits set which are set in at least one layer mask.

◆ operator|=()

LayerMask Dragengine.Scenery.LayerMask.operator|= ( LayerMask layerMask)

Set all bits which are set in layerMask.

◆ operator~()

LayerMask Dragengine.Scenery.LayerMask.operator~ ( )

Inverse of layer mask with bits set where not set and vice versa.

◆ setBit()

void Dragengine.Scenery.LayerMask.setBit ( int bit)

Set bit.

Exceptions
EOutOfBoundarybit is less than 0 or larger than 63.

Referenced by isEmpty().

◆ setFromBitString()

void Dragengine.Scenery.LayerMask.setFromBitString ( String string)

Set bits from bit string.

Referenced by hashCode().

◆ setFromHexString()

void Dragengine.Scenery.LayerMask.setFromHexString ( String string)

Set bits from hex string.

References matches().

Referenced by operator&().

◆ toBitString()

String Dragengine.Scenery.LayerMask.toBitString ( )

Bit string representation.

Referenced by equals().

◆ toHexString()

String Dragengine.Scenery.LayerMask.toHexString ( )

Hex string representation.

References isBitCleared().

Referenced by hashCode().

◆ toString()

String Dragengine.Scenery.LayerMask.toString ( )

Convert to string representation.

References matchesNot().

Referenced by operator^().


The documentation for this class was generated from the following file: