Author Topic: Collision detection questions  (Read 1240 times)

Offline Nipsting

  • byte
  • *
  • Posts: 2
    • View Profile
Collision detection questions
« on: April 23, 2011, 07:46:12 pm »
Hi, recently started working on a game using this excellent engine.

I've got a few questions about how the collision detection in JPCT works though.

First of all, lets say I have a sphere moving at high speeds hitting another object, is there a chance it might not detect it if its moving too fast, or do the collision detection take the velocity vector into account and actually figure out there will be a collision one frame ahead of the actual collision, or in the case of sphere collision, is it just looking at the radius of the sphere and checking if the closest location it hits from the center of the sphere is less than the radius, which would give it a collision?

Also, how well would a sphere hitting a convex object handle collision detection.

I'm relatively new in the field of physics, but I'm prototyping a simple physics engine in Softimage using ICE atm, and will then be porting the math involved to java to use it with JPCT, so these questions might seem trivial, but I hope you can answer them none the less.

Edit: Did a bit more reading into the javadoc, I believe I could use checkForCollision which allows for a ray direction (using the velocity of the ball). Checking for a collision one frame ahead of time should be relatively simple then, I guess my question then would be if it is needed, or if it already does this.

Regards
Nipsting
« Last Edit: April 23, 2011, 10:02:55 pm by Nipsting »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Collision detection questions
« Reply #1 on: April 25, 2011, 08:56:23 pm »