Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Nipsting

#1
Support / Re: Collisions
April 24, 2011, 08:45:39 PM
Now I'm by no means a programmer, so I might be reading your code wrong.

However what you could do to speed it up is put in a cutoff distance which is equal to the velocity.magnitude of your submarine. if it returns true check if the sub is moving towards or away, if it is moving towards then do a collision check on the nearest point not all of them.

Another way to do it without using rays is use a combination of box, sphere and ellipsoid as a "bounding box" for your sub and do collision checks on those. The math for primitive objects is far simpler to deal with than what you're trying atm.
#2
Support / Collision detection questions
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