Answered step by step
Verified Expert Solution
Question
1 Approved Answer
create a path planning alogrithm in c# for a unity game that avoids obstacles implement it into the function below code : / / Student
create a path planning alogrithm in c# for a unity game that avoids obstacles implement it into the function below code :
Student code to build the path network from the given pathNodes and Obstacles
Obstacles
List of obstacles on the plane
agentRadius
the radius of the traversing agent
minPoVDist AND maxPoVDist
used for Points of Visibility
see assignment doc
pathNodes
ref parameter that contains the pathNodes to connect
or return if pathNetworkMode is set to PointsOfVisibility
pathEdges
out parameter that will contain the edges you build.
Edges cannot intersect with obstacles or boundaries. Edges must be at least agentRadius distance
from all obstacle
boundary line segments. No self edges, duplicate edges. No null lists
but can be empty
pathNetworkMode
enum that specifies PathNetwork type
see assignment doc
public static void Create
Vector
canvasOrigin float canvasWidth, float canvasHeight,
List obstacles, float agentRadius, float minPoVDist, float maxPoVDist, ref List pathNodes, out List
pathEdges
PathNetworkMode pathNetworkMode
STUDENT CODE HERE
pathEdges
new List
pathNodes
Count
;
for
int i
; i
pathNodesCount;
i
pathEges.Add
new List
;
END STUDENT CODE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started