Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (762)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (847)
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 3100 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: 40
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 (364 views)
2018-06-10 19:43:48

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

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

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

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

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

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

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

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

Solater (443 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!