Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Dec 2012
Offline Last Active Dec 24 2012 05:28 PM

Posts I've Made

In Topic: Collision Detection Physics Help

23 December 2012 - 01:26 PM

Well a lot of this depends on what you're wanting to do with your physics and what kind of game you're making. Is it tile-based or otherwise? What have you tried that you weren't satisfied with? Are you sure that your detection works?

It's 3D and i'm using lwjgl (OpenGL) and I only want to do really basic stuff. I had an algorithm that worked but I couldn't detect where I walked into the cube. The algorithm was like on collision x -= x - sizeX (same with z), but since I cant detect what axis i'm hitting then cube on then it brings me to the same spot.

In Topic: A Few OpenGL Collision Detection Questions

15 December 2012 - 06:23 AM

This is not related to OpenGL

if you just want to detect if two AABBs overlaps, you can fairly easily code it yourself:

for (AABB other : allAABBs)
sweep for collisions on x-axis: if other.min.x < this.max.x &amp;&amp; other.max.x > this.min.x
if true sweep for collisions on y-axis: -
if true sweep for collisions on y-axis: -
if true yes they do collide.

If you have an insane amount of objects you could put them into an oct-tree, but the above approach is very fast

If you want some thing more you should look into one of these: http://www.google.dk...chrome&amp;ie=UTF-8

or this: http://jbullet.advel.cz/

Could you please give me a snippet of code to show how its done? (Sorry i'm new to Java Game Developement) (Btw i'm using Lwjgl and I looked into JBullet but JBullet didn't look like it's compatible with Lwjgl)