예제 #1
0
        public Vector2 Intersect(SkeletonRay2 other)
        {
            var d = Helpers.MathHelper.Cross(other.V, this.V);

            if (d == 0)
            {
                return(Vector2.Zero);
            }

            var d2 = other.P - this.P;
            var ua = Helpers.MathHelper.Cross(this.V, d2) / d;

            if (!other._u_in(ua))
            {
                return(Vector2.Zero);
            }

            var ub = Helpers.MathHelper.Cross(other.V, d2) / d;

            if (!this._u_in(ub))
            {
                return(Vector2.Zero);
            }

            return(other.P + ua * other.V);
        }
예제 #2
0
 public SkeletonEdge(SkeletonLineSegment edge, SkeletonRay2 biSector_Left, SkeletonRay2 biSector_Right)
 {
     this.Edge           = edge;
     this.BiSector_Left  = biSector_Left;
     this.BiSector_Right = biSector_Right;
 }