UDBScript: fixed a bug in Vector3D's crossProduct method that resulted in wrong calculations

This commit is contained in:
biwa 2022-02-07 22:10:34 +01:00
parent 7d11b0dd27
commit f86c52c021

View file

@ -452,7 +452,11 @@ namespace CodeImp.DoomBuilder.UDBScript.Wrapper
Vector3D a1 = (Vector3D)BuilderPlug.Me.GetVectorFromObject(a, true); Vector3D a1 = (Vector3D)BuilderPlug.Me.GetVectorFromObject(a, true);
Vector3D b1 = (Vector3D)BuilderPlug.Me.GetVectorFromObject(b, true); Vector3D b1 = (Vector3D)BuilderPlug.Me.GetVectorFromObject(b, true);
return new Vector3DWrapper(a1.y * b1.x - a1.z * b1.y, a1.z * b1.x - a1.x * b1.z, a1.x * b1.y - a1.y * b1.x); return new Vector3DWrapper(
a1.y * b1.z - a1.z * b1.y,
a1.z * b1.x - a1.x * b1.z,
a1.x * b1.y - a1.y * b1.x
);
} }
catch (CantConvertToVectorException e) catch (CantConvertToVectorException e)
{ {