Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (855)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  A library for 2d shapes and collisions  (Read 3245 times)
0 Members and 1 Guest are viewing this topic.
Offline P0jahn

Senior Devvie


Medals: 1
Projects: 3



« Posted 2015-07-15 14:31:58 »

In java, we have Shape interface which defines a bunch of shapes and handles collisions. But I dont think these are strong enough.  The collision methods dont take the rotation of the shape into consideration, for exmaple.

So I am looking for something more powerful. Something that at least support the following shapes:
- Rectangles
- Circles
- Polygons
Offline bilznatch

JGO Coder


Medals: 11
Projects: 2
Exp: 4 years


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #1 - Posted 2015-07-15 14:36:43 »

Use box2D. If you need 3D use bullet. These are the libraries that are the most widely used and supported.
Box2D: http://www.jbox2d.org/
Bullet: http://jbullet.advel.cz/
Offline P0jahn

Senior Devvie


Medals: 1
Projects: 3



« Reply #2 - Posted 2015-07-15 16:57:54 »

Hi!

I am working with 2d. However, Box2D is a physics engine and way to much for what I need.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline KudoDEV

JGO Ninja


Medals: 79
Exp: 6 years


Game Dev Hobbyist


« Reply #3 - Posted 2015-07-15 16:59:51 »

You will have to make you own for something lighter.

Put some time into it you and you will end up with something less bloated. Plus, it will be a great learning experience.

Offline bilznatch

JGO Coder


Medals: 11
Projects: 2
Exp: 4 years


I'm bad, I'm bad, I'm really... really bad T_T


« Reply #4 - Posted 2015-07-15 17:04:23 »

If you need torquing and shapes, you are in the realm of a physics engine. Use box2D. This will give you the most consistent outputs and will be something actually usable.

If you just want shaped collisions, look into Separating Axis Theorem.

There is no simple in between that I know of, because anyone who puts that much work into their collisions will just opt for the library that handles what they need already and is well established.
Offline Jesse

JGO Coder


Medals: 23



« Reply #5 - Posted 2015-07-15 18:01:09 »

I am working with 2d. However, Box2D is a physics engine and way to much for what I need.

For specific suggestions, some more info would be helpful, such as:

- Exactly what shapes you want to support (e.g. oriented rectangles or axis-aligned rectangles only).
- Whether you need continuous collision detection, or discrete only.
- Whether you need collision response, or collision detection only.

And anything else you think might be relevant. That should help narrow things down as to whether an existing solution like Box2D would be suitable, or whether a more lightweight custom solution would be a practical option.
Offline SilverTiger

JGO Coder


Medals: 41
Exp: 3 years


がんばってください!


« Reply #6 - Posted 2015-07-16 08:42:38 »

If you want to create your own physic library you may want to look a these tutorials.
It will show you how to create some physic from scratch.

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1574 views)
2018-06-10 19:43:48

EgonOlsen (1658 views)
2018-06-10 19:43:44

EgonOlsen (1145 views)
2018-06-10 19:43:20

DesertCoockie (1573 views)
2018-05-13 18:23:11

nelsongames (1174 views)
2018-04-24 18:15:36

nelsongames (1665 views)
2018-04-24 18:14:32

ivj94 (2421 views)
2018-03-24 14:47:39

ivj94 (1631 views)
2018-03-24 14:46:31

ivj94 (2719 views)
2018-03-24 14:43:53

Solater (884 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!