GetRandomPointInCircle
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetRandomPointInCircle | |
| Function Description: | Generates a random point within a circle centered at a given position with a specified radius, using polar coordinates and terrain height to ensure the point lies on the actual terrain surface. | |
| File Location: | cmm.positionFunctions.lua | |
| Syntax: | CMM.GetRandomPointInCircle( table centre , number radius ) | |
| Return Value: | table | |
| Parameters: | Name | Description |
| centre | A vec2 or vec3 table with x and z keys defining the center of the circle. | |
| radius | The radius in metres of the circle; the point will be generated within this radius from the center. | |
| Example: | CMM.GetRandomPointInCircle({x = 100, z = 200}, 50) | |
| Example Description: | Creates a random point within a 50-metre radius circle centered at (100, 200), ensuring the point is on the terrain surface by using height data. | |
| Related Functions: | ||
| Notes: | ||