Function AIPathAlignedToSurface.UpdateMovementPlanes
UpdateMovementPlanes
(AIPathAlignedToSurface[] components, int count)
Calculates smoothly interpolated normals for all raycast hits and uses that to set the movement planes of the agents.
Public
Static
void UpdateMovementPlanes (
components | ||
int | count |
Calculates smoothly interpolated normals for all raycast hits and uses that to set the movement planes of the agents.
To support meshes that change at any time, we use Mesh.AcquireReadOnlyMeshData to get a read-only view of the mesh data. This is only efficient if we batch all updates and make a single call to Mesh.AcquireReadOnlyMeshData.
This method is quite convoluted due to having to read the raw vertex data streams from unity meshes to avoid allocations.