Exemplo n.º 1
0
        public void TestRayStartingBehind()
        {
            Vector3 boxExtents = new Vector3(10.0f, 10.0f, 10.0f);

            Assert.IsFalse(
                Ray3Aabb3Collider.FindContacts(
                    new Vector3(12.5f, -2.5f, -2.5f), Vector3.Right, boxExtents
                    ).HasContact
                );
        }
Exemplo n.º 2
0
        public void TestRayStartingInside()
        {
            Vector3      boxExtents = new Vector3(10.0f, 10.0f, 10.0f);
            LineContacts contacts   = Ray3Aabb3Collider.FindContacts(
                new Vector3(-2.5f, -2.5f, -2.5f), Vector3.Up, boxExtents
                );

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