As we all know there are reliability issues of using collision detection of high speed objects for bullets. Rays can be used as an alternative, but you won’t have those flashy bullet effects. So I’ve thought of a method which merges a bit of each.
An object casts a ray to represent the bullets path, then adds a high speed bullet object. Using a distance formula and the getHitPosition() of the ray, calculate the distance to whatever object the ray hit. Now you already have the speed at which the added bullet will be travelling. With this information you can calculate the exact length of time the bullet needs to exist to travel to the hit point and terminate itself. Using the simple formula:
Time = Distance / Speed
This should result in perfect termination of the high speed objects when they collide with an object, even though the effect doesn’t use collision detection. A complication with the method is time of an added object is measured in frames instead of seconds. With the new fixed timing rates this shouldn’t cause too much of a problem to convert though.
Has anyone tried this method before? Would the added logic processing outweigh the reduced physics use for overall performance?