public override bool Test(CollisionEntity entity) { bool result = false; if (entity is CollisionBox) { result = boundingBox.Intersects((entity as CollisionBox).boundingBox); } else if (entity is CollisionSphere) { result = boundingBox.Intersects((entity as CollisionSphere).boundingSphere); } return(result); }
// Stop tracking an entity public void DeregisterEntity(CollisionEntity entity) { entity.DeregisterEntity(); }
// Add a new entity to track public void RegisterEntity(CollisionEntity entity) { entity.RegisterEntity(entities); }
// Test collision with another entity public abstract bool Test(CollisionEntity entity);