public Collision(Node parent, string name) : base(parent, name) { _collisionHandler = GetRoot<State>().GetService<CollisionHandler>(); GetRoot<State>().PreUpdateEvent += _collidedWith.Clear; GroupMask = new Bitmask(); GroupMask.BitmaskChanged += bm => _collisionHandler.ReconfigurePairs(this); PairMask = new Bitmask(); PairMask.BitmaskChanged += bm => _collisionHandler.ReconfigurePairs(this); ResolutionGroupMask = new Bitmask(); _collisionHandler.AddCollision(this); }
public bool HasMatchingBit(Bitmask other) { return (other.Mask & Mask) > 0; }
public bool HasMatchingBit(Bitmask other) { return((other.Mask & Mask) > 0); }
public void CombineMask(Bitmask mask) { Mask |= mask.Mask; }