Game Development Community

Convex collision issues

by Brett Fattori · in Torque Game Engine · 03/17/2004 (8:03 am) · 5 replies

I've been spending the last few days working on something new. I wanted to keep this quiet, but I can't exactly ask for assistance if I don't explain what I'm doing. So, first, go look at this clip:

Watch near the last 1/4 of this clip

What you're looking at is a "road" generated from a spline path (a SimPath to be exact). You define the path, the object is created from it. It's an object that creates its own segments, handles convex creation and collisions, and manages itself. All self-contained. All dynamically.

However, I've been fussing with the methods for getFeatures, getPolyList, and castRay. I can tell that the player object uses the getPolyList object for it's collision, and that the wheeled vehicle uses castRay and getFeatures for the wheels, but uses getPolyList for the body.

Now, what I think is happening, is that a ray is being cast ahead of the vehicle to determine if a collision is about to occur. It's intersecting a face of the OBB for the track segment, rather than using the features of the segment itself. It then tries to "slide-up" or "slide-around" the box. It's definitely happening at the edges of the segments.

I also tried breaking the surface up into larger "planar" chunks, to simplify the collision determination. That is exhibiting problems as well, when I use buildPolyList to visually examine my convex surfaces.

Anyone have a good grasp on this and want to give it a stab? I'd really love to get this working right.

- Brett

PS: Well, as long as the cat's outta the bag..
Example #2
Example #3

#1
03/17/2004 (8:36 am)
Not that I am able to help you with your problem but I just wanted to say, wow! This is really awesome looking Brett. :)

Matt
#2
03/17/2004 (8:43 am)
Vehicles use castRay() for wheel collision (look at WheeledVehicle::extendWheels()) and getFeatures() for body collision (Vehicle::updateCollision()). Just eyeballing your video it looks likes the wheels are rebounding off of a slightly misplaced castRay() at the edges of the segment and then the springs are causing it to bounce.

Couple things to try:
1) Kill the spring force to see how much of the jumping is coming from that and how much from extendWheels()'s castRay()
2) You don't mention if this is also tied to speed? It is possible that at high speeds floating point precision errors are causing this or that the tires are impenetrating the surface slightly and being rebounded back out. Upping the integration rate might help...
#3
03/17/2004 (8:59 am)
Brett, are you going to release this very cool resource to the public when your done?
#4
03/17/2004 (10:33 am)
@MattB: Thanks.. I really didn't want to show it off just yet.

@MattF: Those are some good ideas. One thing that I can say is, the slower I cross the boundary of segment to segment, the more it's like I'm climbing a hill, or trying to get over/around an obstacle.

@David: I think I'm going to keep a close eye on this one for a while. Not to say I won't ever release it, but it'll be a while. I have some plans for this puppy.

- Brett
#5
03/17/2004 (12:11 pm)
I am glad that you did. ;)

Matt