本文整理汇总了C#中IPath.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# IPath.Insert方法的具体用法?C# IPath.Insert怎么用?C# IPath.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPath
的用法示例。
在下文中一共展示了IPath.Insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetToRoot
/// <summary>
/// Starting from the goal, recursively follow its parent while inserting it into the path, because it's moving backward
/// </summary>
/// <param name="goal"></param>
/// <param name="pathToAdd"></param>
private void GetToRoot(RRTNode goal, ref IPath pathToAdd)
{
if (goal.IsRoot == false)
{
IPathSegment segment = new LinePathSegment(goal.Parent.Point, goal.Point);
pathToAdd.Insert(0, segment);
GetToRoot((RRTNode)goal.Parent, ref pathToAdd);
}
}
示例2: ConvertNodeToPath
private void ConvertNodeToPath(IPath newNodePath, RRTNode goalNode, List<RobotTwoWheelCommand> inputList)
{
if (goalNode.IsRoot) return;
IPathSegment segment = new LinePathSegment(goalNode.Parent.Point, goalNode.Point);
newNodePath.Insert(0, segment);
inputList.Insert(0, new RobotTwoWheelCommand(goalNode.State.Command.velocity, goalNode.State.Command.turn));
ConvertNodeToPath(newNodePath, goalNode.GetParent(), inputList);
}