public void TestFindContactsOnPlane() { Areas.Plane3 plane = new Areas.Plane3( new Vector3(15.0f, 15.0f, 15.0f), -Vector3.Backward ); LineContacts contacts = new Line3( new Vector3(15.0f, 15.0f, 0.0f), Vector3.Backward ).FindContacts(plane); Assert.AreEqual( 15.0f, contacts.EntryTime, "Direct orthogonal contact to plane detected" ); contacts = new Line3( new Vector3(15.0f, 15.0f, 30.0f), -Vector3.Backward ).FindContacts(plane); Assert.AreEqual( 15.0f, contacts.EntryTime, "Direct orthogonal contact to plane from backside detected" ); }
public void TestFindContactsOnPlane() { Areas.Plane3 plane = new Areas.Plane3( new Vector3(15.0f, 15.0f, 15.0f), -Vector3.Backward ); LineContacts contacts = new Segment3( new Vector3(15.0f, 15.0f, 0.0f), new Vector3(15.0f, 15.0f, 30.0f) ).FindContacts(plane); Assert.AreEqual( 0.5f, contacts.EntryTime, "Direct orthogonal contact to plane detected" ); contacts = new Segment3( new Vector3(15.0f, 15.0f, 30.0f), new Vector3(15.0f, 15.0f, 0.0f) ).FindContacts(plane); Assert.AreEqual( 0.5f, contacts.EntryTime, "Direct orthogonal contact to plane from backside detected" ); }