Game Development Community

Catching on edges

by John Cooney · in Torque Game Engine · 11/09/2005 (4:54 pm) · 0 replies

I've got an AIWheeledVehicle descendant that is doing very basic avoidance by casting a ray forward every 1/5th of a second, and turning to miss it.

I cast the ray from the center of the vehicle to the goal, and make sure that the returned collision is with the goal. This system works pretty well, however I've noticed an odd thing.

If there is an object, say a house, directly between the vehicle and the goal, it will turn to avoid it. However, if the obstruction is only partially occluding, the vehicle will cheerfully drive straight into it.

Now, looking down the line that the ray should be cast, I can see that it should collide with the house. So I suppose what I'm asking is, does the ray cast work off of a collision system that does not include poly-intersection?

I should point out that this will happen on dts or dif objects. It's most noticeable with thin objects (trees, streetlights, etc.)

I was thinking about casting two rays rather than one (offset to the left and right of the vehicle). Based on this description, do you think that solution would be more helpful?

Or should I try a different type of ray cast? Right now, I'm just using the ContainerRayCast.