mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 17:52:08 -10:00
Fixes a subtle problem with vm_test_parallel() wherein a relative error was accidentally converted into an absolute error. Instead of comparing the result of the cross product to the zero vector, the two calculated components of the cross product are compared against each other. This permits vectors whose cross product is a large number but whose cross product partials are within relative error of each other to be treated as parallel. For example, the following two vectors may now be considered as parallel whereas before they were not: v1 = (1000004.0, 1.0, 1.0) v2 = (1000000.0, 1.0, 1.0) The relative difference between them is sufficiently small according to vm_vec_equal() for them to be considered equal, but their cross product would have elements whose magnitudes would be near 4.0 which would otherwise indicate that they are not parallel. By comparing the partials instead, a higher degree of consistency is maintained. Signed-off-by: Peter Mitsis <[email protected]>