Jump to content

GetRandomPointInCircle

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (GetRandomPointInCircle – created via PowerShell script (2025-11-11T21:12:37Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
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
centreA vec2 or vec3 table with x and z keys defining the center of the circle.
radiusThe 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: