示例#1
0
 public IntersectionData(bool RecipientIsFunctionCaller, LineSegment IntersectionAxis, LineSegment PenetratedSideSegment, bool ValidOverlap)
 {
     this.RecipientIsFunctionCaller = RecipientIsFunctionCaller;
     this.IntersectionAxis          = IntersectionAxis;
     this.PenetratedSideSegment     = PenetratedSideSegment;
     this.ValidOverlap = ValidOverlap;
 }
示例#2
0
        private void DrawSegment(SpriteBatch spriteBatch, LineSegment lineSegment, Texture2D lineTexture, float lineWeight = 1F)
        {
            float lineAngle = (float)Math.Atan2(lineSegment.EndPoints[1].Y - lineSegment.EndPoints[0].Y, lineSegment.EndPoints[1].X - lineSegment.EndPoints[0].X);

            spriteBatch.Draw(lineTexture, lineSegment.Midpoint, null, Color.White, lineAngle + ((float)Math.PI / 2), new Vector2((float)lineTexture.Width / 2, (float)lineTexture.Height / 2), new Vector2(lineWeight / lineTexture.Width, lineSegment.Length / lineTexture.Height), SpriteEffects.None, 0);
        }