Advertisement
Guest User

Bounding Solution?

a guest
Apr 17th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. enum EBoundingType
  2. {
  3.     DEFAULT,
  4.     BOX,
  5.     CIRCLE
  6. }
  7.  
  8. class CBounding
  9. {
  10.     EBoundingType m_Type = EBoundingType::DEFAULT;
  11.  
  12.     bool Collide(CBounding* other)
  13.     {
  14.         if (other->m_Type == BOX)
  15.         {
  16.             Collide(static_cast<CBoundingBox*>(other));
  17.         }
  18.         else if (other->m_Type == CIRCLE)
  19.         {
  20.             Collide(static_cast<CBoundingCircle*>(other));
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement