Question: create a code in c# for the following this assignment, you will be provided with different terrains with obstacles and hard - coded path nodes.

create a code in c# for the following this assignment, you will be provided with different terrains with obstacles and hard-coded
path nodes. You must write the code to generate the path network, as a set of edges
between path nodes. An edge between path nodes exists when (a) there is no obstacle or
boundary wall between the two path nodes, (b) there is sufficient space on either side of the
edge so that an agent can follow the line without colliding with any obstacles or boundary
wall and (c) a path node that is inside the boundary but outside of any obstacles. Nodes that
are outside of the boundary or inside of obstacles, should not connect.
Furthermore, there should be edges in both directions. If there is an edge from Node A to
Node B, then there should be an edge from Node B to Node A. Also, if there should be an
edge from Node A to Node B, it should appear exactly once in the edge list for Node A (no
duplicates). Also, no nodes should link to self.
If two nodes are arbitrarily close together, including possibly located at exactly the same
location, they should still be connected.
What you need to know
Please consult homework 1 for background on the Unity Project. In addition to the
information about the game engine provided there, the following applies.
Also, make sure you first watch the Path Network lecture before attempting this assignment.
CreatePathNetwork
This is the only file you will be modifying and submitting for this homework. It provided
functionality to create a path network from provided pathNodes.
String StudentAuthorName - Please change to your name
Create()
This is the method you will be finishing. You can create helper methods in the same source
code file if you like.
Parameters:
Vector2 canvasOrigin - Bottom left corner of navigable space
float canvasWidth - Width of navigable space
float canvasHeight - Height of navigable space
List
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(Vector2 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
}
 create a code in c# for the following this assignment, you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!