Answered step by step
Verified Expert Solution
Link Copied!

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
2
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
=
0
; i
<
pathNodes.Count;
+
+
i
)
{
pathEges.Add
(
new List
())
;
}
//
END STUDENT CODE
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

explain five important changes in the world of work;

Answered: 1 week ago

Question

What are their resources?

Answered: 1 week ago

Question

What impediments deal with customers?

Answered: 1 week ago