Beispiel #1
0
 public void TestRayStartingBehind()
 {
     Assert.IsFalse(
         Ray2Triangle2Collider.FindContacts(
             new Vector2(1.5f, 0.5f), Vector2.UnitX,
             Vector2.UnitX, Vector2.One, Vector2.Zero
             ).HasContact
         );
 }
Beispiel #2
0
        public void TestRayStartingInside()
        {
            LineContacts contacts = Ray2Triangle2Collider.FindContacts(
                new Vector2(0.75f, 0.5f), Vector2.UnitX,
                Vector2.UnitX, Vector2.One, Vector2.Zero
                );

            Assert.That(
                contacts.EntryTime,
                Is.EqualTo(0.0f).Within(Specifications.MaximumDeviation).Ulps
                );
            Assert.That(
                contacts.ExitTime,
                Is.EqualTo(0.25f).Within(Specifications.MaximumDeviation).Ulps
                );
        }