initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <QPoint>
|
||||
#include <QRect>
|
||||
#include <QVector>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
// Equivalent of Geometric.pas. AddPoint/SubPoint/ComparePoint/RectEquals
|
||||
// are NOT ported: QPoint/QRect already provide operator+/-/== directly.
|
||||
struct Vector {
|
||||
QPoint position;
|
||||
QPoint direction;
|
||||
|
||||
double length() const;
|
||||
double angle() const;
|
||||
void setLength(double value);
|
||||
|
||||
static Vector create(QPoint p1, QPoint p2);
|
||||
};
|
||||
|
||||
int distance(QPoint p1, QPoint p2);
|
||||
double dot(QPoint p1, QPoint p2);
|
||||
// Minimum distance between line segment vw and point p; intersect receives
|
||||
// the closest point on the segment.
|
||||
int pointToLineDistance(QPoint p, QPoint v, QPoint w, QPoint &intersect);
|
||||
QPoint rotatePoint(QPoint center, QPoint p, double angle);
|
||||
QVector<QPoint> rotatePoints(QPoint center, const QVector<QPoint> &points, double angle);
|
||||
bool lineIntersect(QPoint lineAP1, QPoint lineAP2, QPoint lineBP1, QPoint lineBP2, QPoint &intersection);
|
||||
double arcTan2Point(QPoint point);
|
||||
double arcTanPoint(QPoint point);
|
||||
QRect rectEnlarge(QRect rect, int value);
|
||||
QRect shiftRect(QRect rect, QPoint delta);
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user