Jump to content

GetRouteDistancePoints

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: GetRouteDistancePoints
Function Description: Calculates a series of points along a road path at a specified distance, starting from the first point and progressing sequentially until the target distance is reached. It adds each point to a table, stopping when the cumulative distance exceeds the specified value or reaches the end of the path.
File Location: cmm.spawnFunctions.lua
Syntax: CMM.GetRouteDistancePoints( table PathOnRoadsTbl , table percPoints )
Return Value: table
Parameters: Name Description
PathOnRoadsTblArray of road points, each containing x and y coordinates, representing a path to traverse.
percPointsTable of numbers from 0.01 - 0.99 as percentages
Example: CMM.PointsOnRoad({{x=100,y=200},{x=300,y=400},{x=500,y=600}}, 3000)
Example Description: Retrieves points along a road path from (100,200) to (500,600), measuring 3000 units, and returns a table of points that lie within that distance.
Related Functions:
Notes: