TransposedTransform bug in JVector
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
/// <summary>
/// Transforms a vector by the transposed of the given Matrix.
/// </summary>
/// <param name="position">The vector to transform.</param>
/// <param name="matrix">The transform matrix.</param>
/// <param name="result">The transformed vector.</param>
public static void TransposedTransform(ref JVector position, ref JMatrix matrix, out JVector result)
{
float num0 = ((position.X * matrix.M11) + (position.Y * matrix.M12)) + (position.Z * matrix.M31);
float num1 = ((position.X * matrix.M21) + (position.Y * matrix.M22)) + (position.Z * matrix.M23);
float num2 = ((position.X * matrix.M31) + (position.Y * matrix.M32)) + (position.Z * matrix.M33);
result.X = num0;
result.Y = num1;
result.Z = num2;
}
Bug at first line.
Must be:
... + (position.Z * matrix.M13);
Original issue reported on code.google.com by Ed.Ryz...@gmail.com
on 7 Jan 2013 at 5:39
GangOfPenguins commented
This appears to have been fixed