Function PathTracer.ConvertCornerIndicesToPathProjected
Converts corner indices to world space positions.
void ConvertCornerIndicesToPathProjected (
NativeArray<int> | cornerIndices | The corner indices to convert. You can get these from GetNextCornerIndices. |
int | numCorners | The number of indices in the cornerIndices array. |
bool | lastCorner | True if the last corner in the path has been reached. |
NativeList<float3> | buffer | The buffer to store the converted positions in. |
float3 | up | The up axis of the agent's movement plane. |
Converts corner indices to world space positions.
The corners will not necessarily be in the same world space position as the real corners. Instead the path will be unwrapped and flattened, and then transformed onto a plane that lines up with the first portal in the funnel. For most 2D and 3D worlds, this distinction is irrelevant, but for curved worlds (e.g. a spherical world) this can make a big difference. In particular, steering towards unwrapped corners is much more likely to work well than steering towards the real corners, as they can be e.g. on the other side of a round planet.