Thursdays theoretical class and common questions about Lab5

27 outubro 2015, 12:53 João Miguel Dias

This thursday, the theoretical class will be a project support class. It will work as a regular Laboratory session where I help groups with implementation problems and give advice about what to do.


As for Lab 5, there are two frequently asked questions:

Where do I get the edges for the string pulling algorithm?
Well, in RAIN the nodes in the navigation graph are actually the NavMeshEdges and not the NavMesh Polygons, so you can just downcast to get the edge with the two vertices/points. However, for some reason a couple of nodes in the navigation graph are not edges, but it's ok though, you can just ignore those nodes. Resuming, the code will be something like:

foreach(var node in globalPath){
edge = node as NavMeshEdge;
if(edge != null) {//process edge here...}
}

What is the param for a global path/local path?
The param represents the current distance traversed in the path. In the case of a global path, you can use a value such as 2.45 as the param. The integer part will represent the local path inside the global path that the param refers to (e.g in the case of 2.45, 2 represents the third local path, starting at 0), while the decimal part represents the percentage of the local path traversed so far. So, param 2.45 would represent that 45% of the third local path has been traversed. You can use other representations for the param if you would like, but this is a valid one.