#SHAPES a bit of extra docu

This commit is contained in:
Applevangelist 2024-04-23 09:25:47 +02:00
parent 3d7172fdf7
commit bc5946c76e
7 changed files with 50 additions and 21 deletions

View File

@ -17,12 +17,12 @@
-- # CIRCLE
-- CIRCLEs can be fetched from the drawings in the Mission Editor
---
-- This class has some of the standard CIRCLE functions you'd expect. One function of interest is CIRCLE:PointInSector() that you can use if a point is
-- within a certain sector (pizza slice) of a circle. This can be useful for many things, including rudimentary, "radar-like" searches from a unit.
--
-- CIRCLE class with properties and methods for handling circles.
-- @field #CIRCLE
--- CIRCLE class with properties and methods for handling circles.
CIRCLE = {
ClassName = "CIRCLE",
Radius = nil,

View File

@ -1,3 +1,21 @@
---
--
-- ### Author: **nielsvaes/coconutcockpit**
--
-- ===
-- @module Shapes.CUBE
--- LINE class.
-- @type CUBE
-- @field #string ClassName Name of the class.
-- @field #number Points points of the line
-- @field #number Coords coordinates of the line
--
-- ===
---
-- @field #CUBE
CUBE = {
ClassName = "CUBE",
Points = {},

View File

@ -1,12 +1,12 @@
--
---
--
-- ### Author: **nielsvaes/coconutcockpit**
--
-- ===
-- @module Shapes.LINE
--- OVAL class.
-- @type OVAL
--- LINE class.
-- @type LINE
-- @field #string ClassName Name of the class.
-- @field #number Points points of the line
-- @field #number Coords coordinates of the line
@ -14,6 +14,7 @@
--
-- ===
---
-- @field #LINE
LINE = {
ClassName = "LINE",

View File

@ -1,4 +1,4 @@
--
---
--
-- ### Author: **nielsvaes/coconutcockpit**
--
@ -18,18 +18,17 @@
--
-- # OVAL
-- OVALs can be fetched from the drawings in the Mission Editor
--
-- The major and minor axes define how elongated the shape of an oval is. This class has some basic functions that the other SHAPE classes have as well.
-- Since it's not possible to draw the shape of an oval while the mission is running, right now the draw function draws 2 cicles. One with the major axis and one with
-- the minor axis. It then draws a diamond shape on an angle where the corners touch the major and minor axes to give an indication of what the oval actually
-- looks like.
--
-- Using ovals can be handy to find an area on the ground that is actually an intersection of a cone and a plane. So imagine you're faking the view cone of
-- a targeting pod and
-- @field #OVAL
--- OVAL class with properties and methods for handling ovals.
-- @field #OVAL
OVAL = {
ClassName = "OVAL",
MajorAxis = nil,

View File

@ -1,4 +1,4 @@
--
---
--
-- ### Author: **nielsvaes/coconutcockpit**
--
@ -26,10 +26,10 @@
-- * A rect
-- Use the POLYGON:FindOnMap() of POLYGON:Find() functions for this. You can also create a non existing polygon in memory using the POLYGON:New() function. Pass in a
-- any number of Vec2s into this function to define the shape of the polygon you want.
--
-- You can draw very intricate and complex polygons in the Mission Editor to avoid (or include) map objects. You can then generate random points within this complex
-- shape for spawning groups or checking positions.
--
-- When a POLYGON is made, it's automatically triangulated. The resulting triangles are stored in POLYGON.Triangles. This also immeadiately saves the surface area
-- of the POLYGON. Because the POLYGON is triangulated, it's possible to generate random points within this POLYGON without having to use a trial and error method to see if
-- the point is contained within the shape.
@ -37,9 +37,8 @@
-- which ignores the size of the triangles in the polygon to pick a random points. This will result in more points clumping together in parts of the polygon where the triangles are
-- the smallest.
---
-- @field #POLYGON
POLYGON = {
ClassName = "POLYGON",
Points = {},

View File

@ -30,14 +30,12 @@
-- OVAL
-- POLYGON
-- TRIANGLE (although this one's a bit special as well)
--
-- ===
-- The idea is that anything you draw on the map in the Mission Editor can be turned in a shape to work with in MOOSE.
-- This is the base class that all other shape classes are built on. There are some shared functions, most of which are overridden in the derived classes
--
-- @field #SHAPE_BASE
SHAPE_BASE = {
ClassName = "SHAPE_BASE",
Name = "",

View File

@ -1,8 +1,22 @@
-- TRIANGLE class with properties and methods for handling triangles. This class is mostly used by the POLYGON class, but you can use it on its own as well
--- TRIANGLE class with properties and methods for handling triangles. This class is mostly used by the POLYGON class, but you can use it on its own as well
--
-- ### Author: **nielsvaes/coconutcockpit**
--
--
-- ===
-- @module Shapes.TRIANGLE
--- LINE class.
-- @type CUBE
-- @field #string ClassName Name of the class.
-- @field #number Points points of the line
-- @field #number Coords coordinates of the line
--
-- ===
---
-- @field #TRIANGLE
TRIANGLE = {
ClassName = "TRIANGLE",
Points = {},