Search Unity

Blittable bitmask

Discussion in 'Data Oriented Technology Stack' started by PublicEnumE, Nov 21, 2019.

  1. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    160
    Yesterday, I wrote some some new structs, so that I could store blittable bitmasks of any size inside an ECS Component (BitMask128, BitMask256, etc). These types also have built in enumerators, to allow for easy looping over all the set bits.

    These seem useful, but I'm wondering if other people have approached this problem differently.

    Are people using bitmasks in their ECS work? And have you tackled a similar problem in your own code?
     
  2. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
  3. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    634