Advertisement
ricci21

Ball_Table Collision

Mar 5th, 2012
833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. private bool Ball_Table(Model model1, Matrix world1)
  2.         {
  3.            
  4.             for (int meshIndex1 = 0; meshIndex1 < model1.Meshes.Count; meshIndex1++)
  5.             {
  6.                 BoundingSphere sphere1 = model1.Meshes[meshIndex1].BoundingSphere;
  7.                 sphere1 = sphere1.Transform(world1);
  8.  
  9.                 if(table_box.Intersects(sphere1))
  10.                     return true;
  11.             }
  12.             return false;
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement