public bool Intersects(ref TriangleF triangle) { Vector3F point; ClosestPtPointTriangle(ref Origin, ref triangle.A, ref triangle.B, ref triangle.C, out point); Vector3F v; Vector3F.Subtract(ref point, ref Origin, out v); return(v.LengthSquared() <= Radius * Radius); }
/// <summary> /// Determines whether the specified triangle is equal to the current instance of <see cref="TriangleF"/> /// with a given precision. /// </summary> /// <param name="v">The triangle to compare.</param> /// <param name="epsilon">The precision value.</param> /// <returns>True if the specified triangle is equal to the current instance of <see cref="TriangleF"/>; False otherwise.</returns> public bool Equals(TriangleF v, float epsilon) { if (!A.Equals(ref v.A, epsilon)) { return(false); } if (!B.Equals(ref v.B, epsilon)) { return(false); } if (!C.Equals(ref v.C, epsilon)) { return(false); } return(true); }
/// <summary> /// Constructs a triangle with another specified <see cref="TriangleF"/> object. /// </summary> /// <param name="source">The triangle of <see cref="TriangleF"/> format.</param> public Triangle(TriangleF source) { this.A = source.A; this.B = source.B; this.C = source.C; }
public bool Intersects(TriangleF triangle) { return(Intersects(ref triangle)); }