I have a few comments on this thread: a) The proposed algorithm for RecursiveHullTrace won't work. You can't just expand a fixed set of planes to produce a swept sphere vs. polyhedron test. The number of planes you'd need would be infinite because the surface of the expanded polyhedron (you're expanding the polyhedron by the sphere to reduce the swept sphere to a swept point) will be curved. Intuitively, it seems possible to reduce that to a small finite number if you dynamically calculate some of the planes (but you might have to know the set of all edges and vertices on the polyhedron in order to do this). These are effectively what people refer to as the "bevel" planes. They are the planes along the potential separating axes that are not on the surface of the polyhedron already. If it's possible to do this I'm sure there's some existing research around; google it. Anyway, it's definitely possible to write a sphere tracer against brushes if you consider the edges and verts as separate features. I'm just not sure you can express that as a fixed set of ray/plane tests since it seems like it will have some second order equations in it somewhere. So what I'm suggesting above is that those sqrt()s (to solve the second order equation) can be done in a prepass that computes some of the planes.
b) This is kind of a dead-end anyway unless all you care about are brushes. This won't give you a true sphere trace in the sense that engine->TraceRay() does a trace against everything in the scene (displacements, vcollides, bboxes, hitboxes, custom traces, etc). c) I think (b) is what John means below when he says swept vcollides don't work. Swept vcollides work just fine in the sense that you can use vphysics to compute sweeps of vcollides against other vcollides or boxes vs. vcollides. But it's not a framework that lets you sweep a vcollide against the entire scene - which is probably what you want (and what John wanted as I recall). In fact it's pretty straightforward to extend vphysics to do this, but the current implementation would be incredibly slow if you used any displacements at all because it would have to consider each triangle separately. d) "physics tests only happen once per frame in static positions" - not exactly sure what you are trying to say here but it sounds incorrect to me. The movement in vphysics though not described as sweeps/traces is still computed as continuous motion. It's not like all of the objects move and then do a static test to see if they are inside another object or have passed through another object. The collisions are computed continuously along the path of translation/rotation. It may still be a pain for your player movement strategy, but it certainly isn't evaluated in "static positions" if that helps to understand it better. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Sheu Sent: Wednesday, September 26, 2007 3:35 PM To: hlcoders@list.valvesoftware.com Subject: Re: [hlcoders] Creating a Sphere Trace Joel R. wrote: > -- > [ Picked text/plain from multipart/alternative ] > I really don't like the Physics system due to the many limitations we have > with it, including tracing. Which is why I want to build my own trace. > > I took a quick look at the Quake2 source code and they do a > RecursiveHullTrace which I believe HL/HL2 uses, maybe if I mimic it and take > into account the radius of my sphere I could get the trace I'm looking for. > I'll have to test this method out and see how it pans out. If I do happen > to get this trace working I'll be glad to share my results with the > everyone. The last time I was into this, the Source SDK as we have it has no support for sweeping anything other than AABBs. Swept "VCollides" don't work (I forgot the name exactly), and physics tests only happen once per frame in static positions. Really a PITA when you're trying to do anything with unusual player movement (read: proning, vehicles). -John Sheu _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders