View Single Post
Mr Kidnapper
Senior Member
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 11-14-2011, 06:37 PM

Well object distance is based purely on pivot point and only involves points in a 1:1 scale.
But lets insert numbers into the equation. An average model has four vertices per polygon. All, if not most, of these vertices are reused (And can be reused practically infinitesimally) so let's say each polygon (Quad) creates one vertex and reuses three other vertices. Let's also say I'm jumping the usual average margin, and our world contains 100,000 polys. That's still somewhere near 100,000 vertices. Let's say our collision check is simple; it searches for the distance of polys, derived by finding the geometric center of each vertex associated with the poly (X,Y,Z) and compares them with the direction they are considered facing, also described by XYZ. If the distance between them is negative, then they collide.
This could take, what? Four calculations per poly? Now lets assume this calculation is done twenty-four times per second, because "smooth" human framerate is considered 24 frames per second. 9,600,000 calculations. From a quick google, you may read that the uber slow Pentium D Processor does 2.3 billion calculations per second. Constantly calculating collisions for 100,000 polys doesn't sound like much. Technically it is, but let's ignore that.

At any rate, I have an idea for improvement. There is no game engine in the world that seriously checks collision for every poly in an object, since scenes tend to reach millions of polys fairly easily. They use simple shapes between six (boxes) and ~500 polys (Helicopter) for any given object. They call these simple shapes a "Proxy" object, and they are named that, and they do the calculations on these proxy objects.

So the idea is: Add a true/false box in the Seldom Used Properties list that reads "Is Proxy." 3D Modelers will make a subobject hierarchy that includes the proxy objects, and when the box reads "True", collisions will be calculated for that object.
Why use a property box? Because going into the Alice Object Gallery that seldom exceed several hundred polys and adding twenty more for a proxy is pointless. Only someone who is seriously inclined to add collision will go through the extra steps to add a proxy to reduce lag.

Edit: The serious problem with collision lies in what you're going to do with it. In game engines, a lot of power is consumed calculating physics from collision. So, you're going to have a simple IsColliding function? There's nothing wrong with this if you want to make an object absolutely stop upon impact. The problem is, physics needs more information. Magnitude and speed and whatnot. You can get this from the object itself but the object needs to be about as complex as a sphere.

Last edited by Mr Kidnapper; 11-14-2011 at 06:55 PM.
Reply With Quote