1 Replies - 106 Views - Last Post: Yesterday, 03:04 PM Rate Topic: -----

#1 Jordy2254  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-October 14

[2d] Physics, object collisions, and penertration.

Posted Yesterday, 02:29 AM

Hello everyone, I am currently working on a 2d game engine from pure java as it was one of my first games design project's after I've finished this one I will be making the move to C++ and use openGl with it anyway enough background:

As I'm using pure Java i don't have the ability to use a pre-built physics engine, Currently all is will with my physics engine collision wise apart from a few little bugs that need to be sorted but that's fine. One thing i am struggling to work out is how to handle Object's and other entities that are inside each other, if they spawn that way.

Thanks in advance:
Jordan

Is This A Good Question/Topic? 0
  • +

Replies To: [2d] Physics, object collisions, and penertration.

#2 Rhino1111  Icon User is online

  • D.I.C Regular
  • member icon

Reputation: 104
  • View blog
  • Posts: 250
  • Joined: 28-August 13

Re: [2d] Physics, object collisions, and penertration.

Posted Yesterday, 03:04 PM

View PostJordy2254, on 24 January 2015 - 02:29 AM, said:

As I'm using pure Java i don't have the ability to use a pre-built physics engine

what? A quick google search of "Java 2D Physics Engine" yields multiple results.
http://www.jbox2d.org/
https://github.com/w...2dphysicsengine (simple one)
https://code.google.com/p/dyn4j/

(looking over some of the code in these might help you with your specific problem)

View PostJordy2254, on 24 January 2015 - 02:29 AM, said:

One thing i am struggling to work out is how to handle Object's and other entities that are inside each other, if they spawn that way.


I'm not sure I understand. Handle what exactly? might be useful to be a little bit more specific.
with typical collision checking an object inside another object is going to throw a collision flag. Do you want it not to do that in this scenario?

I don't know anything about what you're doing, but is it not possible to spawn objects so they DONT overlap eachother? Is the overlapping of these objects needed?

This post has been edited by Rhino1111: Yesterday, 06:26 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1