示例#1
0
void Triangle::SetPoints(const Point& A, const Point& B, const Point& C) {
    _pointA = A.GetPosition();
    _pointB = B.GetPosition();
    _pointC = C.GetPosition();
    CalculateDimensions();
    CalculateArea();
}
示例#2
0
Line::Line(const Point& one, const Point& two, const a2de::Color& color)
    : Shape(0.0, 0.0, 0, 0, color, false),
    _extent_one(one.GetPosition()),
    _extent_two(two.GetPosition()),
    _slope(),
    _length_squared(0.0) {
    _type = Shape::SHAPETYPE_LINE;
    CalculateLengthSquared();
    CalculateSlope();
    Shape::SetPosition(a2de::Vector2D(_extent_one.GetX() + _extent_two.GetX() / 2.0, _extent_one.GetY() + _extent_two.GetY() / 2.0));
}
示例#3
0
bool Spline::Intersects(const Point& point) const {
    return Intersects(point.GetPosition());
}
示例#4
0
double Line::GetDistance(const Point& point) const {
    return this->GetDistance(point.GetPosition());
}
示例#5
0
bool Rectangle::Intersects(const Point& point) const {
    return Intersects(point.GetPosition());
}