Module Shapes.OVAL
Author: nielsvaes/coconutcockpit
Global(s)
Global OVAL |
OVAL class with properties and methods for handling ovals. |
Type(s)
Fields and Methods inherited from OVAL | Description |
---|---|
The angle the oval is rotated on |
|
Name of the class. |
|
Checks if a point is contained within the oval. |
|
Draws the oval on the map, for debugging |
|
Finds an oval by its name in the database. |
|
Finds an oval on the map by its name. |
|
Gets the angle of the oval. |
|
Calculates the bounding box of the oval. |
|
Gets the major axis of the oval. |
|
Gets the minor axis of the oval. |
|
Returns a random Vec2 within the oval. |
|
The major axis (radius) of the oval |
|
The minor axis (radius) of the oval |
|
Creates a new oval from a center point, major axis, minor axis, and angle. |
|
Removes the drawing of the oval from the map |
|
Sets the angle of the oval. |
|
Sets the major axis of the oval. |
|
Sets the minor axis of the oval. |
OVAL class.
Field(s)
The angle the oval is rotated on
Name of the class.
The major axis (radius) of the oval
The minor axis (radius) of the oval
Function(s)
Checks if a point is contained within the oval.
Defined in:
OVAL
Parameters:
#table point
The point to check
self
Return value:
True if the point is contained, false otherwise
Draws the oval on the map, for debugging
Defined in:
OVAL
Parameters:
#number angle
(Optional) The angle of the oval. If nil will use self.Angle
self
Finds an oval by its name in the database.
Defined in:
OVAL
Parameters:
#string shape_name
Name of the oval to find
self
Return value:
The found oval, or nil if not found
Finds an oval on the map by its name.
The oval must be drawn on the map.
Defined in:
OVAL
Parameters:
#string shape_name
Name of the oval to find
self
Return value:
The found oval, or nil if not found
Gets the angle of the oval.
Defined in:
OVAL
Return value:
#number:
The angle of the oval
Calculates the bounding box of the oval.
The bounding box is the smallest rectangle that contains the oval.
Defined in:
OVAL
Return value:
#table:
The bounding box of the oval
Gets the major axis of the oval.
Defined in:
OVAL
Return value:
#number:
The major axis of the oval
Gets the minor axis of the oval.
Defined in:
OVAL
Return value:
#number:
The minor axis of the oval
Returns a random Vec2 within the oval.
Defined in:
OVAL
Return value:
#table:
The random Vec2
Creates a new oval from a center point, major axis, minor axis, and angle.
Defined in:
OVAL
Parameters:
#table vec2
The center point of the oval
#number major_axis
The major axis of the oval
#number minor_axis
The minor axis of the oval
#number angle
The angle of the oval
self
Return value:
The new oval
Defined in:
OVAL
Parameter:
num_points
Sets the angle of the oval.
Defined in:
OVAL
Parameters:
#number value
The new angle
self
Sets the major axis of the oval.
Defined in:
OVAL
Parameters:
#number value
The new major axis
self
Sets the minor axis of the oval.
Defined in:
OVAL
Parameters:
#number value
The new minor axis
self