I have a solution, that would also solve a few other problems.
Basically we need the aiming code to aim at the closest edge of the hitspheres, rather than the centers.
Right now, the code basically does this:
1. Aims at the center of the target.
2. Calls COB script for aiming conditions.
3. Fires weapon.
What I want the code to do is:
1. Aim at center of target. Subtract out the Radius from the line-length from the target to the firing unit.
2. Call COB script for aiming conditions.
3. Fire weapon.
Ok... assuming that we're getting the target's location, and storing as a Float3, and storing the shooter's location as a Float3, and the Radius is a value that the hit-detection code already has, and it's stored from the moment Unit.cpp runs... what math do we need to do, to shorten that line? My math skills suck, basically. Are there fast-and-dirty ways to do this, that are less accurate, but faster math? Because if we change this, the code needs to be fast, fast, fast- Spring's units are calling aiming code every frame, or every other frame, IIRC.
Please help a not-very-math-smart guy figure this out, and we can have HTH combat
