Tools.drawPoly
Appearance
| 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 |
| Position | The base position in world space from which to calculate relative points. | |
| RelPointsArray | Table 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: | ||