Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }