Esempio n. 1
0
        public void CollisionSurfaceTangent_ReturnsComponent()
        {
            //  arrange
            //  45 degree angle (down and to right) impacts
            //  the XZ horizontal plane

            Vector3 impactDirection = new Vector3(1, -1, 0).normalized;
            Vector3 surfaceNormal   = Vector3.up;
            Vector3 expected        = Vector3.right;

            //  act
            Vector3 tangent = PMath.CollisionSurfaceTangent(impactDirection, surfaceNormal);

            //  assert
            Assert.AreEqual(expected, tangent, TestHelper.ShowVariables(expected, tangent));
        }