mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
#SHAPES a bit of extra docu
This commit is contained in:
parent
3d7172fdf7
commit
bc5946c76e
@ -17,12 +17,12 @@
|
|||||||
-- # CIRCLE
|
-- # CIRCLE
|
||||||
-- CIRCLEs can be fetched from the drawings in the Mission Editor
|
-- 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
|
-- 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.
|
-- 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
|
-- @field #CIRCLE
|
||||||
|
|
||||||
--- CIRCLE class with properties and methods for handling circles.
|
|
||||||
CIRCLE = {
|
CIRCLE = {
|
||||||
ClassName = "CIRCLE",
|
ClassName = "CIRCLE",
|
||||||
Radius = nil,
|
Radius = nil,
|
||||||
|
|||||||
@ -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 = {
|
CUBE = {
|
||||||
ClassName = "CUBE",
|
ClassName = "CUBE",
|
||||||
Points = {},
|
Points = {},
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
--
|
---
|
||||||
--
|
--
|
||||||
-- ### Author: **nielsvaes/coconutcockpit**
|
-- ### Author: **nielsvaes/coconutcockpit**
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
-- @module Shapes.LINE
|
-- @module Shapes.LINE
|
||||||
|
|
||||||
--- OVAL class.
|
--- LINE class.
|
||||||
-- @type OVAL
|
-- @type LINE
|
||||||
-- @field #string ClassName Name of the class.
|
-- @field #string ClassName Name of the class.
|
||||||
-- @field #number Points points of the line
|
-- @field #number Points points of the line
|
||||||
-- @field #number Coords coordinates of the line
|
-- @field #number Coords coordinates of the line
|
||||||
@ -14,6 +14,7 @@
|
|||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
|
|
||||||
|
---
|
||||||
-- @field #LINE
|
-- @field #LINE
|
||||||
LINE = {
|
LINE = {
|
||||||
ClassName = "LINE",
|
ClassName = "LINE",
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
--
|
---
|
||||||
--
|
--
|
||||||
-- ### Author: **nielsvaes/coconutcockpit**
|
-- ### Author: **nielsvaes/coconutcockpit**
|
||||||
--
|
--
|
||||||
@ -18,18 +18,17 @@
|
|||||||
--
|
--
|
||||||
-- # OVAL
|
-- # OVAL
|
||||||
-- OVALs can be fetched from the drawings in the Mission Editor
|
-- 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.
|
-- 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
|
-- 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
|
-- 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.
|
-- 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
|
-- 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
|
-- a targeting pod and
|
||||||
|
|
||||||
-- @field #OVAL
|
|
||||||
|
|
||||||
--- OVAL class with properties and methods for handling ovals.
|
--- OVAL class with properties and methods for handling ovals.
|
||||||
|
-- @field #OVAL
|
||||||
OVAL = {
|
OVAL = {
|
||||||
ClassName = "OVAL",
|
ClassName = "OVAL",
|
||||||
MajorAxis = nil,
|
MajorAxis = nil,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
--
|
---
|
||||||
--
|
--
|
||||||
-- ### Author: **nielsvaes/coconutcockpit**
|
-- ### Author: **nielsvaes/coconutcockpit**
|
||||||
--
|
--
|
||||||
@ -26,10 +26,10 @@
|
|||||||
-- * A rect
|
-- * 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
|
-- 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.
|
-- 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
|
-- 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.
|
-- 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
|
-- 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
|
-- 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.
|
-- 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
|
-- 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.
|
-- the smallest.
|
||||||
|
|
||||||
|
---
|
||||||
-- @field #POLYGON
|
-- @field #POLYGON
|
||||||
|
|
||||||
POLYGON = {
|
POLYGON = {
|
||||||
ClassName = "POLYGON",
|
ClassName = "POLYGON",
|
||||||
Points = {},
|
Points = {},
|
||||||
|
|||||||
@ -30,14 +30,12 @@
|
|||||||
-- OVAL
|
-- OVAL
|
||||||
-- POLYGON
|
-- POLYGON
|
||||||
-- TRIANGLE (although this one's a bit special as well)
|
-- 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.
|
-- 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
|
-- 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
|
-- @field #SHAPE_BASE
|
||||||
|
|
||||||
|
|
||||||
SHAPE_BASE = {
|
SHAPE_BASE = {
|
||||||
ClassName = "SHAPE_BASE",
|
ClassName = "SHAPE_BASE",
|
||||||
Name = "",
|
Name = "",
|
||||||
|
|||||||
@ -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**
|
-- ### 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 = {
|
TRIANGLE = {
|
||||||
ClassName = "TRIANGLE",
|
ClassName = "TRIANGLE",
|
||||||
Points = {},
|
Points = {},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user