コード例 #1
0
ファイル: Ray3Aabb3Collider.Test.cs プロジェクト: minskowl/MY
        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
                );
        }
コード例 #2
0
ファイル: Ray3Aabb3Collider.Test.cs プロジェクト: minskowl/MY
        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
                );
        }