public void TestMassProperties() { Triangle3 testTriangle = new Triangle3( new Vector3(100.0f, 100.0f, 100.0f), new Vector3(110.0f, 100.0f, 110.0f), new Vector3(105.0f, 110.0f, 100.0f) ); Assert.AreEqual( new Vector3(105.0f, 103.33333333333333f, 103.33333333333333f), testTriangle.CenterOfMass, "Center of mass is correctly positioned" ); Assert.AreEqual( 74.999999999999972f, testTriangle.Area, "Mass of triangle is exactly determined" ); Assert.AreEqual( 23.45207879911715f, testTriangle.CircumferenceLength, "Surface area of triangle is exactly determined" ); }
public void TestMassProperties() { Triangle3 testTriangle = new Triangle3( new Vector3(100.0f, 100.0f, 100.0f), new Vector3(110.0f, 100.0f, 110.0f), new Vector3(105.0f, 110.0f, 100.0f) ); Assert.AreEqual( new Vector3(105.0f, 103.33333333333333f, 103.33333333333333f), testTriangle.CenterOfMass, "Center of mass is correctly positioned" ); Assert.AreEqual( 74.999999999999972f, testTriangle.Area, "Mass of triangle is exactly determined" ); Assert.AreEqual( 23.45207879911715f, testTriangle.CircumferenceLength, "Surface area of triangle is exactly determined" ); }
/// <summary>Determines where the range clips a triangle</summary> /// <param name="triangle">Triangle that will be checked for intersection</param> /// <returns>The times at which the range touches the triangle, if at all</returns> public LineContacts FindContacts(Triangle3 triangle) { LineContacts contacts = Collisions.Line3Triangle3Collider.FindContacts( Origin, Direction, triangle.A, triangle.B, triangle.C ); limitContactToRay(ref contacts); return contacts; }
/// <summary>Determines where the range clips a triangle</summary> /// <param name="triangle">Triangle that will be checked for intersection</param> /// <returns>The times at which the range touches the triangle, if at all</returns> public LineContacts FindContacts(Triangle3 triangle) { LineContacts contacts = Collisions.Line3Triangle3Collider.FindContacts( Start, End - Start, triangle.A, triangle.B, triangle.C ); limitContactToLineSegment(ref contacts); return contacts; }
/// <summary>Determines where the range clips a triangle</summary> /// <param name="triangle">Triangle that will be checked for intersection</param> /// <returns>The times at which the range touches the triangle, if at all</returns> public LineContacts FindContacts(Triangle3 triangle) { return Collisions.Line3Triangle3Collider.FindContacts( Offset, Direction, triangle.A, triangle.B, triangle.C ); }