Fix T47015: BGE Objects disappear when aligned in certain directions
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on Feb 18 2016, 4:47 AM.

Details

Summary

This fixes T47015, in KX_GameObject::AlignAxisToVect.

In the construction of the new coordinate system with one axis aligned to the vector, the use of a parallel unit vector should be prevented, however this was not the case due to a floating point precision issue (subtraction of values with too far apart exponents).

This lead to symptomatic division by zero errors when normalizing the new base vectors, due to which the aligned object was not displayed.

Also includes some comment cleanup.

Diff Detail

Niko Leopold (mangostaniko) retitled this revision from to Fix T47015: BGE "Objects disappear when aligned in certain directions".Feb 18 2016, 4:47 AM
Niko Leopold (mangostaniko) updated this object.
Niko Leopold (mangostaniko) set the repository for this revision to rB Blender.
Niko Leopold (mangostaniko) retitled this revision from Fix T47015: BGE "Objects disappear when aligned in certain directions" to Fix T47015: BGE Objects disappear when aligned in certain directions.

Looks like a very smart and accurate fix for precision! Thanks.
Still.... it's something for one of the game devs to make final decision to commit this.