True if this bitmask is empty (no active states).
Clear the bitmask, setting all states to inactive.
Creates a clone of this BitMask instance.
A new BitMask instance with the same value and valid states as this instance.
Check if a specific state is active.
The state to check.
True if the state is active, false otherwise.
Checks if two bitmasks structures are compatible (the same valid states).
The bitmask structure to compare with.
True if the two bitmasks have the same structure, false otherwise.
Serializes the bitmask to a JSON string.
The JSON string representing the bitmask.
Convert value of this BitMask to object representation according to structure.
The data represented by the bitmask.
Get a string representation of the bitmask in binary format.
The string representation of the bitmask.
Get the current value of the bitmask.
The current value of the bitmask.
Static
fromJSONCreates a new BitMask instance from a JSON string.
The JSON string representing the bitmask.
A new BitMask instance created from the JSON string.
Static
generateGenerates shader constants based on the provided states.
An array containing valid states.
Shader bit mask constants generated from the states.
Create a new BitMask instance.
Param: states
An object containing valid states and their corresponding initial boolean values (default is null).