// 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; } } }
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(); }