3 Replies - 1988 Views - Last Post: 18 October 2012 - 07:17 AM Rate Topic: -----

#1 maverickproton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 12

c# xna ball collision

Posted 17 October 2012 - 11:51 AM

is there another way for collision detection other than rectangular overlap

method for ball ball collision

already have class ball.cs

method required for ball collision which calculates change of velocity and direction

regards,
Is This A Good Question/Topic? 0
  • +

Replies To: c# xna ball collision

#2 foohoo  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 41
  • Joined: 10-August 07

Re: c# xna ball collision

Posted 18 October 2012 - 01:17 AM

Hi,

There's a technique called "pixel perfect" collision detection which calculates based on (as the name emplies) the actual pixels of the 2 items colliding rather than a rectangle containing them. There's a pretty good tutorial here:

http://www.riemers.n...on_Overview.php

but it is a well covered topic so there are plenty more out there!

Cheers!
Was This Post Helpful? 0
  • +
  • -

#3 maverickproton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 12

Re: c# xna ball collision

Posted 18 October 2012 - 02:11 AM

View Postfoohoo, on 18 October 2012 - 01:17 AM, said:

Hi,

There's a technique called "pixel perfect" collision detection which calculates based on (as the name emplies) the actual pixels of the 2 items colliding rather than a rectangle containing them. There's a pretty good tutorial here:

http://www.riemers.n...on_Overview.php

but it is a well covered topic so there are plenty more out there!

Cheers!


thanks
Was This Post Helpful? 0
  • +
  • -

#4 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 580
  • View blog
  • Posts: 1,287
  • Joined: 24-April 12

Re: c# xna ball collision

Posted 18 October 2012 - 07:17 AM

2D's not my forte, but if the sum of their radius's (radii?) is greater than the distance between their centers, then wouldn't they have to be overlapping? That is if they are both circles. And doesn't XNA have something for this test (I don't know if they do or not, but it seems like a common enough problem there should be a collision detection option built in for it)?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1