Ok, I have these nodes that I want to put on a list, but there are some repeated nodes and I tried to use the List.Contains, but it is not working because all the repeated nodes are going into the list. And I can not see what I am doing wrong.
Here is the code and the values of two repeated nodes:
| for (int i = 0; i < collD.CollisionBBoxPathNodes.Count; i++) |
| { |
| BoundingBox bb = collD.CollisionBBoxPathNodes[i].BBoundingBoxValue; |
| string xnaNodeName = collD.CollisionBBoxPathNodes[i].XnaNodeNameValue; |
| string xnaNextNodeName = collD.CollisionBBoxPathNodes[i].XnaNextNodeNameValue; |
| string xnaPathName = collD.CollisionBBoxPathNodes[i].XnaPathNameValue; |
| Vector3 xnaNodePosition = collD.CollisionBBoxPathNodes[i].XnaNodePosition; |
| CollisionBBPathNode node = new CollisionBBPathNode(xnaNodeName, xnaNextNodeName, xnaPathName, xnaNodePosition, bb, CollisionType.CType.BBPathNode); |
| |
| if (!bbScenePathNodes.Contains(node)) |
| bbScenePathNodes.Add(node); |
| } |
| |
| |
// And printing the values of the two equal nodes the result will be this:
| {Min:{X:1298,639 Y:353,1761 Z:-24,5325} Max:{X:1347,704 Y:402,2411 Z:24,5325}} |
| BBPathNode |
| {X:1312,769 Y:375,4126 Z:4,554965} |
| Path1 |
| Node8 |
| Node9 |
| |
| {Min:{X:1298,639 Y:353,1761 Z:-24,5325} Max:{X:1347,704 Y:402,2411 Z:24,5325}} |
| BBPathNode |
| {X:1312,769 Y:375,4126 Z:4,554965} |
| Path1 |
| Node8 |
| Node9 |
Any ideas ?
Thanks.