コード例 #1
0
 // Checks if the ball has collided with any points passed in and sets HitZone hz.
 // HitZone hz is based off the ball position (center) relative to the sides of the
 // CollisionPoint rectangle.
 public void CheckForBlockCollision(List <CollisionPoint> blockCpList)
 {
     for (int i = 0; i < blockCpList.Count; i++)
     {
         for (int j = 0; j < CollisionPointList.Count; j++)
         {
             if (blockCpList[i].CheckForCollision(CollisionPointList[j].Pos))
             {
                 CollisionPointList[j].PointHit = true;
                 hz = bc.SetHitZone(position, blockCpList[i].Rect);
                 return;
             }
             CollisionPointList[j].PointHit = false;
         }
     }
 }
コード例 #2
0
ファイル: GenericPosture.cs プロジェクト: wyj64852999/Kinovea
        private void ParseHitZone(XmlReader r)
        {
            r.ReadStartElement();

            while (r.NodeType == XmlNodeType.Element)
            {
                if (r.Name == "Polygon")
                {
                    HitZones.Add(new GenericPostureHitZonePolygon(r));
                }
                else
                {
                    string outerXml = r.ReadOuterXml();
                    log.DebugFormat("Unparsed content in XML: {0}", outerXml);
                }
            }

            r.ReadEndElement();
        }