mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Use love::Vector (8 bytes) instead of love::Vertex (20 bytes) for love.math.triangulate and love.math.isConvex.
This commit is contained in:
@@ -43,6 +43,14 @@ namespace love
|
||||
namespace math
|
||||
{
|
||||
|
||||
struct Triangle
|
||||
{
|
||||
Triangle(const Vector &x, const Vector &y, const Vector &z)
|
||||
: a(x), b(y), c(z)
|
||||
{}
|
||||
Vector a, b, c;
|
||||
};
|
||||
|
||||
class BezierCurve;
|
||||
|
||||
class Math : public Module
|
||||
@@ -87,7 +95,7 @@ public:
|
||||
* @param polygon Polygon to triangulate. Must not intersect itself.
|
||||
* @return List of triangles the polygon is composed of.
|
||||
**/
|
||||
std::vector<Triangle> triangulate(const std::vector<Vertex> &polygon);
|
||||
std::vector<Triangle> triangulate(const std::vector<love::Vector> &polygon);
|
||||
|
||||
/**
|
||||
* Checks whether a polygon is convex.
|
||||
@@ -95,7 +103,7 @@ public:
|
||||
* @param polygon Polygon to test.
|
||||
* @return True if the polygon is convex, false otherwise.
|
||||
**/
|
||||
bool isConvex(const std::vector<Vertex> &polygon);
|
||||
bool isConvex(const std::vector<love::Vector> &polygon);
|
||||
|
||||
/**
|
||||
* Converts a value from the sRGB (gamma) colorspace to linear RGB.
|
||||
|
||||
Reference in New Issue
Block a user