- // vright and normal are now perpendicular, you can prove this by taking their
- // dot product and seeing that it's always exactly 0 (with no error).
-
- // NOTE: vright is NOT a unit vector at this point. vright will have length
- // not exceeding 1.0. The minimum length that vright can achieve happens when,
- // for example, the Z and X components of the normal input vector are equal,
- // and when its Y component is zero. In that case Z and X of the normal vector
- // are both approximately 0.70711. The resulting vright vector in this case
- // will have a length of 0.70711.
-
- // We're relying on the fact that MAX_WORLD_COORD is a power of 2 to keep
- // our calculation precise and relatively free of floating point error.
- // The code will work if that's not the case, but not as well.
- VectorScale(vright, MAX_WORLD_COORD * 4, vright);
-
- // At time time of this writing, MAX_WORLD_COORD was 65536 (2^16). Therefore
- // the length of vright at this point is at least 185364. A corner of the world
- // at location (65536, 65536, 65536) is distance 113512 away from the origin.
-