예제 #1
0
        // Token: 0x0600015F RID: 351 RVA: 0x000070DC File Offset: 0x000052DC
        public DistanceRay3Triangle3(Ray3 ray, Triangle3 triangle)
        {
            this = default(DistanceRay3Triangle3);
            Line3 line = new Line3(ray.Origin, ray.Direction);
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line, triangle);

            if (distanceLine3Triangle.LineParameter >= 0.0)
            {
                this.SquaredDistance        = distanceLine3Triangle.SquaredDistance;
                this.ClosestPointOnRay      = distanceLine3Triangle.ClosestPointOnLine;
                this.ClosestPointOnTriangle = distanceLine3Triangle.ClosestPointOnTriangle;
                this.RayParameter           = distanceLine3Triangle.LineParameter;
                this.TriangleBary0          = distanceLine3Triangle.TriangleBary0;
                this.TriangleBary1          = distanceLine3Triangle.TriangleBary1;
                this.TriangleBary2          = distanceLine3Triangle.TriangleBary2;
                return;
            }
            DistanceVector3Triangle3 distanceVector3Triangle = new DistanceVector3Triangle3(ray.Origin, triangle);

            this.SquaredDistance        = distanceVector3Triangle.SquaredDistance;
            this.ClosestPointOnRay      = ray.Origin;
            this.ClosestPointOnTriangle = distanceVector3Triangle.ClosestPointOnTriangle;
            this.RayParameter           = 0.0;
            this.TriangleBary0          = distanceVector3Triangle.TriangleBary0;
            this.TriangleBary1          = distanceVector3Triangle.TriangleBary1;
            this.TriangleBary2          = distanceVector3Triangle.TriangleBary2;
        }
예제 #2
0
        // Token: 0x060001CA RID: 458 RVA: 0x00008918 File Offset: 0x00006B18
        public DistanceSegment3Triangle3(Segment3 segment, Triangle3 triangle)
        {
            this = default(DistanceSegment3Triangle3);
            Line3 line = new Line3(segment.Origin, segment.Direction);
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line, triangle);

            if (distanceLine3Triangle.LineParameter < -segment.Extent)
            {
                DistanceVector3Triangle3 distanceVector3Triangle = new DistanceVector3Triangle3(segment.NegativeEnd, triangle);
                this.SquaredDistance        = distanceVector3Triangle.SquaredDistance;
                this.ClosestPointOnSegment  = segment.NegativeEnd;
                this.ClosestPointOnTriangle = distanceVector3Triangle.ClosestPointOnTriangle;
                this.SegmentParameter       = -segment.Extent;
                this.TriangleBary0          = distanceVector3Triangle.TriangleBary0;
                this.TriangleBary1          = distanceVector3Triangle.TriangleBary1;
                this.TriangleBary2          = distanceVector3Triangle.TriangleBary2;
                return;
            }
            if (distanceLine3Triangle.LineParameter <= segment.Extent)
            {
                this.SquaredDistance        = distanceLine3Triangle.SquaredDistance;
                this.ClosestPointOnSegment  = distanceLine3Triangle.ClosestPointOnLine;
                this.ClosestPointOnTriangle = distanceLine3Triangle.ClosestPointOnTriangle;
                this.SegmentParameter       = distanceLine3Triangle.LineParameter;
                this.TriangleBary0          = distanceLine3Triangle.TriangleBary0;
                this.TriangleBary1          = distanceLine3Triangle.TriangleBary1;
                this.TriangleBary2          = distanceLine3Triangle.TriangleBary2;
                return;
            }
            DistanceVector3Triangle3 distanceVector3Triangle2 = new DistanceVector3Triangle3(segment.PositiveEnd, triangle);

            this.SquaredDistance        = distanceVector3Triangle2.SquaredDistance;
            this.ClosestPointOnSegment  = segment.PositiveEnd;
            this.ClosestPointOnTriangle = distanceVector3Triangle2.ClosestPointOnTriangle;
            this.SegmentParameter       = segment.Extent;
            this.TriangleBary0          = distanceVector3Triangle2.TriangleBary0;
            this.TriangleBary1          = distanceVector3Triangle2.TriangleBary1;
            this.TriangleBary2          = distanceVector3Triangle2.TriangleBary2;
        }
예제 #3
0
        // Token: 0x0600009D RID: 157 RVA: 0x00003B68 File Offset: 0x00001D68
        public static Segment3 ShortestSegmentTo(this Line3 line3, Triangle3 triangle3)
        {
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line3, triangle3);

            return(new Segment3(distanceLine3Triangle.ClosestPointOnLine, distanceLine3Triangle.ClosestPointOnTriangle));
        }
예제 #4
0
        // Token: 0x0600009C RID: 156 RVA: 0x00003B48 File Offset: 0x00001D48
        public static Vector3 ClosestPointTo(this Line3 line3, Triangle3 triangle3)
        {
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line3, triangle3);

            return(distanceLine3Triangle.ClosestPointOnLine);
        }
예제 #5
0
        // Token: 0x0600009B RID: 155 RVA: 0x00003B28 File Offset: 0x00001D28
        public static double DistanceTo(this Line3 line3, Triangle3 triangle3)
        {
            DistanceLine3Triangle3 distanceLine3Triangle = new DistanceLine3Triangle3(line3, triangle3);

            return(distanceLine3Triangle.Distance);
        }