Jump to content

Tools.drawPoly

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (tools.drawPoly – created via PowerShell script (2025-11-11T21:12:52Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: tools.drawPoly
Function Description: Draws a polygon in the world using a series of relative points offset from a base position, with configurable line and fill colors, and outputs the world positions for debugging via JSON.
File Location: cmm.tools.lua
Syntax: CMM.tools.drawPoly( table Position , table RelPointsArray )
Return Value: nil
Parameters: Name Description
PositionThe base position in world space from which to calculate relative points.
RelPointsArrayTable of relative point definitions, each containing 'dir' and 'range' fields specifying direction and distance to offset from the base position.
Example: CMM.tools.drawPoly({x=100, y=200, z=0}, {{dir={x=1, y=0, z=0}, range=50}, {dir={x=0, y=1, z=0}, range=30}})
Example Description: Creates a polygon with two relative points, one to the right and one upward from the base position, drawing a visible shape with default line and fill colors.
Related Functions:
Notes: