public void AddNodeToMap(CollisionMap map, GraphNode node, float minz) { if (node is GraphSprite && node.ShadowPlane > minz) { if (!(node is Game.GameSprite)) { StoreCam(); X = 0; Y = 0; Z = 1; Rot = 0; node.SyncCoords(); map.AddLine(node.DrawP[0].X, node.DrawP[0].Y, node.DrawP[1].X, node.DrawP[1].Y, 0, -1); map.AddLine(node.DrawP[1].X, node.DrawP[1].Y, node.DrawP[2].X, node.DrawP[2].Y, 1, 0); map.AddLine(node.DrawP[2].X, node.DrawP[2].Y, node.DrawP[3].X, node.DrawP[3].Y, 0, 1); map.AddLine(node.DrawP[3].X, node.DrawP[3].Y, node.DrawP[0].X, node.DrawP[0].Y, -1, 0); RestoreCam(); } // RestoreCam(); } else { int vv = 5; } foreach (var sub in node.Nodes) { AddNodeToMap(map, sub, minz); } }
public CollisionMap CreateCollisionMap(float minz = 0.05f) { var map = new CollisionMap(); AddNodeToMap(map, Root, minz); return(map); }