public static GridPos TransformOccupiedPosition(GridPosR localGridPos, GridPos ori_OccupiedPosition) { GridPos temp_rot = GridPos.RotateGridPos(ori_OccupiedPosition, localGridPos.orientation); GridPos final = temp_rot + (GridPos)localGridPos; return(final); }
public static List <GridPos> TransformOccupiedPositions(GridPosR localGridPos, List <GridPos> ori_OccupiedPositions) { List <GridPos> resGP = new List <GridPos>(); foreach (GridPos oriGP in ori_OccupiedPositions) { GridPos temp_rot = GridPos.RotateGridPos(oriGP, localGridPos.orientation); GridPos final = temp_rot + (GridPos)localGridPos; resGP.Add(final); } return(resGP); }
public static List <GridPos3D> TransformOccupiedPositions_XZ(GridPosR.Orientation orientation, List <GridPos3D> ori_OccupiedPositions) { List <GridPos3D> res = new List <GridPos3D>(); foreach (GridPos3D oriGP in ori_OccupiedPositions) { GridPos temp_rot = GridPos.RotateGridPos(new GridPos(oriGP.x, oriGP.z), orientation); GridPos3D final = new GridPos3D(temp_rot.x, oriGP.y, temp_rot.z); res.Add(final); } return(res); }