mirror of https://github.com/axmolengine/axmol.git
64 lines
2.1 KiB
Plaintext
64 lines
2.1 KiB
Plaintext
|
|
class CCPoint
|
|
{
|
|
float x;
|
|
float y;
|
|
CCPoint();
|
|
CCPoint(float x, float y);
|
|
CCPoint(const CCSize& size);
|
|
CCPoint operator-(const CCPoint& right) const;
|
|
CCPoint operator+(const CCPoint& right) const;
|
|
CCPoint operator*(float a) const;
|
|
CCPoint getMidpoint(const CCPoint& other) const;
|
|
float dot(const CCPoint& other) const;
|
|
float cross(const CCPoint& other) const;
|
|
CCPoint getPerp() const;
|
|
CCPoint getRPerp() const;
|
|
CCPoint project(const CCPoint& other) const;
|
|
CCPoint rotate(const CCPoint& other) const;
|
|
CCPoint unrotate(const CCPoint& other) const;
|
|
float getLengthSq() const;
|
|
float getLength() const;
|
|
float getDistance(const CCPoint& other) const;
|
|
CCPoint normalize() const;
|
|
float getAngle() const;
|
|
CCPoint getClampPoint(const CCPoint& min_inclusive, const CCPoint& max_inclusive) const;
|
|
CCPoint lerp(const CCPoint& other, float alpha) const;
|
|
bool fuzzyEquals(const CCPoint& target, float variance) const;
|
|
CCPoint rotateByAngle(const CCPoint& pivot, float angle) const;
|
|
|
|
bool equals(const CCPoint & target) const ;
|
|
static bool isLineIntersect(const CCPoint& A, const CCPoint& B,const CCPoint& C, const CCPoint& D,float* S, float* T);
|
|
static bool isSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
|
|
static CCPoint getIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
|
|
static CCPoint forAngle(const float a);
|
|
};
|
|
|
|
class CCSize
|
|
{
|
|
float width;
|
|
float height;
|
|
CCSize();
|
|
CCSize(float width, float height);
|
|
|
|
bool equals(const CCSize & target) const;
|
|
};
|
|
|
|
class CCRect
|
|
{
|
|
CCPoint origin;
|
|
CCSize size;
|
|
CCRect();
|
|
CCRect(float x, float y, float width, float height);
|
|
|
|
float getMinX();
|
|
float getMidX();
|
|
float getMaxX();
|
|
float getMinY();
|
|
float getMidY();
|
|
float getMaxY();
|
|
bool equals(const CCRect & rect) const;
|
|
bool containsPoint(const CCPoint & point) const;
|
|
bool intersectsRect(const CCRect & rect) const;
|
|
};
|