6 Replies - 1151 Views - Last Post: 02 March 2013 - 04:22 AM Rate Topic: -----

#1 ollyMiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 22-February 13

2D java Collision detection

Posted 23 February 2013 - 03:19 AM

Does anyone know how to do 2D java collision detection not with rectangles AKA things like circles and prefurable not something too complicated around intermediate level.

if you know anything it would really be appreciated
thanks
Is This A Good Question/Topic? 0
  • +

Replies To: 2D java Collision detection

#2 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2197
  • View blog
  • Posts: 5,224
  • Joined: 10-September 10

Re: 2D java Collision detection

Posted 23 February 2013 - 04:11 AM

Your statement "not with rectangles AKA things like circles and prefurable not something too complicated" is completely confusing. What do you mean?
Was This Post Helpful? 1
  • +
  • -

#3 ollyMiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 22-February 13

Re: 2D java Collision detection

Posted 23 February 2013 - 04:51 AM

by that i mean how would you do collation detection with curved edges instead of strait ones
Was This Post Helpful? 0
  • +
  • -

#4 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 822
  • View blog
  • Posts: 2,529
  • Joined: 29-July 11

Re: 2D java Collision detection

Posted 23 February 2013 - 06:55 PM

The easiest way to do collision detection without writing an algorithm yourself is to surround your object with a shape, a Rectangle, Ellipse2D, etc. They all inherit contains() and intersects() from Shape.
Was This Post Helpful? 1
  • +
  • -

#5 ollyMiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 22-February 13

Re: 2D java Collision detection

Posted 24 February 2013 - 04:28 AM

thank you that will be very usefull
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: 2D java Collision detection

Posted 24 February 2013 - 11:10 AM

the Polygon class also has an intersect() method
All shapes can be translate to polygons. More the polygons have points more precise is the intersection
Was This Post Helpful? 1
  • +
  • -

#7 ollyMiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 22-February 13

Re: 2D java Collision detection

Posted 02 March 2013 - 04:22 AM

View Postpbl, on 24 February 2013 - 11:10 AM, said:

the Polygon class also has an intersect() method
All shapes can be translate to polygons. More the polygons have points more precise is the intersection

thank you that is very useful and is much more versitile. thank you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1