public void TestStaticFn_Reflect_i ()
{
var a = new Vector3(20, -5, 10);
var b = new Vector3(0, -1, 1); Vector3.Normalise(ref b, out b);
var c = new Vector3(2, 0, -1); Vector3.Normalise(ref c, out c);
var d = Vector3.Zero;
var e = new Vector3(0, 1, 0);
var ex1 = new Vector3(20, 10, -5);
var ex2 = new Vector3(-4, -5, 22);
var ex3 = d;
var tests = new Tuple<Vector3, Vector3, Vector3>[]
{
//incident -> normal -> expected
new Tuple<Vector3, Vector3, Vector3> (a, b, ex1),
new Tuple<Vector3, Vector3, Vector3> (a, c, ex2),
new Tuple<Vector3, Vector3, Vector3> (d, e, ex3),
};
for (Int32 i = 0; i < tests.Length; ++i)
{
var test = tests [i];
Vector3 incident = test.Item1;
Vector3 normal = test.Item2;
Vector3 expected = test.Item3;
Vector3 result;
Vector3.Reflect(ref incident, ref normal, out result);
AssertEqualWithinReason(result, expected);
}
}